public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Yann Droneaud <ydroneaud@opteya•com>
Cc: Git <git@vger•kernel.org>, Jonathan Nieder <jrnieder@gmail•com>
Subject: Re: [PATCH] Documentation: merging a tag is a special case
Date: Thu, 21 Mar 2013 12:50:25 -0700	[thread overview]
Message-ID: <7vmwtwa5xa.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vboadevpk.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Wed, 20 Mar 2013 12:07:35 -0700")

Junio C Hamano <gitster@pobox•com> writes:

>> +MERGING TAG
>> +-----------
>> +
>> +When merging a tag (annotated or signed), Git will create a merge commit
>> +...
>> +if the tag was signed. See also linkgit:git-tag[1].
>> +
>
> It would make it more helpful to readers to describe how _not_ to
> create such a merge commit if it is unwanted, and how the request to
> merge a tag interacts with --ff-only option.
>
>> @@ -26,7 +26,7 @@ set to `no` at the beginning of them.
>>  --ff::
>>  	When the merge resolves as a fast-forward, only update the branch
>>  	pointer, without creating a merge commit.  This is the default
>> -	behavior.
>> +	behavior (except when merging a tag).
>
> With this update, the reader will be left wondering what would be
> the default when she asks Git to merge a tag, no?

Taking Jonathan's input and the above into account, perhaps we can
do something like this on top of the posted patch?

 Documentation/git-merge.txt     | 26 +++++++++++++++++++++-----
 Documentation/merge-options.txt |  5 +++--
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index f7e68e1..75b5ee7 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -173,11 +173,27 @@ want to start over, you can recover with `git merge --abort`.
 MERGING TAG
 -----------
 
-When merging a tag (annotated or signed), Git will create a merge commit
-even if a fast-forward merge is possible (see above).
-The commit message template will be created from the tag message.
-Additionally, the signature check will be reported as a comment
-if the tag was signed. See also linkgit:git-tag[1].
+When merging an annotated (and possibly signed) tag, Git always
+creates a merge commit even if a fast-forward merge is possible, and
+the commit message template is prepared with the tag message.  
+Additionally, the signature check is reported as a comment
+if the tag is signed.  See also linkgit:git-tag[1].
+
+Consequently a request `git merge --ff-only v1.2.3` to merge such a
+tag would fail.
+
+When you want to just integrate with the work leading to the commit
+that happens to be tagged, e.g. synchronizing with an upstream
+release point, you may not want to make an unnecessary merge commit
+especially when you do not have any work on your own.  In such a
+case, you can "unwrap" the tag yourself before feeding it to `git
+merge`, e.g.
+
+---
+git fetch origin
+git merge [--ff-only] v1.2.3^0
+---
+
 
 HOW CONFLICTS ARE PRESENTED
 ---------------------------
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 70d1ec0..34a8445 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -26,11 +26,12 @@ set to `no` at the beginning of them.
 --ff::
 	When the merge resolves as a fast-forward, only update the branch
 	pointer, without creating a merge commit.  This is the default
-	behavior (except when merging a tag).
+	behavior.
 
 --no-ff::
 	Create a merge commit even when the merge resolves as a
-	fast-forward.
+	fast-forward.  This is the default behaviour when merging an
+	annotated (and possibly signed) tag.
 
 --ff-only::
 	Refuse to merge and exit with a non-zero status unless the

  reply	other threads:[~2013-03-21 19:51 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vmwtwa5xa.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=ydroneaud@opteya$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox