Commit graph

14 commits

Author SHA1 Message Date
Cole Helbling
d1d8048538 metaedit: replace --update-committer-timestamp with --force-rewrite
Some checks failed
binaries / Build binary artifacts (push) Has been cancelled
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
Just moments ago, I ran into a case where I wanted to change both the
author and committer of a change. I knew about the new `jj metaedit`
command, but until now that only gave me the ability to update the
author of my change, so the committer would remain the same. My only
other option was to reach for `jj desc ... --reset-author`, which has
a deprecation warning:

    Warning: `jj describe --reset-author` is deprecated; use `jj metaedit --update-author` instead

In spite of that warning, this had the desired effect: both the author
and committer were updated.

So I figured I'd help `metaedit` grow these flags so it can be a _true_
replacement for `jj desc --reset-author`.

---

The above all happened before I was kindly informed in Discord
(https://discord.com/channels/968932220549103686/1431315533164314674)
that `jj metaedit --update-committer-timestamp` should do what I was
hoping for, which I had initially disregarded and never tried because
the help text originally said:

    This updates the committer date to now, without modifying the committer.

However, after trying it out, I noticed it actually _did_ modify the
committer.

So, I set out to improve the situation by renaming the flag (so it's
not partially-wrong: it does update the committer timestamp, as well as
everything else about the committer) and improving the help text in the
various flags.

---

In no particular order, thanks to:

* obtuse, for informing me that the `--update-committer-timestamp`
flag does what I wanted in the first place
* gaetan, for pointing out that my way of thinking was not quite meshing
with how jj does things (every modification will update the committer)
* Martin, for the new flag name
2025-10-25 22:31:16 +00:00
David Higgs
902e9e4541 tests: exercise metaedit more with empty author/email 2025-10-24 01:13:04 +00:00
David Higgs
60d8cab25a tests: exercise metaedit --quiet 2025-10-24 01:13:04 +00:00
David Higgs
f2d27dd538 tests: exercise hidden metaedit -r option 2025-10-24 01:13:04 +00:00
David Higgs
8d06c6fcb3 tests: exercise metaedit revset matching no commits 2025-10-24 01:13:04 +00:00
Gaëtan Lehmann
39c73e403f metaedit: fix 'squash' in test name
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-10-09 07:29:04 +00:00
Gaëtan Lehmann
336d9f7997 metaedit: test multiple input revisions
We were previously only testing the edition on a single revision.
2025-10-09 07:29:04 +00:00
David Higgs
a9797552d7 metaedit: add --message option, fix: #7634 2025-10-07 00:54:16 +00:00
Angel Ezquerra
dc59c66c12 metaedit: do not edit the change if the --author-timestamp matches the current timestamp (fixes #7602)
Some checks are pending
binaries / Build binary artifacts (push) Waiting to run
website / prerelease-docs-build-deploy (ubuntu-24.04) (push) Waiting to run
Scorecards supply-chain security / Scorecards analysis (push) Waiting to run
2025-10-06 07:19:45 +00:00
Remo Senekowitsch
0a965918d1 cli metaedit: fix --update-author if author was unset
The commit builder prepared by `rewriter.reparent()` already updates the
author to the currently configured one in case the author was previously
unset. When the new author is compared to `commit_builder.author()`,
they compare as equal, making it look like the author didn't change.
If that was the only change that would've happened, the commit is not
rewritten at all, meaning the commit author stays unset. This is fixed
by comparing the new author to the actual author of the old commit.
2025-09-11 13:03:43 +00:00
Martin von Zweigbergk
24f7c761a5 metaedit: add option to update committer timestamp 2025-09-03 15:31:43 +00:00
Martin von Zweigbergk
dd7dc11fa9 metaedit: don't rewrite commits if nothing changed 2025-09-03 15:31:43 +00:00
Martin von Zweigbergk
be6457321d metaedit: remove redundant check for error code
The status code is already tested as part of the `CommandOutput`.

Also rename variable of type `CommandOutput` to more standard
`output`.
2025-09-03 15:31:43 +00:00
Martin von Zweigbergk
f82975614f cli: rename jj touch to jj metaedit
There were some concerns that `touch` only makes sense if you're
familiar with the Unix `touch` command. I think that's a fair
concern. I did not hear any objections to renaming the command. If
we're going to do it, we should do it now, so it doesn't ever get
released under the old name.
2025-09-03 15:31:43 +00:00
Renamed from cli/tests/test_touch_command.rs (Browse further)