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

Re: Configure default merge message

From
Jjost.schulte@tutanota.com <jost.schulte@tutanota.com>
Date
Mar 26, 2021, 06:30 UTC
Message-ID
<MWhDYQt--3-2@tutanota.com>
In-Reply-To
<87a6qsourb.fsf@evledraar.gmail.com>
Thank you for the detailed explanation. Where can I see the commits that you mention?
25 Mar 2021, 03:02 by avarab@gmail.com:
Show 64 quoted lines
>
> On Wed, Mar 24 2021, Junio C Hamano wrote:
>
>> jost.schulte@tutanota.com writes:
>>
>>> Hello all,
>>>
>>> I'm using git mainly with BitBucket repositories. When I pull from a remote, the default commit message will be "Merge branch 'source-branch-name' of https://bitbucket.org/ <https://bitbucket.org/jibbletech/jibble-2.0-client-web>repository-name into destination-branch-name".
>>>
>>> I'd like to configure git to omit the "of https://bitbucket.org/repository-name" part. How can I do that?
>>>
>>> Regards
>>> Jost
>>>
>>
>> Ævar, is this something we recently made it impossible with 4e168333
>> (shortlog: remove unused(?) "repo-abbrev" feature, 2021-01-12), or
>> is there more to it than resurrecting that "feature" to do what Jost
>> seems to want?
>>
>
> Perhaps I'm using it incorrectly, but I don't see how that repo-abbrev
> feature ever resulted in the insertion of this munged content into the
> actual commit object.
>
> The shortlog examples of "..." in 4e168333 are of shortlog's output
> being modified on the fly. Not of them being inserted into commits.
>
> You can run "git merge" with "--log" which says it inserts "shortlog"
> output. So I thought that maybe lines that were not the first "Merge
> ... into" line in the message could have gotten munged in this way
> before my change.
>
> But I don't think that happened either, and reverting 4e168333 and doing
> a merge --log locally with e.g. "# repo-abbrev: branch" does not munge
> the string "branch" in either the subject or the body, it's retained,
> e.g.:
>  
>  commit 02c864e58da (HEAD)
>  Merge: 353c73510dc c6d63de00ff
>  Author: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
>  Date:   Thu Mar 25 03:00:21 2021 +0100
>  
>  Merge branch 'to-merge' into HEAD
>  
>  * to-merge:
>  Merge this branch blah blah
>  
>
> That's because "merge" never used the munging.
>
> If you look at the code in 7595e2ee6ef (git-shortlog: make common
> repository prefix configurable with .mailmap, 2006-11-25) when this
> repo-abbrev feature was first added the "merge" would use
> builtin-fmt-merge-msg.c to format the "shortlog", which implemented its
> own function to do so, and didn't use the mailmap.
>
> As to Jost's question. I think the way to do this is to use
> fmt-merge-msg, see 2102440c17f (fmt-merge-msg -m to override merge
> title, 2010-08-17) for an example.
>
> That seems like it would also be simpler than Jeff King's suggestion in
> the side-thread in <YFvAJU3Euxhjb+uw@coredump.intra.peff.net>.
>
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 5 of 6 in “Configure default merge message”
  1. jost.schulte@tutanota.comMar 24, 2021
  2. Junio C HamanoMar 24, 2021
  3. Jeff KingMar 24, 2021
  4. Ævar Arnfjörð BjarmasonMar 25, 2021
  5. jost.schulte@tutanota.comMar 26, 2021
  6. Ævar Arnfjörð BjarmasonMar 26, 2021

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.