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

[PATCH v2 6/6] describe --contains: use "name-rev --weight"

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2012, 03:50 UTC
Message-ID
<1346298629-13730-7-git-send-email-gitster@pobox.com>
In-Reply-To
<1346298629-13730-1-git-send-email-gitster@pobox.com>

And this is the logical conclusion of the series, to allow 0136db586c in the kernel history to be described as v3.5-rc1~83^2~81^2~76, not as v3.6-rc1~59^2~56^2~76.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/describe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/describe.c b/builtin/describe.c
index 9f63067..fbd5be5 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -436,11 +436,12 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 		die(_("--long is incompatible with --abbrev=0"));
 
 	if (contains) {
-		const char **args = xmalloc((7 + argc) * sizeof(char *));
+		const char **args = xmalloc((8 + argc) * sizeof(char *));
 		int i = 0;
 		args[i++] = "name-rev";
 		args[i++] = "--name-only";
 		args[i++] = "--no-undefined";
+		args[i++] = "--weight";
 		if (always)
 			args[i++] = "--always";
 		if (!all) {
-- 
1.7.12.286.g9df01f7
Previous: Junio C Hamano
Message 8 of 8 in “describe --contains / name-rev --weight”
  1. 0/6 describe --contains / name-rev --weightJunio C Hamano, Aug 30, 2012
  2. 1/6 name-rev: lose unnecessary typedefJunio C Hamano, Aug 30, 2012
  3. 2/6 name_rev: clarify the logic to assign a new tip-name to a commitJunio C Hamano, Aug 30, 2012
  4. 3/6 name-rev: --weight optionJunio C Hamano, Aug 30, 2012
  5. 5/6 name-rev --weight: trivial optimizationJunio C Hamano, Sep 4, 2012
  6. 4/6 name-rev --weight: cache the computed weight in notesJunio C Hamano, Aug 30, 2012
  7. 5/6 name-rev --weight: tests and documentationJunio C Hamano, Aug 30, 2012
  8. 6/6 describe --contains: use "name-rev --weight"Junio C Hamano, Aug 30, 2012

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.