@matheusbsbs / matheus-bagliano / commits / f669ac0be9
Fork 0

git-submodule - possibly use branch name to describe a module

This changes the search logic for describing a submodule from: - annotated tag - any tag - tag on a subsequent commit - commit id to - annotated tag - any tag - tag on a subsequent commit - local or remote branch - commit id The change is describing with respect to a branch before falling back to the commit id. By itself, git-submodule will maintain submodules as headless checkouts without ever making a local branch. In general, such heads can always be described relative to the remote branch regardless of existence of tags, and so provides a better fallback summary than just the commit id. This requires inserting an extra describe step as --contains is incompatible with --all, but the latter can be used with --always to fall back to a commit ID. Also, --contains implies --tags, so the latter is not needed. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mark Levedahl committed Apr 14, 2008 at 22:48 UTC f669ac0be901e19a8948c9b04af63d23ebae8003
1 file changed +2 -1
git-submodule.sh
+2 -1
@@ -327,7 +327,8 @@ set_name_rev () {
327 cd "$1" && {
328 git describe "$2" 2>/dev/null ||
329 git describe --tags "$2" 2>/dev/null ||
330 - git describe --contains --tags --always "$2"
330 + git describe --contains "$2" 2>/dev/null ||
331 + git describe --all --always "$2"
332 }
333 ) )
334 test -z "$revname" || revname=" ($revname)"