Subject: Re: default aliases (ci, di, st, co)

From: Paolo Bonzini <[email-masked]>
Date: Fri, 10 Jul 2009 01:08:27 +0200

On 07/09/2009 06:43 PM, Junio C Hamano wrote:
> Jakub Narebski<[email-masked]>  writes:
>
>>          one = show -s --pretty='format:%h (%s)'
>
> If you use "git one" for quoting a commit in the log message, please use a
> format that shows the date as well (I think I posted mine to the list in
> the past).

Yes, it's in the wiki and in my .gitconfig:

         whatis = "!sh -c 'git show -s --pretty=\"format:%h (%s, %ai\" 
\"$@\" | sed -e \"s/ [012][0-9]:[0-5][0-9]:[0-5][0-9] 
[-+][0-9][0-9][0-9][0-9]$/)\\n/\"' -"

BTW, the wiki shows a nice trick to avoid the extra ' quotation:

         whatis = "!f() { git show -s --pretty='format:%h (%s, %ai' 
\"$@\" | sed -e 's/ [012][0-9]:[0-5][0-9]:[0-5][0-9] 
[-+][0-9][0-9][0-9][0-9]$/)\\n/'; }; f"

Paolo