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

[PATCH 3/3] examples/commit: use --abbrev for commit summary

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 27, 2010, 18:44 UTC
Message-ID
<20100727184450.GE5578@burratino>
In-Reply-To
<20100727182942.GB5578@burratino>

After v1.7.1.1~17^2~3 (pretty: Respect --abbrev option, 2010-05-03), plumbing users do not abbreviate %h hashes by default any more.

Noticed while investigating the bug fixed by v1.7.1.1~17^2 (commit::print_summary(): don't use format_commit_message(), 2010-06-12).

Cc: Will Palmer <wmpalmer@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Again, sorry for the trouble.

Maybe diff-tree should always abbreviate the format %h. That would make the Parents: line and %p format produce different result when the --abbrev option is not supplied.

I could go either way.
 contrib/examples/git-commit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh
index 5c72f65..23ffb02 100755
--- a/contrib/examples/git-commit.sh
+++ b/contrib/examples/git-commit.sh
@@ -631,7 +631,7 @@ then
 	if test -z "$quiet"
 	then
 		commit=`git diff-tree --always --shortstat --pretty="format:%h: %s"\
-		       --summary --root HEAD --`
+		       --abbrev --summary --root HEAD --`
 		echo "Created${initial_commit:+ initial} commit $commit"
 	fi
 fi
-- 
1.7.2.21.g04ff
Previous: Junio C Hamano
Message 15 of 15 in “Possible bug with `export-subst' attribute”
  1. Eli BarzilayJul 25, 2010
  2. Ilari LiusvaaraJul 25, 2010
  3. Jonathan NiederJul 25, 2010
  4. Eli BarzilayJul 25, 2010
  5. Junio C HamanoJul 26, 2010
  6. Jonathan NiederJul 26, 2010
  7. Junio C HamanoJul 27, 2010
  8. 0/3 archive: abbreviate substituted commit ids againJonathan Nieder, Jul 27, 2010
  9. 1/3 archive: abbreviate substituted commit ids againJonathan Nieder, Jul 27, 2010
  10. 2/3 checkout, commit: remove confusing assignments to rev.abbrevJonathan Nieder, Jul 27, 2010
  11. Will PalmerJul 27, 2010
  12. Jonathan NiederJul 27, 2010
  13. Will PalmerJul 28, 2010
  14. Junio C HamanoJul 28, 2010
  15. 3/3 examples/commit: use --abbrev for commit summaryJonathan Nieder, Jul 27, 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.