git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-submodule: Instead of using only annotated tags, use any tag found in .git/refs/tags

From
EMEmil Medve <emilian.medve@freescale.com>
Date
Jun 26, 2007, 23:40 UTC
Message-ID
<11829012583562-git-send-email-Emilian.Medve@Freescale.com>

Some repositories might not use/have annotated tags (for example repositories created with git-cvsimport) and git-submodule status might fail because git-describe might fail to find a tag. This change allows the status of a submodule to be described/displayed relative to lightweight tags as well.

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
---
 git-submodule.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index 89a3885..56ea935 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -155,7 +155,7 @@ modules_list()
 			say "-$sha1 $path"
 			continue;
 		fi
-		revname=$(unset GIT_DIR && cd "$path" && git-describe $sha1)
+		revname=$(unset GIT_DIR && cd "$path" && git-describe --tags $sha1)
 		if git diff-files --quiet -- "$path"
 		then
 			say " $sha1 $path ($revname)"
@@ -163,7 +163,7 @@ modules_list()
 			if test -z "$cached"
 			then
 				sha1=$(unset GIT_DIR && cd "$path" && git-rev-parse --verify HEAD)
-				revname=$(unset GIT_DIR && cd "$path" && git-describe $sha1)
+				revname=$(unset GIT_DIR && cd "$path" && git-describe --tags $sha1)
 			fi
 			say "+$sha1 $path ($revname)"
 		fi
-- 
1.5.2.2.549.gaeb59
Next: Junio C Hamano
Message 1 of 4 in “git-submodule: Instead of using only annotated tags, use any tag found in .git/refs/tags”
  1. git-submodule: Instead of using only annotated tags, use any tag found in .git/refs/tagsEmil Medve, Jun 26, 2007
  2. Junio C HamanoJun 27, 2007
  3. Medve Emilian-EMMEDVE1Jun 27, 2007
  4. Shawn O. PearceJun 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.