On 08/20/2013 04:23 PM, Thomas Rast wrote:
> Stefan Beller <stefanbel...@googlemail.com> writes:
>> As I am resending the patch, could somebody please explain me
>> the mechanism of the "# repo-abbrev:" line? Even git itself doesn't
>> use it in the .mailmap file, but a quick google search shows up only
>> kernel repositories.
> I had no idea (we really lack documentation on this), but some history
> digging shows this:
>   commit 7595e2ee6ef9b35ebc8dc45543723e1d89765ce3
>   Author: Junio C Hamano <jun...@cox.net>
>   Date:   Sat Nov 25 00:07:54 2006 -0800
>       git-shortlog: make common repository prefix configurable with .mailmap
>       The code had "/pub/scm/linux/kernel/git/" hardcoded which was
>       too specific to the kernel project.
>       With this, a line in the .mailmap file:
>           # repo-abbrev: /pub/scm/linux/kernel/git/
>       can be used to cause the substring to be abbreviated to /.../
>       on the title line of the commit message.
>       Signed-off-by: Junio C Hamano <jun...@cox.net>
> It apparently serves to abbreviate commits coming from pull requests,
> with a subject like
>   Merge branch 'release' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux

Thanks for looking through the history, I need to adapt my search patterns. ;)

Personally I have the feel this is a very kernel specific, but also 
useful thing to have. So I would definitely not drop it, but maybe move
it to another place, such as in the .git/config file. 
Then anybody can configure it themselves and maybe even have multiple
abbreviation lines possible.
It's very likely nowadays that there are repos at various different
hosting sites, so just one abbreviation would not cut it anymore.

Or as Jeff just mentioned in his email, it's there for historical
purpose, but not needed anymore as git-merge produces nicer commit
messages there.

As proposed I checked recent kernel history and saw:

$ git log --min-parents=2 --oneline 
d6a5e06 Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes
7067552 Merge branch 'x86-urgent-for-linus' of 
e91dade Merge branch 'timers-urgent-for-linus' of 
fbf2184 Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
3387ed8 Merge tag 'drm-intel-fixes-2013-08-15' of 
d2b2c08 Merge branch 'drm-fixes-3.11' of 
50e37cc Merge branch 'for-3.11-fixes' of 
a08797e Merge tag 'ext4_for_linus' of 
2620bf0 Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
359d16c Merge branch 'for-3.11' of 
0f7dd1a Merge tag 'clk-fixes-for-linus' of 
2d2843e Merge tag 'pm-3.11-rc6' of 
f43c606 Merge tag 'sound-3.11' of 
89cb9ae Merge tag 'usb-3.11-rc6' of 

in their .mailmap it read:
        # repo-abbrev: /pub/scm/linux/kernel/git/

So the abbreviation doesn't take place, can this feature be turned off?
I'm still confused by that feature.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to