-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add jj sign
command
#3142
base: main
Are you sure you want to change the base?
Add jj sign
command
#3142
Conversation
Currently the TestSigningBackend can only be used from the test gradle. This makes it hard to build command tests for signing commands as they are tested against the CLI interface directly. This commit renames the TestSigningBackend struct to MockSigningBackend and moves it to the lib module, allowing us to configure it via config and therefore use it from command tests.
Cannot make it accept multiple revisions easily, that'd have to be done with a rebaser
pub fn cmd_sign(ui: &mut Ui, command: &CommandHelper, args: &SignArgs) -> Result<(), CommandError> { | ||
let mut workspace_command = command.workspace_helper(ui)?; | ||
|
||
let commit = workspace_command.resolve_single_rev(&args.revision)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice to accept multiple revs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Descendants of rewritten commits (and signing is rewriting) get rebased, so if one of the revisions is a descendant of another there are issues you'd need to figure out how to avoid.
Another thing is a rebase optimisation that's needed for instances where you wan't to sign a range of commits - currently (if you do it in a loop in a shell, I guess) if you sign 10 commits you'd have 45 (ish? should be a triangle, n(n-1)/2) useless commits created from all the rebases.
So initially we decided to at least have a single-revision sign.
Also technically any rewriting command with --sign
global flag is a sign.
Hm, hah, a noop rebase with --sign should be the rebase optimisation I was talking about above, interesting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope to make it easier to do such transformations while rebasing. It's just been hard to find time for it. The idea is that we'll something similar to rebase_descendants()
but instead transform_descendants(callback)
where the callback gets a CommitBuilder
populated with the default values (so rebase_descendants
will be transform_descendants(|_|) {}
).
Had there been any progress on this issue? |
@walking-octopus No not this specifically. I have had a patch of very busy weeks and haven't had a chance to work on this stuff. The sig verification PR has had the most recent work done: #3141 Are you specifically wanting this |
Oh, I now see. Sorry for wasting time... Still, it would certainly be nice to display the signing information within jj as well as have a dedicated command for those who may prefer it. Once again, thank you so much for working on this! I've just tried jj, and it already looks so much more intuitive, flexible, and infinity less migraine inducing. I just wish the Git interop gets better in places. |
Feel free to file bug reports or feature requests when you notice anything. |
These changes were taken from jj-vcs#3142.
These changes were taken from jj-vcs#3142.
These changes were taken from jj-vcs#3142.
Changes were taken from jj-vcs#3142 and slightly modified.
These changes were taken from jj-vcs#3142.
Changes were taken from jj-vcs#3142 and slightly modified.
This is a continuation from #3007 and #2728 which adds in the
jj sign
command that was split out of the original PR.Some outstanding comments I am carrying over from #3007:
Checklist
CHANGELOG.md