ok/jj
1
0
Fork 0
forked from mirrors/jj
Commit graph

6995 commits

Author SHA1 Message Date
Yuya Nishihara
9dc2cf802c cli: add helper to set up op template environment for the current repo state
We'll add a few more callers.
2024-09-15 20:40:46 +09:00
Yuya Nishihara
0c0e1b61e3 git-push: just say "Changes to push to <REMOTE>"
"Bookmark changes" sounds like changes will be bookmarked, and "Bookmark" here
is redundant. If we add support for pushing tags, this message will have to be
generalized anyway.
2024-09-15 07:06:56 +09:00
Yuya Nishihara
a48ecf3e62 git-push: remove redundant hash map lookup from print-changes loop 2024-09-15 07:06:56 +09:00
Yuya Nishihara
2f78c25d35 git-push: skip print-changes loop if --quiet 2024-09-15 07:06:56 +09:00
Yuya Nishihara
42f7908b8d git-push: extract function that prints bookmark changes to be pushed 2024-09-15 07:06:56 +09:00
Yuya Nishihara
c6ee6130da revset: use generic GraphEdge type in default graph iterator 2024-09-15 07:06:47 +09:00
Samuel Tardieu
6e72b1cfb0 git: add --remote option to clone command
This makes it easier to work with multiple remotes at once while
tracking the default branch of the remote used to create the local
repository:

```shell
$ jj git clone --remote upstream https://github.com/upstream-org/repo
$ cd repo
$ jj git remote add origin git@github.com:your-org/repo
$ jj config set --repo git.fetch upstream
```

In the example above, `upstream` is the repository containing the
reference source code that you might want to patch, while `origin` is
your fork where pull-request will be pushed. The branch `main@upstream`
will be tracked.
2024-09-13 18:14:57 +02:00
dependabot[bot]
fc341855e5 cargo: bump the cargo-dependencies group with 3 updates
Bumps the cargo-dependencies group with 3 updates: [anyhow](https://github.com/dtolnay/anyhow), [ignore](https://github.com/BurntSushi/ripgrep) and [rustix](https://github.com/bytecodealliance/rustix).


Updates `anyhow` from 1.0.86 to 1.0.88
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.86...1.0.88)

Updates `ignore` from 0.4.22 to 0.4.23
- [Release notes](https://github.com/BurntSushi/ripgrep/releases)
- [Changelog](https://github.com/BurntSushi/ripgrep/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/ripgrep/commits)

Updates `rustix` from 0.38.36 to 0.38.37
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.36...v0.38.37)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: ignore
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
- dependency-name: rustix
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-13 16:02:24 +00:00
dependabot[bot]
5cd0bdea1b github: bump github/codeql-action in the github-dependencies group
Bumps the github-dependencies group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.26.6 to 3.26.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](4dd16135b6...8214744c54)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-13 10:53:37 -05:00
Yuya Nishihara
41ef9a76de cli: actually test if format_short_change_id() can be parsed
It's usually included in the commit_summary template, but not guaranteed.
2024-09-13 21:59:35 +09:00
Lukas Wirth
62059dd91e Fix missing word in working-copy.md 2024-09-13 13:36:52 +02:00
Lukas Wirth
1410f2bee7 docs: Remove trailing whitespace in markdown files 2024-09-13 13:06:28 +02:00
Lukas Wirth
bccd8214df conflicts: Highlight change ids in rebase advice 2024-09-13 12:57:56 +02:00
Yuya Nishihara
bea013acd6 id_prefix: fix crash on hidden change id disambiguation
The short-prefixes revset may contain remote_branches() for example.

