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

[PATCH] rev-list: heed --abbrev-commit option

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Mar 22, 2010, 13:36 UTC
Message-ID
<b1b0f22cf3dc6d67f6094e761a1b7402b1471e97.1269264868.git.git@drmicha.warpmail.net>
In-Reply-To
<4BA76BDF.6060106@drmicha.warpmail.net>

Currently, rev-list has a default of "0" for abbrev which means that switching on abbreviations with --abbrev-commit has no visible effect, even though the option is documented.

Set abbrev to DEFAULT_ABBREV so that --abbrev-commit has the same effect as for log.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Reported-by: Eli Barzilay <eli@barzilay.org>
---
I'm actually wondering why log and rev-list don't share the relevant
part of that code.
 builtin/rev-list.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 5679170..eb8e2c2 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -313,7 +313,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
 
 	git_config(git_default_config, NULL);
 	init_revisions(&revs, prefix);
-	revs.abbrev = 0;
+	revs.abbrev = DEFAULT_ABBREV;
 	revs.commit_format = CMIT_FMT_UNSPECIFIED;
 	argc = setup_revisions(argc, argv, &revs, NULL);
 
-- 
1.7.0.3.435.g097f4
Previous: Michael J GruberNext: Junio C Hamano
Message 4 of 14 in “git rev-list formatting”
  1. Eli BarzilayMar 22, 2010
  2. Eli BarzilayMar 22, 2010
  3. Michael J GruberMar 22, 2010
  4. rev-list: heed --abbrev-commit optionMichael J Gruber, Mar 22, 2010
  5. Junio C HamanoMar 26, 2010
  6. Michael J GruberMar 27, 2010
  7. Eli BarzilayMar 22, 2010
  8. René ScharfeMar 22, 2010
  9. Eli BarzilayMar 23, 2010
  10. Michael J GruberMar 23, 2010
  11. Eli BarzilayMar 23, 2010
  12. Jeff KingMar 23, 2010
  13. Erik Faye-LundMar 23, 2010
  14. Eli BarzilayMar 23, 2010

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.