#10116·jj

FR: `jj gerrit download`

Author: josephlou5Created Sep 3, 2026Updated Sep 17, 2026
Labelsenhancement🏗️

As part of Gerrit support, we should have a jj gerrit download command that "patches" or "downloads" a change from Gerrit. (This is being split out as a separate issue to keep the parent #4387 clean.)

Implementing this would be a better QOL improvement than simply supporting fetching arbitrary refs from a remote (#4388), though it is also related.

From @ramenhost and @matts1 in #4387, paraphrased:

  • jj gerrit fetch <change>[/<patchset>] — Brings the changeset ref (refs/changes/NN/CCCC/PP) into the repo and associates it with a jj change ID, but does not move @.
  • jj gerrit checkout/new/edit <change>[/<patchset>] — fetch + jj edit on the result.
  • jj gerrit duplicate <change>[/<patchset>] — fetch + jj duplicate on the result.
    • Probably jj gerrit download --detach instead (not a duplicate).

Notably, this seems to require some support for a "Gerrit changeset syntax", which can be a change with an optional /patchset. Ideally we would match whatever syntax Gerrit users are most familiar with (or whatever is currently used while downloading a change).

Other notes

I like the name jj gerrit fetch better (mirrors jj git fetch), but Gerrit uses the term "download", and @matts1 also points out that "download" mirrors jj gerrit upload. "Patch" is perhaps also another option. It could be an alias I guess, but IMO it's better to have a single canonical name, and then users can make their own alias (either as a top-level command or after #6611).