Fixes #4446
2024-09-13 19:32:53 +09:00
Martin von Zweigbergk
63e616c801 git: restore support for git.push-branch-prefix config but deprecate it 2024-09-12 23:28:30 -07:00
Martin von Zweigbergk
136dcac1e1 changelog: remove an unclear "in lieu of"
I wasn't sure how to read the sentence. I think "as part of" is
clearer.
2024-09-12 23:00:57 -07:00
Martin von Zweigbergk
c2220ca4d5 config-schema: update stale push-branch-prefix config
We missed this when we renamed `push-branch-prefix` to
`push-bookmark-prefix`. I changed the description slightly to try to
clarify that it's about the local bookmark that's created before
pushing it to the remote as a branch.
2024-09-12 23:00:20 -07:00
Ilya Grigoriev
74e3c4efe2 FAQ: Add another problem to be aware of when co-locating a repo 2024-09-12 21:46:36 -07:00
Emily Shaffer
5aa6fa5974 docs: introduce temporary governance voting process
In order for the governance working group to make progress establishing
jj's governance structure, we need the approval of the jj community.

Set up a temporary voting process to get that approval.

Additionally, set up a governance dir for other governance-related
documentation to sit in.

Later, when we have a permanent governance structure and enough policy
to let the community make changes without needing the governance working
group, we can delete this document.
2024-09-12 15:19:46 -07:00
Philip Metzger
5f84c73b5a RFC: Formalize our commit style to mention that we don't use conventional commits.
It's the simple _when in Rome, do as the Romans do_ rule.
2024-09-12 16:52:02 +02:00
Martin von Zweigbergk
8d4445d5d1 bookmarks: rename proto symbols from "branch"
Proto fields are identified by the tag (and the message names are not
used), so it's safe to rename them.
2024-09-11 20:49:50 -07:00
Martin von Zweigbergk
1aa2aec141 bookmarks: update some leftover uses of the word "branch" 2024-09-11 19:19:31 -07:00
Yuya Nishihara
d97a7ba86f cli: fix missed working-copy "bookmark" colors
Quoting style changed because of insta v1.40.0.
2024-09-12 09:02:16 +09:00
Yuya Nishihara
78edc6aba5 op log: add --op-diff option to embed operation diffs
This is basically "log -p" for "op log". The flag name has "op" because --diff
and --patch mean a similar thing in this context. Since -p implies --op-diff,
user can just do "op log -p" if he's okay with verbose op + content diffs.
Note that --no-graph affects both "op log" and "op diff" parts.

We might want to do some style changes later, such as inserting/deleting blank
lines, highlighting headers, etc.
2024-09-12 06:51:45 +09:00
Yuya Nishihara
050cde94ef op diff: apply word wrapping to non-graph template outputs
These contents may be embedded in "op log", and it's probably good to enable
word wrapping consistently.
2024-09-12 06:51:45 +09:00
Yuya Nishihara
babdf6b9c1 cli: relax error type of LogContentFormat::write() 2024-09-12 06:51:45 +09:00
Yuya Nishihara
6154827129 cli: make log word-wrapping helper calculate width eagerly
Multiple graphs will be nested in "op log" output, and things would be messy if
we had to calculate graph widths lazily. Let's simply make LogContentFormat
track the current available width no matter if ui.log-word-wrap is off.
2024-09-12 06:51:45 +09:00
Philip Metzger
d9c68e08b1 everything: Rename branches to bookmarks
Jujutsu's branches do not behave like Git branches, which is a major
hurdle for people adopting it from Git. They rather behave like
Mercurial's (hg) bookmarks. 

We've had multiple discussions about it in the last ~1.5 years about this rename in the Discord, 
where multiple people agreed that this _false_ familiarity does not help anyone. Initially we were 
reluctant to do it but overtime, more and more users agreed that `bookmark` was a better for name 
the current mechanism. This may be hard break for current `jj branch` users, but it will immensly 
help Jujutsu's future, by defining it as our first own term. The `[experimental-moving-branches]` 
config option is currently left alone, to force not another large config update for
users, since the last time this happened was when `jj log -T show` was removed, which immediately 
resulted in breaking users and introduced soft deprecations.

