std::fs::rename() and symlink() aren't added to TestWorkDir. There are few
instances of rename(). work_dir.symlink() would be a bit unclear whether the
link content path is normalized, which usually shouldn't.
As described in #5909, in the case where jj was initialized in a
shallowly cloned repository which was then unshallow'd, jj does not
import the fetched commits that were outside the shallow boundary.
However, it does import the ones after the boundary, which after
unshallowing do not contain the changes made before the boundary.
Therefore, when running annotate in such a case, jj would panic because
it does not find the commit from which a line originates. This sets the
empty commit as carrying the blame for that line.
All "short" formats should be able to be combined with -p/--patch. It was also
weird that "short" diff stats followed "long" color-words/git diffs.
Fixes#5986
`jj resolve` will currently try to resolve the executable bit and will
clear it if it can't be resolved. I don't think the executable bit
should be affected by the external merge tool. We could preset the
flags on the files we pass to the merge tool and then expect the merge
tool to update the flags, but we don't do that. I'm not sure that's a
good idea (few merge tools probably expect that), but since we don't
do it, I think it's better to leave the executable bits
unchanged. This patch makes it so by calling
`Merge::with_new_file_ids()` on the original conflict whether or not
the content-level conflict was resolved.
I noticed this was while working on the copy-tracking proposal in PR
#4988, which involves adding copy information in the `TreeValue`. If
we do implement that, then we should preserve copy information here
too (in addition to the executable flag). That will automatically work
after this patch.
If we add copy info to `TreeValue::File`, we will want to preserve
that when the user runs `jj chmod`. It's easier to preserve it by
updating the `Merge<Option<TreeValue>>` in place, so that's what this
patch does.
We could replace clap's "SuggestedSubcommand" instead of removing it,
but then the user might not notice that this is a custom suggestion and
not pay enough attention to it.
This uses the just-released https://github.com/clap-rs/clap/pull/5941.
There are alternative ways to solving the problem addressed by the next
commit, but they don't seem to preserve color well. So, let's have a
test to make sure future refactorings can tell whether this issue is
still relevant.
This removes the special case for RefName::LocalBranch(_), which can be
processed as a remote bookmark.
"jj git import" now prints local bookmarks and tags with @git suffix. I think
this is more correct since these refs are imported from the backing Git
repository.
If `--to` is going to become a required argument, it should
have a short alias as it will be used quite frequently.
Given that `--to` has a short alias it only makes sense to
allow `-f` for `--from` as this is consistent with other
commands and nothing makes this particular command special.
It's super common to pair test_env with repo_path.
Some of the tests still use absolute paths because it seemed rather confusing
to mix paths relative to the repo_root and to the env_root.
I'm going to reimplement git_ref_filter to process translated remote bookmark
names, and "git" remote will mean the local Git-tracking remote there. The
reserved remote name is checked prior to filtering because refs in that remote
cannot be represented as remote symbols.
I originally implemented the error handling the other way because we didn't
have a machinery to report partial import failure. Now we have stats, it's
easy to report skipped ref names.
I think this will help implement sorting options. Untracked remote bookmarks
should be sorted independently, whereas tracked remote bookmarks should always
be listed after the associated local bookmarks.
Some of these will be called from "jj bookmark list". The template RefName type
is useful as an abstract local/remote ref object. Maybe it should be renamed to
RefEntry or CommitRef.
I'm about to move the `create_commit()` helper to a common
place. However, this version of `create_commit()` is different from
the others in that it put a prefix of "descr_for_" in the
description. This patch removes that and instead updates the template
so it's still clear what's a description and what's a bookmark name.