Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1644954 > unrolled thread

git merges of tags

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2017-05-19 01:30 +0200
Last post2017-05-19 20:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  git merges of tags Stephen Rothwell <sfr@canb.auug.org.au> - 2017-05-19 01:30 +0200
    Re: git merges of tags Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-19 20:40 +0200

#1644954 — git merges of tags

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2017-05-19 01:30 +0200
Subjectgit merges of tags
Message-ID<tID1M-1LH-9@gated-at.bofh.it>
Hi all,

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).  This is a problem when your current head of
branch has been merged into (e.g.) Linus' tree and then you do "git
merge <tag>" on a tag that is later than the merge point.  You end up
with an unnecessary merge commit rather than just fast forwarding.

To do the fast forward, try "git merge <tag>^{}" ... (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 :-().
-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1645841

FromLinus Torvalds <torvalds@linux-foundation.org>
Date2017-05-19 20:40 +0200
Message-ID<tIUYF-5ZV-13@gated-at.bofh.it>
In reply to#1644954
On Thu, May 18, 2017 at 4:23 PM, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> 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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web