git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git merge <tag> behavior
@ 2013-03-19 14:55 Yann Droneaud
  2013-03-19 16:19 ` Junio C Hamano
                   ` (3 more replies)
  0 siblings, 4 replies; 53+ messages in thread
From: Yann Droneaud @ 2013-03-19 14:55 UTC (permalink / raw)
  To: Git

Hi,

While trying to reproduce/understand the problems[1][2] I was facing
when using Google's Git repo tool[3], I've found minor problems in Git:

1) there's no mention of the git merge <tag> behavior in git-merge.1

When asking Git to merge a tag (such as a signed tag or annotated tag),
it will always create a merge commit even if fast-forward was possible.
It's like having --no-ff present on the command line.

It's a difference from the default behavior described in git-merge.1[4].
It should be documented as an exception of "FAST-FORWARD MERGE" section
and "--ff" option description.

2) git merge <tag> VS git merge <object-id>

If <tag> is an object (not a lightweight/reference tag), git merge <tag>
will by default create a merge commit with the tag message.
Additionally, the signature check will be reported as comment, for
example:

    Merge tag 'v1.12.2' into branch-v1.12.2

    repo 1.12.2

    # gpg: Signature made Fri Mar  1 18:36:42 2013 CET using DSA key ID 920F5C65
    # gpg: Good signature from "Repo Maintainer <repo@android.kernel.org>"
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: 8BB9 AD79 3E8E 6153 AF0F  9A44 1653 0D5E 920F 5C65

But, if you use the tag object-id instead of its name, for example using
git merge `git show-ref <tag>`, the tag is not recognized and the
signature is not checked. Git still create a merge commit, but doesn't
prepare a commit message with the tag message and the signature:

    Merge commit 'ac22c7ae2e652f63366b65ee23122292d3564fff' into
branch-ac22c7ae2e652f63366b65ee23122292d3564fff

It would be great to have Git using the tag message and check the
signature.

3) Merge options can't be overridden.

If I modify .git/config to set a merge option, for example forcing
fast-forward merge, this option cannot be overridden on command line:

Example 1:

    $ cat .git/config:
    [branch "master"]
            mergeoptions = --ff-only

    $ git merge --no-ff <tag>
    fatal: You cannot combine --no-ff with --ff-only

Example 2:

    $ cat .git/config:
    [merge]
           ff = only

    $ git merge --no-ff <tag>
    fatal: You cannot combine --no-ff with --ff-only

Setting the merge options in config should overridden by command line.

Regards.

[1] issue 135: repo: repo sync should force fast-forward merge
https://code.google.com/p/git-repo/issues/detail?id=135

[2] Issue 136: repo: repo sync should use the tag name instead of object identifier of the tag
https://code.google.com/p/git-repo/issues/detail?id=136

[3] git-repo - repo - The multiple repository tool 
http://code.google.com/p/git-repo/

[4] git-merge(1) Manual Page
https://www.kernel.org/pub/software/scm/git/docs/git-merge.html

-- 
Yann Droneaud
OPTEYA

^ permalink raw reply	[flat|nested] 53+ messages in thread

end of thread, other threads:[~2013-04-02 15:04 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-19 14:55 git merge <tag> behavior Yann Droneaud
2013-03-19 16:19 ` Junio C Hamano
2013-03-19 17:54   ` Re* " Junio C Hamano
2013-04-01 19:57     ` [PATCH 0/3] Merging an annotated tag object Junio C Hamano
2013-04-01 19:57       ` [PATCH 1/3] merge: a random object may not necssarily be a commit Junio C Hamano
2013-04-01 22:51         ` Yann Droneaud
2013-04-02  5:30         ` Jeff King
2013-04-02 15:02           ` Junio C Hamano
2013-04-02 15:03             ` Jeff King
2013-04-01 19:57       ` [PATCH 2/3] t6200: use test_config/test_unconfig Junio C Hamano
2013-04-01 19:57       ` [PATCH 3/3] t6200: test message for merging of an annotated tag Junio C Hamano
2013-03-20 17:53   ` [PATCH] Documentation: merging a tag is a special case Yann Droneaud
2013-03-20 18:54     ` Jonathan Nieder
2013-03-20 19:07     ` Junio C Hamano
2013-03-21 19:50       ` Junio C Hamano
2013-03-21 19:56         ` Jonathan Nieder
2013-03-21 20:10           ` Junio C Hamano
2013-03-21 20:39             ` Jonathan Nieder
2013-03-21 21:47             ` Yann Droneaud
2013-03-21 21:57               ` [PATCH v2] " Yann Droneaud
2013-03-21 22:41                 ` Jonathan Nieder
2013-03-20 18:04   ` git merge <tag> behavior Yann Droneaud
2013-03-20 18:12     ` Yann Droneaud
2013-03-20 18:46       ` Junio C Hamano
2013-03-21 20:31 ` Max Nanasy
2013-03-22  9:16   ` Yann Droneaud
2013-03-22 10:09     ` [PATCH] t7600: test merge configuration override Yann Droneaud
2013-03-22 14:47       ` Junio C Hamano
2013-03-24 21:05       ` [PATCH 00/15] Use test_config Yann Droneaud
2013-03-24 21:06         ` [PATCH 01/15] t4018: remove test_config implementation Yann Droneaud
2013-03-24 21:06         ` [PATCH 02/15] t7810: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 03/15] t7811: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 04/15] t3400: use test_config to set/unset git config variables Yann Droneaud
2013-03-24 21:06         ` [PATCH 05/15] t4304: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 06/15] t4034: use test_config/test_unconfig " Yann Droneaud
2013-03-24 21:06         ` [PATCH 07/15] t4202: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 08/15] t5520: use test_config " Yann Droneaud
2013-03-24 21:06         ` [PATCH 09/15] t5541: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 10/15] t7500: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 11/15] t7502: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 12/15] t7508: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 13/15] t7600: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 14/15] t9500: " Yann Droneaud
2013-03-24 21:06         ` [PATCH 15/15] t7502: remove clear_config Yann Droneaud
2013-03-27 15:04           ` Junio C Hamano
2013-03-27 15:05         ` [PATCH 00/15] Use test_config Junio C Hamano
2013-03-27 16:19           ` Yann Droneaud
2013-03-22 15:23     ` git merge <tag> behavior Junio C Hamano
2013-03-22 10:57 ` [PATCH] t7600: merge tag shoud create a merge commit y
2013-03-22 14:48   ` Junio C Hamano
2013-03-22 14:56     ` Yann Droneaud
2013-03-22 15:05       ` Jeff King
2013-03-22 10:57 ` y

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).