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

Re: git merges of tags

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 19, 2017, 18:30 UTC
Message-ID
<CA+55aFwaxsNZ0ACQkASdDTbSrdcHMJpFPtswK485tEWRBVVYrA@mail.gmail.com>
In-Reply-To
<20170519092202.6b0f9a57@canb.auug.org.au>
On Thu, May 18, 2017 at 4:23 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
Show 5 quoted lines
>
> Just a reminder that if you are merging Linus' tree (or any tree
> really) via a tag, git was changed some time ago so that merging a tag
> will not do a fast forward (there is a good reason for this - I just
> can't recall it ATM).

The reason is that when you merge a signed tag, git squirrels away t he signature into the merge commit, so that you can see and verify the signage later (use "git log --show-signatures" to see the signatures on the commits).

If you fast-forward, there isn't any new commit to add the signing data to.
> To do the fast forward, try "git merge <tag>^{}" ...

A slightly simpler syntax might be just "tag^0", but yes, the "^{}" thing peels off any tags.

>   (unfortunately
> doing "git merge --ff <tag>" also does not do a fast forward - it also
> doesn't fail, it unexpectedly just creates a merge commit :-().

"--ff" is the default behavior, and means "allow fast forward", but note that it is about "allowing", not "forcing".

You can use "--ff-only" to say that you will _only_ accept a fast-forward, and git will error out if it needs to create a merge.

                  Linus
Previous: Stephen Rothwell
Message 2 of 2 in “git merges of tags”
  1. Stephen RothwellMay 18, 2017
  2. Linus TorvaldsMay 19, 2017

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.