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

Re: [PATCH 2/3] checkout, commit: remove confusing assignments to rev.abbrev

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 27, 2010, 21:09 UTC
Message-ID
<20100727210908.GA11317@burratino>
In-Reply-To
<1280261936.4462.6.camel@walleee>
Will Palmer wrote:
> the purpose of the patch was to respect --abbrev instead of always
> abbreviating to a minimum of 7 characters. /Not/ to respect abbrev
> "instead of always abbreviating".
Sure, though it had that added effect.
One goal of that series was to be able to write formats like this:
	%C(commit)commit %H%Creset
	%M(Merge: %p
	)Author: %an <%ae>
	Date:   %ad
	%w(0,4,4)%B

to replicate the effect of --format=medium. With diff-tree (and rev-list before v1.7.0.6~1^2) that is not possible if %p abbreviates by default.

Of course, v1.7.0.6~1^2 illustrates that no one seems to have been relying on the format of Merge: lines, anyway, so I am not saying that to make diff-tree --format=medium abbreviate by default would be a bad change.

> Perhaps armed with that phrasing, a
> more general solution, such as equating "0" with "DEFAULT_ABBREV" rather
> than "no abbrev", could be applied?

Maybe. If so, one would have to deal with the other callers that explicitly set abbrev to 0.

 probably just confusing no-ops:
 - bisect.c::bisect_rev_setup
 - bisect.c::show_diff_tree (to imitate diff-tree: probably a no-op
   because there is no setup_revisions call)
 means FULL_SHA1:
 - diff-files.c::cmd_diff_files
 - diff-index.c::cmd_diff_index
 - diff-tree.c:cmd_diff_tree
 - revision.c::handle_revision_opt

Hope that helps, Jonathan

Previous: Will PalmerNext: Will Palmer
Message 12 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.