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

Re: Merge commit says refs/heads/<branchname> instead of <branchname>

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 13, 2019, 07:12 UTC
Message-ID
<xmqq8sokb673.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20191113051530.GA3547@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> If I do:
>
>   git reset --hard tip && git merge --no-edit refs/heads/side
>   git log -1 --oneline
>
> then I get:
>
>   Merge branch 'refs/heads/side'
>
> And the behavior seems the same going back to older versions of Git. Are
> you sure your workflow hasn't changed somehow?
>
> Can you show an example that triggers the behavior for you?
Yes, I am curious, too.
Show 7 quoted lines
>> I'm failing to find in the docs what drives that change, what
>> configuration option controls such (default?) message.
>> 
>> What may be the reason of that change?
>
> I think any change there would probably be unintentional (but it's hard
> to say for sure without tracking it down).

If older versions of git produced "Merge branch 'side'" when told to merge 'refs/heads/side', I could sort-of believe it. And if we no longer do so and instead record "Merge branch 'refs/heads/side'", then I actually think that is a desirable change.

By the way, pulling from self follows slightly different rule, i.e.
	$ git pull . refs/heads/side
would likely give you "Merge branch 'side'".
Previous: Jeff KingNext: Mateusz Loskot
Message 3 of 5 in “Merge commit says refs/heads/<branchname> instead of <branchname>”
  1. Mateusz LoskotNov 12, 2019
  2. Jeff KingNov 13, 2019
  3. Junio C HamanoNov 13, 2019
  4. Mateusz LoskotNov 15, 2019
  5. Mateusz LoskotNov 29, 2019

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.