git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: merge-recursive, was Re: What's in git.git

From
Junio C Hamano <junkio@cox.net>
Date
Oct 26, 2006, 10:00 UTC
Message-ID
<7v7iyno0qk.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7v3b9bpgvs.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 7 quoted lines
>> BTW what happened to the builtin shortlog? It is the last Perl script I 
>> use regularly... (should make people happy who are stuck with Activision 
>> Perl...)
>
> Yeah, I was wondering about it too, when I was looking for
> something readily mergeable to "next" today.  I must have
> misplaced it.
I looked at the code again.

This is a prime demonstration that it makes more sense to keep script version until we flush out configurability issues.

The built-in mailmap list is easily overridden with ".mailmap" which presumably projects would want to keep under version control, so it is less of an issue, but not everybody would necessarily want to name that file ".mailmap".

There is a "dot3" merge source shortening logic that is very specific to the kernel, and this cannot be customized per project. If it were kept as Perl script, each project could limp along with a copy of this script, modified for their needs, without making the script itself customizable. Rewriting it into C does not _forbid_ that kind of use, but certainly it makes it more cumbersome to do so.

First I'd probably ask kernel folks to maintain their own copy of .mailmap at the toplevel of their source tree, so that we can remove this kernel specific built-in mailmap from shortlog (I'd even do so before switching from the Perl version).

The dot3 logic is probably best substituted with config, a version controllable file similar to .mailmap, or command line parameters, but I am not sure which one is the best way to go. Whatever mechanism is used, It essentially is to define a mapping from a long string to its abbreviation (currently there is one hardcoded one, that replaces /pub/scm/linux/kernel/git/ to /.../), to be applied to the first line of log message body. Presumably other projects could have more than one "popular" prefixes that appear often, so (if we take command line approach, which I think is the worst of the three possibilities) the "slightly more generalized" version would look something like this perhaps?

  git-shortlog --mailmapfile=.mailmap \
  	--abbrev=/pub/scm/linux/kernel/git/,/.../ \
        --abbrev=/pub/scm/,/.../../

We could even define the --abbrev stuff as 's/from/to/' but that would make it harder for us to shake Perl off, and in practice this is to shorten the merge source repository name, so deliberately limiting its feature to simple string replace like the above might make more sense.

Previous: Junio C HamanoNext: Johannes Schindelin
Message 18 of 26 in “What's in git.git”
  1. Junio C HamanoOct 26, 2006
  2. Jakub NarebskiOct 26, 2006
  3. Junio C HamanoOct 26, 2006
  4. Petr BaudisOct 26, 2006
  5. Jakub NarebskiOct 26, 2006
  6. merge-recursive, was Re: What's in git.gitJohannes Schindelin, Oct 26, 2006
  7. Jakub NarebskiOct 26, 2006
  8. Junio C HamanoOct 26, 2006
  9. Jakub NarebskiOct 26, 2006
  10. Nicolas PitreOct 26, 2006
  11. git-shortlog mailmapPetr Baudis, Oct 26, 2006
  12. Jakub NarebskiOct 26, 2006
  13. Andreas EricssonOct 26, 2006
  14. Jakub NarebskiOct 26, 2006
  15. Johannes SchindelinOct 26, 2006
  16. Petr BaudisOct 26, 2006
  17. Junio C HamanoOct 26, 2006
  18. Junio C HamanoOct 26, 2006
  19. Johannes SchindelinOct 26, 2006
  20. shortlog, was Re: merge-recursive, was Re: What's in git.gitAndreas Ericsson, Oct 26, 2006
  21. Nicolas PitreOct 26, 2006
  22. Andreas EricssonOct 26, 2006
  23. Jakub NarebskiOct 26, 2006
  24. Petr BaudisOct 27, 2006
  25. Petr BaudisOct 26, 2006
  26. Andy WhitcroftOct 26, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.