Re: [PATCH] allow user aliases for the --author parameter
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 22, 2008, 21:09 UTC
- Message-ID
- <7vzln492pc.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080822165047.GA3339@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
>> For git commit --author abbreviations at least I would typically need >> only very few entries (be it per repo or globally), which means they can >> be much shorter (than my mua aliases) in order to be unique, and I don't >> really want an extra file for that. > > I think this depends on your situation. In your case, it sounds like you > want to configure a few names that frequently have --author fields for > your specific workflow. For me, even though only 1% of the people in my > mua's alias file might send me patches, 99% of the people I would want > to use --author on are in my mua's alias file. > > So while there are may only be a few needed entries, they are already > there for me. Of course, I don't really use --author much, since most > people I talk to are already git users. ;) So I am extrapolating a bit.
Another potential source of this information is the existing commits. If you are communicating with the same set of people already, you already have the information in your repository. I suspect Michael's "selected few co-workers that would comfortably fit in a small list of config entries without need for any external text file" use case would be better served by an approach to look into existing commits.
I often use "git who Jeff" alias to fill the recipient of my e-mails with this alias:
[alias]
who = "!sh -c 'git log -1 --pretty=\"format:%an <%ae>\" --author=\"$1\"' -"
one = "!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]$/)/\"' -"