A common recommendation for new users is for them to add a `jj tug`
alias. This change makes that alias less necessary, since a command like
`jj bookmark move --to @-` can be used instead for most cases. We could
also potentially improve this further by changing the default revset for
`--to`, but that can be a separate discussion.
The `closest_bookmarks(to)` revset is inspired by the discussion in
https://github.com/jj-vcs/jj/discussions/5568#discussioncomment-12674748.
I think it makes sense for it to be plural though, since it is allowed
for it to return multiple bookmarks.
This is an easy part of Git extra table GC. The implementation is quite similar
to SimpleOpStore::gc(). Since we don't delete unreachable "commit" entries from
the table segments, this wouldn't improve runtime performance. Directory lookup
might get slightly faster thanks to fewer file entries, though.
#12, #8312
This is pretty low level, but we can at least know which extras table files are
active. The --key-size parameter doesn't matter so long as it is smaller than
the actual key size, but we might add sanity check later.
The 'gerrit upload' cli command is meant to support uploading commits
that have an explicit "Change-Id: ..." footer, and those that don't. In
the latter case, a temporary copy of the commit being uploaded will be
created, with the Change-Id set based on the jj change id.
Prior to this commit, there was a bug in this implementation when a
chain of commits contained some with Change-Id footers and some without.
Say we have commits a->b->c, where b has no Change-Id footer but c does
(this case is what's now tested in the test_gerrit_upload_local case).
The old logic would:
- create a new version of b (let's call it b*), with a CommitId footer,
and populate the 'old_to_new' map with 'b -> b*'
- not create a new version of c, and populate the 'old_to_new' map with
'c -> c'
- push the 'new' version of c, which is c itself. However, c has b as a
parent, not b*, so this fails to send to gerrit because b has no
Commit-Id footer!
After this commit, we create a new temporary commit if either the
description is changed (as before), or if any parents are different from
the original commit's parents. This does not change the behavior for
either the all-explicit or all-implicit ChangeId cases, but fixes the
behavior in this mixed case.
The 'gerrit upload' command has logic to handle commits with the
"Change-Id" explicitly set within the commit message, and commits
without the Change-Id explicitly set. This commit adds a test for the
behavior when all commits have the Change-Id explicitly set.
Also fix typo in existing test comment
It's usually going to be easier for a user to run the same command again
but with a change offset appended, so I think these are more helpful
than commit IDs.
I'm going to add a way to select a specific commit from the set of
commits with a given change ID. We could sort these by committer
timestamp or something else, but index position is convenient because it
doesn't require reading the commits. The exact order isn't too
important, but giving newer commits lower offset numbers is nice because
newer commits are used more frequently.
This cross-reference was added in 998727266c (March 2023) when
ListTemplate was first documented. At that time, List only had two
methods: .join() and .map(). The reference made some sense since
ListTemplate was the result type of .map() and shared the .join()
method.
However, List has since grown significantly with .len(), .filter(),
.any(), .all(), and Boolean conversion - none of which ListTemplate
supports. ListTemplate still only has .join(). This makes the
cross-reference misleading, as it implies a compatibility that
doesn't exist (unlike List<Trailer> which truly extends List).
Fixes#7951
The goal of this change is to unify defaults of string patterns in revsets and
command arguments. Glob is a good default because it's largely the same as exact
matching, and we can easily express substring patterns with globs.
The hint for "jj git fetch -b<glob>" is deleted since exact:<glob> is now
required in order to trigger the error.
This patch also updates help of clone/fetch --branch patterns. Glob and operator
support in refspecs is limited.
When using `--interactive` or path arguments, it wasn't clear from the
help text what happens to the changes that aren't selected. This adds
an explanation to the main command documentation and updates the flag
and argument descriptions to use "current commit" instead.
Fixes#6666
Instead of forking a git process, use `gix` to toggle `core.bare` config.
The original `git -C <repo_root>/.jj/repo/store/git config repo.bare
<true|false>` fails when the user has `safe.bareRepository` config set to
'explicit'. A typical failure looks like this:
% jj git colocation disable
Error: Failed to set core.bare to true in Git config.
Caused by: Git config failed: fatal: not in a git directory
.git is moved to .jj/repo/store/git as a bare repo, and if we run git directly:
% git -C .jj/repo/store/git config repo.bare true
fatal: not in a git directory
% git -C .jj/repo/store/git status
fatal: cannot use bare repository
<repo_root>/.jj/repo/store/git (safe.bareRepository is 'explicit')
Use `gix` to avoid forking git and being interferred by git's configs.
These two are the last commands which don't support logical operators in string
patterns. The old <kind>:<name>@<remote> syntax had various problems including:
1. substring patterns look weird (e.g. `substring:x@y` means `*x*@*y*`)
2. cannot express "all but <name> for all remotes" (e.g. `(~gh-pages)@(*)`)
In addition to that, the revset parser doesn't support `<name>@<remote>`
prefixed by `<kind>:`.
This patch introduces separate --remote argument to address these problems. The
default is `glob:*` (or `~git`), so we wouldn't have to specify the remote in
many cases. One caveat is that `jj bookmark track` is not idempotent if there
are multiple remotes:
# there are two remotes: origin and upstream,
# and only foo@origin exists
$ jj bookmark track foo
# tracks foo@origin and creates new local bookmark foo
$ jj bookmark track foo
# tracks absent foo@upstream as we now have a local bookmark
This is wild. We might want to add a flag or a new command to track absent
remote bookmarks to push.
"Unmatched names" warnings are now emitted for bookmark and remote names
separately. To keep the implementation simple, the search space isn't restricted
by the other parameter. For example, "jj bookmark track foo --remote=bar" won't
show a warning if "foo" exists locally or in any remote.
Closes#4260
This will help notice small hunks in inlined diff lines. Not all terminals would
support "dim" attribute, but I think that's okay since the diff output should be
readable with/without this change.
Closes#5140
Handling of dim and bold is a bit complicated because these two attributes
cannot be unset individually. I think NormalIntensity will work for resetting
both bold and dim, but I don't have expertise on terminal implementations. So
this patch applies the same workaround as bold to dim.
Fixes#1941
I'm including this in the contributing.md rather than in docs/technical because
it's not particularly long, and there's already some information there.