Re: [PATCH] Documentation: merging a tag is a special case

Subsystems: documentation, the rest

5 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] Documentation: merging a tag is a special case

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:28

Jonathan Nieder [off-list ref] writes:
Nice and clear, but doesn't this contradict b5c9f1c1b0ed (merge: do
not create a signed tag merge under --ff-only option, 2012-02-05)?
It does X-<.  Here is a replacement.

The "--ff-only v1.2.3 will fail" can be left unsaid because it would
fail (and succeed) under the same condition "-ff-only v1.2.3^0"
would.

 Documentation/git-merge.txt | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index df2d28d..d1f3df9 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -179,19 +179,18 @@ 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.
+release point, you may not want to make an unnecessary merge commit.
+
+In such a case, you can "unwrap" the tag yourself before feeding it
+to `git merge`, or pass `--ff-only` when you do not have any work on
+your own. e.g.
 
 ---
 git fetch origin
-git merge [--ff-only] v1.2.3^0
+git merge v1.2.3^0
+git merge --ff-only v1.2.3
 ---
 
 

Re: [PATCH] Documentation: merging a tag is a special case

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:56:28

Junio C Hamano wrote:
              Here is a replacement.
Looks good.  Thanks for taking care of this.

Re: [PATCH] Documentation: merging a tag is a special case

From: Yann Droneaud <hidden>
Date: 2016-06-15 22:56:28

Hi,

Just a little change I made on my own.
The other part are definitely better than my version, so I propose
to merge all the patches in the thread with you as author,
putting Jonathan Nieder and myself as reviewers.

Regards

 Documentation/git-merge.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index dd90feb..42391f2 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -176,8 +176,8 @@ MERGING TAG
 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].
+Additionally, if the tag is signed, the signature check is reported
+as a comment in the message template. See also linkgit:git-tag[1].
 
 When you want to just integrate with the work leading to the commit
 that happens to be tagged, e.g. synchronizing with an upstream
-- 
1.7.11.7

[PATCH v2] Documentation: merging a tag is a special case

From: Yann Droneaud <hidden>
Date: 2016-06-15 22:56:28

From: Junio C Hamano <redacted>

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.txt.
It should be documented as an exception of "FAST-FORWARD MERGE" section
and "--ff" option description.

Reviewed-by: Jonathan Nieder <redacted>
Reviewed-by: Yann Droneaud <redacted>
---
 Documentation/git-merge.txt     | 24 ++++++++++++++++++++++++
 Documentation/merge-options.txt |  3 ++-
 2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index c852a26..42391f2 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -170,6 +170,30 @@ happens:
 If you tried a merge which resulted in complex conflicts and
 want to start over, you can recover with `git merge --abort`.
 
+MERGING TAG
+-----------
+
+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, if the tag is signed, the signature check is reported
+as a comment in the message template. See also linkgit:git-tag[1].
+
+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.
+
+In such a case, you can "unwrap" the tag yourself before feeding it
+to `git merge`, or pass `--ff-only` when you do not have any work on
+your own. e.g.
+
+---
+git fetch origin
+git merge v1.2.3^0
+git merge --ff-only v1.2.3
+---
+
+
 HOW CONFLICTS ARE PRESENTED
 ---------------------------
 
diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt
index 0bcbe0a..34a8445 100644
--- a/Documentation/merge-options.txt
+++ b/Documentation/merge-options.txt
@@ -30,7 +30,8 @@ set to `no` at the beginning of them.
 
 --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
-- 
1.7.11.7

Re: [PATCH v2] Documentation: merging a tag is a special case

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:56:28

Yann Droneaud wrote:
Reviewed-by: Jonathan Nieder <redacted>
Yes, I think this is in good shape now.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help