This name change will also make it easier to introduce Topics (#3402) as _topological branches_ 
with a easier model. 

This was mostly done via LSP, ripgrep and sed and a whole bunch of manual changes either from
me being lazy or thankfully pointed out by reviewers.
2024-09-11 18:54:45 +02:00
dependabot[bot]
831404628f github: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [DeterminateSystems/nix-installer-action](https://github.com/determinatesystems/nix-installer-action) and [DeterminateSystems/magic-nix-cache-action](https://github.com/determinatesystems/magic-nix-cache-action).


Updates `DeterminateSystems/nix-installer-action` from 13 to 14
- [Release notes](https://github.com/determinatesystems/nix-installer-action/releases)
- [Commits](ab6bcb2d5a...da36cb69b1)

Updates `DeterminateSystems/magic-nix-cache-action` from 7 to 8
- [Release notes](https://github.com/determinatesystems/magic-nix-cache-action/releases)
- [Commits](b46e247b89...87b14cf437)

---
updated-dependencies:
- dependency-name: DeterminateSystems/nix-installer-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
- dependency-name: DeterminateSystems/magic-nix-cache-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-10 16:47:00 -05:00
Kevin Liao
69edc7f2df Update jj edit <commit> to add commit into view heads if not already
`jj new <commit>` automatically adds the checked out commits into the view head ids. However,
`jj edit` does not.

To reproduce:
```
jj git init test
cd test
jj commit -m "my commit"
jj log -r @- -T commit_id # Save the id
jj abandon -r @-
jj edit <saved_id>

jj log -r :: # Does not show the currently editing commit 
```
2024-09-10 11:01:49 -07:00
Yuya Nishihara
d04ff1213f op diff: set up diff/template context without using WorkspaceCommandHelper
I'll use a similar setup in "op log", but for each log entry. We might want to
extract some parts to helper function, but I don't have a good idea right now.

CommandHelper::operation_template_extensions() is removed because it's unlikely
to parse operation template without loading a workspace.
2024-09-10 07:06:43 +09:00
Yuya Nishihara
1e17078eb5 op log: leverage WorkspaceCommandEnvironment to parse template
I'll add an option to include diffs in "op log", and workspace_env will be used
in order to set up diff/template contexts per operation.

cmd_op_log() is split because of owned/borrowed type differences.
2024-09-10 07:06:43 +09:00
Yuya Nishihara
e0da3ec010 cli: move some template helpers to WorkspaceCommandEnvironment
These functions will be used by "op log"/"diff"/"show".

This patch also changed the error type as it's obvious that there are no other
errors to be returned.
2024-09-10 07:06:43 +09:00
Yuya Nishihara
1da9ebcec1 cli: cache parsed revsets.short-prefixes expression
It doesn't make sense to reparse revset expression. Let's reuse the parse
result. This also simplifies error handling bits.

OnceCell is switched to the std one as we no longer need get_or_try_init().
2024-09-10 07:06:43 +09:00
Yuya Nishihara
90791216c5 cli: move revset-related contexts to WorkspaceCommandEnvironment
This makes it clear that RevsetParseContext doesn't depend on repo view.
2024-09-10 07:06:43 +09:00
Yuya Nishihara
9ca6c99508 cli: extract WorkspaceCommandEnvironment that doesn't depend on a repo
Some "operation" commands need a workspace, plus multiple repo views. We
currently load WorkspaceCommandHelper twice for that reason. It works, but
would be messy if "op log" loaded WorkspaceCommandHelper for each log entry.

This patch starts splitting non-repo data from WorkspaceCommandHelper. The
workspace object isn't owned by the environment object so the object can be
freely discarded.
2024-09-10 07:06:43 +09:00
Yuya Nishihara
54443c9a8d cli: remove unneeded &mut Ui requirement from WorkspaceCommandHelper
These functions just print messages, and never change Ui state such as
pagination.
2024-09-10 07:06:43 +09:00
Stephen Jennings
12ec2212fb faq: Add "Should I co-locate my repository?" 2024-09-09 09:42:02 -07:00
Martin von Zweigbergk
f36f4ad257 cli: make paths to auto-track configurable, add jj track
It's a pretty frequent request to have support for turning off
auto-tracking of new files and to have a command to manually track
them instead. This patch adds a `snapshot.auto-track` config to decide
which paths to auto-track (defaults to `all()`). It also adds a `jj
track` command to manually track the untracked paths.

This patch does not include displaying the untracked paths in `jj
status`, so for now this is probably only useful in colocated repos
where you can run `git status` to find the untracked files.

#323
2024-09-09 07:49:55 -07:00
Austin Seipp
882d528718 gitignore: add /buck-out/ to ignore list
While working on the Buck branch, I have been bitten about a million times by
the following setup:

- Hack away
- Switch back to main
- Run `jj st` after editing a file
- `/buck-out` gets snapshotted, because it isn't ignored
- Trip max snapshot filesize error
- Pain

There are a few ways to skin the cat but this is simplest. It's an incredibly
small addition and it may be all for naught in the long run, but this will stem
the bleeding, at least.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2024-09-07 21:07:18 -05:00
Yuya Nishihara
cf4a7e34b9 tests: remove temporary copy of workspace.repo_path() from TestWorkspace 2024-09-08 05:40:52 +09:00
Yuya Nishihara
653e8087da workspace: make workspace_root() and repo_path() return slice &Path
It's common to return &PathBuf as &Path.
2024-09-08 05:40:52 +09:00
Yuya Nishihara
47307556dd working_copy: pass SnapshotOptions by reference
Though SnapshotOptions can be cheaply cloned, it doesn't make much sense that
snapshot() consumes a settings-like object.
2024-09-08 04:51:21 +09:00
Martin von Zweigbergk
4fb7dba73d repo: remove repo_path from ReadonlyRepo and RepoLoader
When loading repos on a server, there is no repo path. We currently
use a placeholder at Google. This patch will let us not do that.

I think we can remove the paths from `Workspace` too, but I'll leave
that for later, if at all.
2024-09-07 12:20:02 -07:00
Martin von Zweigbergk
0b6714a33c workspace: take old repo path as separate argument
As I mentioned in recent patches, I'm about to remove
`ReadonlyRepo::repo_path()`.
2024-09-07 12:20:02 -07:00
Martin von Zweigbergk
19f383ffdd tests: avoid ReadonlyRepo::repo_path() 2024-09-07 12:20:02 -07:00
Martin von Zweigbergk
a06c393716 tests: use canonicalized paths in TestBackend
In `TestBackend`, we simply use the path as key to look up the storage
in memory. That means we can't rely on the file system to look find
the same path given two different representaitons of the same path. We
therefore need to canonicalize the paths if we want to allow the
caller to pass in different paths for the same real path.
2024-09-07 12:20:02 -07:00
Martin von Zweigbergk
0a94dcc5e3 repo: rename RepoLoader::init() to init_from_file_system()
`RepoLoader` can be used on a server. You would then call
`RepoLoader::new()`. Let's clarify what `init()` does by renaming it
and documenting it.

I think `WorkspaceLoader`, OTOH, is only useful for loading a
workspace from disk. I also documented that.
2024-09-07 12:20:02 -07:00
Martin von Zweigbergk
bfb16a4c54 cli: get repo path from WorkspaceCommandHelper, not from ReadonlyRepo
I'd like to remove `ReadonlyRepo::repo_path()` since it doesn't make
sense when the repo is stored in a database.
2024-09-07 12:20:02 -07:00
Martin von Zweigbergk
b22d8fefd9 local_working_copy: pass max file size to snapshot directly
We were passing the max file size to snapshot to
`WorkingCopy::snapshot()` via `UserSettings`. It's simpler and more
flexible to set it  on `SnapshotOptions` instead.
2024-09-07 11:33:05 -07:00