Git development
 help / color / mirror / Atom feed
From: Petr Baudis <pasky@suse.cz>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] diff: --abbrev option
Date: Sun, 18 Dec 2005 01:17:56 +0100	[thread overview]
Message-ID: <20051218001756.GS22159@pasky.or.cz> (raw)
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...
> 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.

  reply	other threads:[~2005-12-18  0:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-17  9:41 [PATCH] diff: --abbrev option Junio C Hamano
2005-12-18  0:17 ` Petr Baudis [this message]
2005-12-18  2:57   ` Junio C Hamano
2005-12-18 11:45     ` Petr Baudis
2005-12-18 18:35       ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051218001756.GS22159@pasky.or.cz \
    --to=pasky@suse.cz \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox