From: Petr Baudis Date: Sun, 18 Dec 2005 00:17:56 GMT Subject: Re: [PATCH] diff: --abbrev option 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 said that... > 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 > > --- > > * 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 > Date: Fri Dec 16 23:12:33 2005 -0800 > > Comment fixes. > > Signed-off-by: Junio C Hamano > > :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.