git-subrepo icon indicating copy to clipboard operation
git-subrepo copied to clipboard

Added support to specify '-b branch@commit'

Open spog opened this issue 2 months ago • 11 comments
trafficstars

Current implementation already allows for specifying explicit commits like '-b commit' to pin subrepo sources (i.e during subrepo clone/pull). In that case, it also sets the name of the branch in the subrepo merge commit message and inside .gitrepo file to that commit hash. This addition allows for specifying both branch and commit. During the subrepo fetch phase, the commit is checked against the specified branch. If the requested commit can be reached from the head of the requested branch, the subrepo is re-fetched to that commit. Afterwards command processing remains the same, except that given branch name is written to the subrepo clone/pull commit message and into the .gitrepo file. The commit part of the '-b branch@commit' request may be abbreviated to the reasonable extent.

spog avatar Sep 17 '25 15:09 spog