Skip to content

WIP: gerrit: Use base to upload exact revisions#9384

Draft
freundTech wants to merge 3 commits intojj-vcs:mainfrom
freundTech:push-qxpyuntolnvq
Draft

WIP: gerrit: Use base to upload exact revisions#9384
freundTech wants to merge 3 commits intojj-vcs:mainfrom
freundTech:push-qxpyuntolnvq

Conversation

@freundTech
Copy link
Copy Markdown
Contributor

@freundTech freundTech commented Apr 26, 2026

Closes #9364.

Work in progress.

This adds the changes proposed in #9364. Because they are breaking changes they are hidden behind a config option for now. The default value of this config option could then be flipped after a deprecation period.

This still needs a bit more testing and probably a few edge case fixes. Opening as draft PR to enable design discussions. Not yet for code review (I know there's a bunch of stuff to fix).

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    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.

@freundTech freundTech force-pushed the push-qxpyuntolnvq branch 2 times, most recently from cbb8246 to f7430b4 Compare April 26, 2026 14:22
@PhilipMetzger
Copy link
Copy Markdown
Contributor

please expand on the commit motivations and move the fixes line into the one which "completes" the work.

Copy link
Copy Markdown
Contributor

@PhilipMetzger PhilipMetzger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor pass.

Comment thread cli/src/config/misc.toml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is missing a config.md entry explaining what it does.

Comment on lines -472 to -476
// If you have the changes main -> A -> B, and then run `jj gerrit upload -r B`,
// then that uploads both A and B. Thus, we need to ensure that A also
// has a Change-ID.
// We make an assumption here that all immutable commits already have a
// Change-ID.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: its probably useful to preserve that comment

Comment on lines +423 to +424
while let Some(current_commit) = queue.pop_front() {
let parents = index.parents(&current_commit)?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this results in N index lookups/calls which can be expensive, so offering a stream-based implementation would definitely better for Google and ERSC. cc @martinvonz for an opinion.

Comment thread lib/src/index.rs
fn heads(&self, candidates: &mut dyn Iterator<Item = &CommitId>) -> IndexResult<Vec<CommitId>>;

/// Returns the parents of commit ID `commit_id`
fn parents(&self, commit_id: &CommitId) -> IndexResult<Vec<CommitId>>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This is related to my other comment, but maybe a variant which takes an iterator of CommitIds is better here for alternate backends which aren't Git and then also returns a stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gerrit: Utilize base option in gerrit upload

2 participants