jj/cli
Jonathan Hoelzel 69477cd465 gerrit: handle mixed explicit & implicit Change-Ids in upload
The 'gerrit upload' cli command is meant to support uploading commits
that have an explicit "Change-Id: ..." footer, and those that don't. In
the latter case, a temporary copy of the commit being uploaded will be
created, with the Change-Id set based on the jj change id.

Prior to this commit, there was a bug in this implementation when a
chain of commits contained some with Change-Id footers and some without.

Say we have commits a->b->c, where b has no Change-Id footer but c does
(this case is what's now tested in the test_gerrit_upload_local case).

The old logic would:
- create a new version of b (let's call it b*), with a CommitId footer,
  and populate the 'old_to_new' map with 'b -> b*'
- not create a new version of c, and populate the 'old_to_new' map with
  'c -> c'
- push the 'new' version of c, which is c itself. However, c has b as a
  parent, not b*, so this fails to send to gerrit because b has no
  Commit-Id footer!

After this commit, we create a new temporary commit if either the
description is changed (as before), or if any parents are different from
the original commit's parents. This does not change the behavior for
either the all-explicit or all-implicit ChangeId cases, but fixes the
behavior in this mixed case.
2025-12-17 00:30:17 +00:00
..
examples clippy: enable unnecessary_literal_bound lint 2025-12-05 17:07:44 +00:00
src gerrit: handle mixed explicit & implicit Change-Ids in upload 2025-12-17 00:30:17 +00:00
testing tests: exercise util exec when the program crashes 2025-12-12 02:55:55 +00:00
tests gerrit: handle mixed explicit & implicit Change-Ids in upload 2025-12-17 00:30:17 +00:00
build.rs colocation: rename from "colocated repo" to "colocated workspace" 2025-11-03 16:53:26 +00:00
Cargo.toml ui: switch to std::io::pipe() 2025-09-19 09:41:32 +00:00
docs build: fix cargo publish by symlinking cli/docs->docs 2024-11-05 17:37:14 -08:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00