Re: [PATCH] allow user aliases for the --author parameter
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:12
Jeff King [off-list ref] writes:
quoted
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]$/)/\"' -"