This changes the search logic for describing a submodule from:
- local branch
- tag
- tag on a later commit
- commit id
to
- local branch
- tag
- tag on a subsequent commit
- remote branch
- commit id
The change is describing with respect to a remote 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 cannot be described relative to a local branch but
can always be described relative to the remote branch.
This requires two describe steps in place of one: the first with
"--contains" (and no "--tags" as that is implied by "--contains"), and
a new final step having "--all --always". The split is needed as
"--contains" is incompatible with "--all".
Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
---
git-submodule.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 28509ea..af195a7 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -389,7 +389,8 @@ set_name_rev () {
cd "$1" && {
git describe "$2" 2>/dev/null ||
git describe --tags "$2" 2>/dev/null ||
- git describe --contains --tags --always "$2"
+ git describe --contains "$2" 2>/dev/null ||
+ git describe --all --always "$2"
}
) )
test -z "$revname" || revname=" ($revname)"
--
1.5.5.65.gf482
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html