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

Re: [PATCH] diff: --abbrev option

From
Petr Baudis <pasky@suse.cz>
Date
Dec 18, 2005, 00:17 UTC
Message-ID
<20051218001756.GS22159@pasky.or.cz>
In-Reply-To
<7v3bks12n6.fsf@assigned-by-dhcp.cox.net>

Dear diary, on Sat, Dec 17, 2005 at 10:41:49AM CET, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 27 quoted lines
> When I show transcripts to explain how something works, I often
> find myself hand-editing the diff-raw output to shorten various
> object names in the output.
> 
> This adds --abbrev option to the diff family, which shortens
> diff-raw output and diff-tree commit id headers.
> 
> Signed-off-by: Junio C Hamano <junkio@cox.net>
> 
> ---
> 
>  * Earlier I announced that I have this toy in proposed updates
>    without actually showing the code, so here it is.  I have
>    added code to find unique abbreviation as well.  It is
>    primarily useful to quote things in e-mail, like this:
> 
>       $ git-rev-parse master | git-diff-tree --pretty -r --abbrev --stdin
>       diff-tree 01385e2... (from 6922471...)
>       Author: Junio C Hamano <junkio@cox.net>
>       Date:   Fri Dec 16 23:12:33 2005 -0800
> 
>           Comment fixes.
> 
>           Signed-off-by: Junio C Hamano <junkio@cox.net>
> 
>       :100755 100755 0266f46... b0e54ed... M	git-branch.sh
>       :100755 100755 f241d4b... 36308d2... M	git-checkout.sh
  I think the '...' is just distracting. It makes cut'n'paste more
difficult, and it's usually fairly obvious that this is start of a hash,
and that the hash might not be complete.
  I was actually thinking to by default trim all the hashes Cogito show
to 12 or 16 characters. Seven still seems dangerously low to me, though;
it would be nice if the number of characters to trim would be
configurable (unless I've missed that).
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 5 in “diff: --abbrev option”
  1. diff: --abbrev optionJunio C Hamano, Dec 17, 2005
  2. Petr BaudisDec 18, 2005
  3. Junio C HamanoDec 18, 2005
  4. Petr BaudisDec 18, 2005
  5. Junio C HamanoDec 18, 2005

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.