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

18 commits

Author SHA1 Message Date
Yuya Nishihara
40d18bb2c9 cli: remove weird line break from the "jj branch forget" hint
The message seems a bit too long, but it doesn't make sense to insert \n
in the middle of sentence.
2023-12-16 07:50:15 +09:00
Yuya Nishihara
aca2a3cf93 tests: don't create new branch by "jj branch set" 2023-11-11 07:03:31 +09:00
Ilya Grigoriev
5e407982b1 cli templates: include hidden (AKA abandoned) status in short commit template
This is mainly relevant for `jj abandon` and `jj branch list`. #2411
2023-10-24 12:37:26 -07:00
Yuya Nishihara
560b63544a cli: parse "git fetch --branch" parameter as string pattern
Even though "*" can't be used as a branch name to fetch, it should be better
to explicitly enable glob matching like the other commands.
2023-10-25 03:58:48 +09:00
Yuya Nishihara
12b879dc8f cli: add "branch list --all" option to include all remote branches
This will be the option to include non-tracking remote branches. We could add
more fine-grained filtering flags, but I think --all is good enough and easier
to remember.

This patch also updates many of the test outputs to include synchronized remote
branches. I think verbose outputs will help catch future bugs.
2023-10-19 05:23:38 +09:00
Yuya Nishihara
f74d793817 cli: list non-tracking remote branch as standalone entry
I'm not sure if this is the best way to render non-tracking branches, but
it helps to write CLI tests. Maybe we can add some hint or decoration to
non-tracking branches, but I'd like to avoid bikeshedding at this point.

Since we haven't migrated the push function yet, a deleted branch can be
pushed to non-tracking remotes. This will be addressed later.

#1136
2023-10-16 23:21:05 +09:00
Yuya Nishihara
7a3e72415c cli: send status messages to stderr, specify stdout/stderr explicitly
Many of &mut UI can be changed to immutable borrows, but I'm not gonna
update them in this patch.
2023-10-11 19:24:01 +09:00
Yuya Nishihara
58acc1d111 tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
Yuya Nishihara
902a43a341 cli: don't list commits abandoned by import/fetch, just print the number
Apparently, it gets too verbose if the remote history is actively rewritten.
Let's summarize the output for now. The plan is to show the list of moved refs
instead of the full list of abandoned commits.
2023-10-03 14:07:56 +09:00
Yuya Nishihara
0fe25575ba cli: ensure first new HEAD is detached
The problem is that the first non-working-copy commit moves the unborn current
branch to that commit, but jj doesn't "export" the moved branch. Therefore,
the next jj invocation notices the "external" ref change, which was actually
made by jj.

I'm not sure why we play nice by setting the "current" HEAD, but I *think* it's
okay to set the "new" HEAD and reset to the same commit to clear Git index.
2023-10-03 00:58:22 +09:00
Yuya Nishihara
480efc1503 cli: add context to checkout/abandon messages triggered by automated git import
Otherwise, it's unclear why "jj status" abandoned commits for example.
2023-10-02 17:31:05 +09:00
Yuya Nishihara
8579bc479f cli: print commits abandoned by git::import_refs() or fetch()
This will probably help to understand why you've got conflicts after fetching.
Maybe we can also report changed local refs.

I think the stats should be redirected to stderr, but we have many other similar
messages printed to stdout. I'll probably fix them all at once later.
2023-10-02 17:31:05 +09:00
Martin von Zweigbergk
a6ef3f0b6c cli: make set of immutable commits configurable
This adds a new `revset-aliases.immutable_heads()s` config for
defining the set of immutable commits. The set is defined as the
configured revset, as well as its ancestors, and the root commit
commit (even if the configured set is empty).

This patch also adds enforcement of the config where we already had
checks preventing rewrite of the root commit. The working-copy commit
is implicitly assumed to be writable in most cases. Specifically, we
won't prevent amending the working copy even if the user includes it
in the config but we do prevent `jj edit @` in that case. That seems
good enough to me. Maybe we should emit a warning when the working
copy is in the set of immutable commits.

Maybe we should add support for something more like [Mercurial's
phases](https://wiki.mercurial-scm.org/Phases), which is propagated on
push and pull. There's already some affordance for that in the view
object's `public_heads` field. However, this is simpler, especially
since we can't propagate the phase to Git remotes, and seems like a
good start. Also, it lets you say that commits authored by other users
are immutable, for example.

For now, the functionality is in the CLI library. I'm not sure if we
want to move it into the library crate. I'm leaning towards letting
library users do whatever they want without being restricted by
immutable commits. I do think we should move the functionality into a
future `ui-lib` or `ui-util` crate. That crate would have most of the
functionality in the current `cli_util` module (but in a
non-CLI-specific form).
2023-09-25 15:41:45 -07:00
Yuya Nishihara
e3c85d6ecc revset: convert root symbol to function
The idea is that we can fully eliminate special symbols that would otherwise
shadow user branches, tags, or change ID prefixes.

Closes #2095
2023-09-04 10:36:30 +09:00
Yuya Nishihara
ce3d28e234 git: do not import refs from remote named "git"
I made it simply fail on explicit fetch/import, and ignored on implicit import.
Since the error mode is predictable and less likely to occur. I don't think it
makes sense to implement warning propagation just for this.

Closes #1690.
2023-08-29 22:50:46 +09:00
Vladimir Petrzhikovskii
386f002f5a git: add --all-remotes to git fetch 2023-08-24 12:52:41 +02:00
Ilya Grigoriev
872a0932cd cli tests: Move current_operation_id to test_utils 2023-08-22 17:39:56 -07:00
Martin von Zweigbergk
0075174308 tests: move tests/ under cli/ so they're run again
Thanks to @ilyagr for noticing that they should be moved.
2023-08-05 06:18:59 +00:00
Renamed from tests/test_git_fetch.rs (Browse further)