cli: warn when sign-on-push skips immutable commits - #9963
Conversation
| writeln!( | ||
| ui.warning_default(), | ||
| "Skipped signing {num_immutable} immutable commits." | ||
| )?; |
There was a problem hiding this comment.
Ideally I feel like the skipped commits should also be printed, if possible.
3358f35 to
e9d574c
Compare
| future::ready(!commit.is_signed() && sign_settings.should_sign(commit.store_commit())) | ||
| }) | ||
| .try_filter(needs_signing) | ||
| .try_collect() |
There was a problem hiding this comment.
Can you restrict the number of commits to collect? There may be tons of unsigned immutable commits.
It seems also better to convert needs_signing to a revset expression, but that's a separate issue.
There was a problem hiding this comment.
Can you restrict the number of commits to collect? There may be tons of unsigned immutable commits.
Done, I restricted to 11 to match the limit of print_updated_commits (it shows up to 10 commits then print ... ), and the warning message itself will print Skipped signing 10+ immutable commits.
It seems also better to convert needs_signing to a revset expression, but that's a separate issue.
I agree, I can do that in another commit in this PR (or a separate PR) if you want
Commits that need a signature but are immutable cannot be rewritten to add one, so they were silently pushed unsigned. This is easy to hit when, for example, tagging unpushed commits. `jj git push` now warns if any commit that should have been signed was skipped because it is immutable.
e9d574c to
69154d5
Compare

Small QoL improvement to warn when a commit that should have been signed is skipped during
jj git push(when usingsign-on-push). This can easily happen when tagging a commit while it is unsigned, then pushing it (since the tag makes the commit immutable).Checklist
If applicable:
CHANGELOG.mdREADME.md,docs/,demos/)cli/src/config-schema.json)how it works, how it's organized), including any code drafted by an LLM.
an eye towards deleting anything that is irrelevant, clarifying anything
that is confusing, and adding details that are relevant. This includes,
for example, commit descriptions, PR descriptions, and code comments.