Skip to content

Client side op heads functions - #43

Open
sidracha wants to merge 1 commit into
srachaba-5-reconcile-enginefrom
srachaba-6-get-op-heads
Open

sidracha wants to merge 1 commit into
srachaba-5-reconcile-enginefrom
srachaba-6-get-op-heads

Conversation

@sidracha

@sidracha sidracha commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

lib: add functions for getting op heads

Add get_op_heads_with_reconciliation and get_op_heads_without_reconciliation functions. The latter function (without) does not perform a reconciliation operation and just does a Store read to return the heads that are present. The former function just makes an RPC call to the ReconcileOpHeads RPC, which performs reconciliation and returns the resulting resolved head. The vast majority of get_op_heads calls will be made with reconciliation, as jj commands expect a singular op head per repository.

})
}

pub async fn get_op_heads_without_reconciliation(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Currently unused, right? Or did I miss something?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct, currently unused but useful in the future (for read only checking for errors, visibility into repo state without modification, etc)

Added a comment clarifying that it is unused

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

At Google we have a get_op_heads_without_reconciliation in our internal OpHeadsStore implementation that we use for a few commands that should modify repo state, for example for filing bug reports.

This LGTM.

@sidracha
sidracha force-pushed the srachaba-6-get-op-heads branch from 4e3277e to 22e1a37 Compare September 8, 2026 18:47
})
}

pub async fn get_op_heads_without_reconciliation(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

At Google we have a get_op_heads_without_reconciliation in our internal OpHeadsStore implementation that we use for a few commands that should modify repo state, for example for filing bug reports.

This LGTM.

@sidracha
sidracha force-pushed the srachaba-6-get-op-heads branch from 22e1a37 to 26d5ce2 Compare September 14, 2026 20:50
Add get_op_heads_with_reconciliation and get_op_heads_without_reconciliation functions. The latter function (without) does not perform a reconciliation operation and just does a Store read to return the heads that are present. The former function just makes an RPC call to the ReconcileOpHeads RPC, which performs reconciliation and returns the resulting resolved head. The vast majority of get_op_heads calls will be made with reconciliation, as jj commands expect a singular op head per repository.
@sidracha
sidracha force-pushed the srachaba-6-get-op-heads branch from 26d5ce2 to d556734 Compare September 14, 2026 20:59
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.

3 participants