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

13 commits

Author SHA1 Message Date
Martin von Zweigbergk
d3286c2847 tests: use jj new instead of jj merge in tests
Because `jj new` updates to the new commit, this makes them a little
simpler.
2022-08-31 07:51:32 -07:00
Martin von Zweigbergk
b5378caa81 cli: make jj move/squash/unsquash ask for combined description
In 8ae9540f2c, I made `jj move/squash/unsquash` not abandon the
working copy if it became empty because that would lose any
description associated with it. It turned out that the new behavior
was also confusing because it made it unclear if the working-copy
commit was actually abandoned. Let's roll back that change and instead
ask the user for a combined description when both the source and
destination commits have non-empty descriptions. Not discarding a
non-empty description seems like a good improvement regardless of the
behavior related to working-copy commits. It's also how `hg fold`
behaves (though hg doesn't allow the description to be empty).
2022-08-30 21:41:26 -07:00
Martin von Zweigbergk
0d1bf7cb3b cli: disable open commits by default 2022-08-26 23:34:52 -07:00
Martin von Zweigbergk
3e79eacaf7 cli: snapshot working copy even on e.g. jj diff -r <some hash>
I was initially worried about the cost of always snapshotting the
working copy, so that's why e.g. `jj diff -r <some hash>` doesn't do
it. However, there's been a few caused by missing snapshotting, and
there are still a few (I just noticed it in `jj undo` while writing
this patch). Let's always do the snapshotting and if the user really
doesn't want it, they can pass `--no-commit-working-copy` (which we
should probably rename to `--no-snapshot-working-copy` or maybe just
`--no-snapshot`). That should reduce bugs and make the CLI more
predictable.

Two test cases were affected becasue `jj merge` also didn't snapshot
the working copy.

Before this patch, e.g. `jj co --no-commit-working-copy` would error
out, but now it will succeed (without touching the working copy,
leaving the working copy stale). That may be confusing, but it should
be easy to recover from (e.g. by `jj undo`). We can consider adding a
check for it later if it seems too confusing (it's probably rarely
something the user wanted).
2022-07-29 22:06:53 +02:00
Waleed Khan
de1c8f0f37 cli: make jj branch take subcommands, not flags
As per https://github.com/martinvonz/jj/issues/330.
2022-06-06 09:02:56 -07:00
Martin von Zweigbergk
8ae9540f2c cli: make move/squash/unsquash keep empty working-copy commit
If the source commit becomes empty as a result of
`move/squash/unsquash`, we abandon it. However, perhaps we shouldn't
do that if the source commit is a working-copy commit because
working-copy commits are often work-in-progress commits.

The background for this change is that @arxanas had just started a new
change and had set a description on it, and then decided to make some
changes in the working copy that should be in the parent
commit. Running `jj squash` then abandoned the working-copy commit,
resuling in the description getting lost.
2022-05-30 07:52:24 -07:00
Martin von Zweigbergk
80f1a6f97d tests: extract a methods for log output in a few more tests 2022-05-30 07:52:24 -07:00
Martin von Zweigbergk
0865b1ccff cli: show placeholder text for empty commit message
It can be confusing that some commits (typically the working copy)
don't have a description. Let's show a placeholder text in such cases.

I chose the format to match the "(no email configured)" message we
already have.
2022-05-18 09:16:04 -07:00
Martin von Zweigbergk
8ef00a3498 tests: re-run with insta crate version b9d99e87065b 2022-04-28 16:55:10 -07:00
Martin von Zweigbergk
4be0da3607 cli: teach jj squash to move only changes to specified paths 2022-04-09 16:13:01 -07:00
Martin von Zweigbergk
bc3c2db828 cli: print errors to stderr 2022-04-09 16:13:01 -07:00
Martin von Zweigbergk
a4449cd7bc tests: add tests for jj squash -i 2022-04-06 23:31:28 -07:00
Martin von Zweigbergk
3aa153fb59 tests: add tests for jj squash 2022-04-06 23:31:28 -07:00