Skip to content

Conversation

ethomson
Copy link
Member

git shows the remote and local ref information during a fetch. For example:

 * [new branch]          ethomson/nonblocking   -> origin/ethomson/nonblocking

This is not information that users of libgit2 can currently surface since our update_tips callback includes only src/dest OIDs, and the local ref name. Nor can one reliably reverse engineer the remote branch name, since a remote configuration could map two remote specs to a local spec. For example:

        fetch = +refs/pull/*/head:refs/remotes/asdf/*
        fetch = +refs/heads/*:refs/remotes/asdf/*

In this case, given refs/remotes/asdf/foo in the update_tips, a caller would have no idea whether the remote was refs/pull/foo/head or refs/heads/foo.

Provide the matching remote git_refspec so that callers can rtransform themselves into the remote.

@ethomson ethomson force-pushed the ethomson/update_tips_spec branch 3 times, most recently from 38e3fd5 to 0e7ab1c Compare May 11, 2023 12:30
@ethomson ethomson force-pushed the ethomson/update_tips_spec branch from 0e7ab1c to 9f53a5c Compare October 18, 2024 12:30
@ethomson ethomson changed the title remote: add git_refspec to update_tips remote: add update_refs with git_refspec Oct 18, 2024
@ethomson ethomson force-pushed the ethomson/update_tips_spec branch from 9f53a5c to fd28687 Compare October 19, 2024 22:18
Add an `update_refs` callback that includes the refspec; `update_tips`
is retained for backward compatibility.
@ethomson ethomson force-pushed the ethomson/update_tips_spec branch from fd28687 to c1b2b25 Compare October 19, 2024 22:42
@ethomson ethomson merged commit 1692d30 into main Oct 19, 2024
18 of 19 checks passed
@ethomson ethomson deleted the ethomson/update_tips_spec branch October 19, 2024 23:44
@fxcoudert
Copy link
Contributor

This ABI-breaking change is not listed in the 1.9.0 release notes. Could it be added?

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

Successfully merging this pull request may close these issues.

2 participants