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

Re: "git describe" documentation and behavior mismatch

From
Daniel Knittl-Frank <knittl89@googlemail.com>
Date
Dec 11, 2017, 18:37 UTC
Message-ID
<CACx-yZ3FxqFvXgM-V0stODcyAdCoO83s=WwyZ2OLiJON6qqvkA@mail.gmail.com>
In-Reply-To
<CACx-yZ1DGz2z6qqAX=pzeExT689y0sON+wVDaocdWk75a5SOxA@mail.gmail.com>
Forget the above patch. I should compile my code after refactoring ...
Here is the fixed version.
-- >8 --
From 8203bd0ad5baab7024ebff597c9f35a0250d09ff Mon Sep 17 00:00:00 2001
From: Daniel Knittl-Frank <knittl89+git@googlemail.com>
Date: Mon, 11 Dec 2017 19:24:54 +0100
Subject: [PATCH] Prepend "tags/" when describing tags with embedded name
Signed-off-by: Daniel Knittl-Frank <knittl89+git@googlemail.com>
---
 builtin/describe.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/builtin/describe.c b/builtin/describe.c
index e14e162ef6..9da6d85ea3 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -271,10 +271,13 @@ static void display_name(struct commit_name *n)
         n->name_checked = 1;
     }

-    if (n->tag)
+    if (n->tag) {
+        if (all)
+            printf("tags/");
         printf("%s", n->tag->tag);
-    else
+    } else {
         printf("%s", n->path);
+    }
 }

 static void show_suffix(int depth, const struct object_id *oid)
-- 
2.15.GIT

-- 
typed with http://neo-layout.org
Previous: Daniel Knittl-FrankNext: Junio C Hamano
Message 5 of 6 in “"git describe" documentation and behavior mismatch”
  1. Daniel Knittl-FrankNov 30, 2017
  2. Daniel Knittl-FrankNov 30, 2017
  3. Junio C HamanoDec 3, 2017
  4. Daniel Knittl-FrankDec 11, 2017
  5. Daniel Knittl-FrankDec 11, 2017
  6. Junio C HamanoDec 15, 2017

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.