{"thread":{"id":"33229","subject":"git merge <tag> behavior","startedAt":"2013-03-19T14:55:14Z","lastAt":"2013-04-02T15:03:44Z","messageCount":53,"participants":["Yann Droneaud","Junio C Hamano","Jonathan Nieder","Max Nanasy","y@quest-ce.net","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"211673","messageId":"1363704914.6289.39.camel@test.quest-ce.net","threadId":"33229","inReplyTo":null,"subject":"git merge <tag> behavior","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-19T14:55:14Z","receivedAt":"2013-03-19T14:55:14Z","isPatch":false,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nWhile trying to reproduce/understand the problems[1][2] I was facing\nwhen using Google's Git repo tool[3], I've found minor problems in Git:\n\n1) there's no mention of the git merge <tag> behavior in git-merge.1\n\nWhen asking Git to merge a tag (such as a signed tag or annotated tag),\nit will always create a merge commit even if fast-forward was possible.\nIt's like having --no-ff present on the command line.\n\nIt's a difference from the default behavior described in git-merge.1[4].\nIt should be documented as an exception of \"FAST-FORWARD MERGE\" section\nand \"--ff\" option description.\n\n2) git merge <tag> VS git merge <object-id>\n\nIf <tag> is an object (not a lightweight/reference tag), git merge <tag>\nwill by default create a merge commit with the tag message.\nAdditionally, the signature check will be reported as comment, for\nexample:\n\n    Merge tag 'v1.12.2' into branch-v1.12.2\n\n    repo 1.12.2\n\n    # gpg: Signature made Fri Mar  1 18:36:42 2013 CET using DSA key ID 920F5C65\n    # gpg: Good signature from \"Repo Maintainer <repo@android.kernel.org>\"\n    # gpg: WARNING: This key is not certified with a trusted signature!\n    # gpg:          There is no indication that the signature belongs to the owner.\n    # Primary key fingerprint: 8BB9 AD79 3E8E 6153 AF0F  9A44 1653 0D5E 920F 5C65\n\nBut, if you use the tag object-id instead of its name, for example using\ngit merge `git show-ref <tag>`, the tag is not recognized and the\nsignature is not checked. Git still create a merge commit, but doesn't\nprepare a commit message with the tag message and the signature:\n\n    Merge commit 'ac22c7ae2e652f63366b65ee23122292d3564fff' into\nbranch-ac22c7ae2e652f63366b65ee23122292d3564fff\n\nIt would be great to have Git using the tag message and check the\nsignature.\n\n3) Merge options can't be overridden.\n\nIf I modify .git/config to set a merge option, for example forcing\nfast-forward merge, this option cannot be overridden on command line:\n\nExample 1:\n\n    $ cat .git/config:\n    [branch \"master\"]\n            mergeoptions = --ff-only\n\n    $ git merge --no-ff <tag>\n    fatal: You cannot combine --no-ff with --ff-only\n\nExample 2:\n\n    $ cat .git/config:\n    [merge]\n           ff = only\n\n    $ git merge --no-ff <tag>\n    fatal: You cannot combine --no-ff with --ff-only\n\nSetting the merge options in config should overridden by command line.\n\nRegards.\n\n[1] issue 135: repo: repo sync should force fast-forward merge\nhttps://code.google.com/p/git-repo/issues/detail?id=135\n\n[2] Issue 136: repo: repo sync should use the tag name instead of object identifier of the tag\nhttps://code.google.com/p/git-repo/issues/detail?id=136\n\n[3] git-repo - repo - The multiple repository tool \nhttp://code.google.com/p/git-repo/\n\n[4] git-merge(1) Manual Page\nhttps://www.kernel.org/pub/software/scm/git/docs/git-merge.html\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"211691","messageId":"7vfvzrjrad.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"1363704914.6289.39.camel@test.quest-ce.net","subject":"Re: git merge <tag> behavior","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-19T16:19:38Z","receivedAt":"2013-03-19T16:19:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> 1) there's no mention of the git merge <tag> behavior in git-merge.1\n>\n> When asking Git to merge a tag (such as a signed tag or annotated tag),\n> it will always create a merge commit even if fast-forward was possible.\n> It's like having --no-ff present on the command line.\n>\n> It's a difference from the default behavior described in git-merge.1[4].\n> It should be documented as an exception of \"FAST-FORWARD MERGE\" section\n> and \"--ff\" option description.\n\nYes; we welcome documentation patches.\n\n> 2) git merge <tag> VS git merge <object-id>\n>\n> If <tag> is an object (not a lightweight/reference tag), git merge <tag>\n> ...\n> But, if you use the tag object-id instead of its name, for example using\n> git merge `git show-ref <tag>`,\n\n\"git show-ref <tag>\" gives you something like\n\n    572a535454612a046e7dd7404dcca94d6243c788 refs/tags/v1.8.2\n\nwhich is an invalid thing to merge with.  Perhaps you meant\n\n\tgit merge $(git rev-parse v1.12.2)\n\n> signature is not checked. Git still create a merge commit, but doesn't\n> prepare a commit message with the tag message and the signature:\n>\n> It would be great to have Git using the tag message and check the\n> signature.\n\nPerhaps, but if you feed the $(git rev-parse v1.12.2) to merge, your\nsubject will not be able to say \"Merge tag 'v1.12.2'\" in the first\nplace, so I do not think you would want to encourage such usage in\nthe first place.\n"},{"id":"211694","messageId":"7v7gl3jmx0.fsf_-_@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"7vfvzrjrad.fsf@alter.siamese.dyndns.org","subject":"Re* git merge <tag> behavior","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-19T17:54:03Z","receivedAt":"2013-03-19T17:54:03Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> 2) git merge <tag> VS git merge <object-id>\n>> ...\n>> It would be great to have Git using the tag message and check the\n>> signature.\n>\n> Perhaps, but if you feed the $(git rev-parse v1.12.2) to merge, your\n> subject will not be able to say \"Merge tag 'v1.12.2'\" in the first\n> place, so I do not think you would want to encourage such usage in\n> the first place.\n\nA patch to do so may look like this.  You would probably want to\nalso do read_sha1_file(desc->obj->sha1) here and parse out the\nheader line \"tag \" to replace the \"remote\" to recover the symbolic\ntag name, but I didn't bother in this illustration.\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 0ec8f0d..990e90c 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -516,6 +516,19 @@ static void merge_name(const char *remote, struct strbuf *msg)\n \t\tstrbuf_release(&line);\n \t\tgoto cleanup;\n \t}\n+\n+\tif (remote_head->util) {\n+\t\tstruct merge_remote_desc *desc;\n+\t\tdesc = merge_remote_util(remote_head);\n+\t\tif (desc && desc->obj && desc->obj->type == OBJ_TAG) {\n+\t\t\tstrbuf_addf(msg, \"%s\\t\\t%s '%s'\\n\",\n+\t\t\t\t    sha1_to_hex(desc->obj->sha1),\n+\t\t\t\t    typename(desc->obj->type),\n+\t\t\t\t    remote);\n+\t\t\tgoto cleanup;\n+\t\t}\n+\t}\n+\n \tstrbuf_addf(msg, \"%s\\t\\tcommit '%s'\\n\",\n \t\tsha1_to_hex(remote_head->object.sha1), remote);\n cleanup:\n"},{"id":"211777","messageId":"1363802033-26868-1-git-send-email-ydroneaud@opteya.com","threadId":"33229","inReplyTo":"7vfvzrjrad.fsf@alter.siamese.dyndns.org","subject":"[PATCH] Documentation: merging a tag is a special case","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-20T17:53:53Z","receivedAt":"2013-03-20T17:53:53Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"When asking Git to merge a tag (such as a signed tag or annotated tag),\nit will always create a merge commit even if fast-forward was possible.\nIt's like having --no-ff present on the command line.\n\nIt's a difference from the default behavior described in git-merge.txt.\nIt should be documented as an exception of \"FAST-FORWARD MERGE\" section\nand \"--ff\" option description.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n Documentation/git-merge.txt     | 9 +++++++++\n Documentation/merge-options.txt | 2 +-\n 2 files changed, 10 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex c852a26..84bc873 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -170,6 +170,15 @@ happens:\n If you tried a merge which resulted in complex conflicts and\n want to start over, you can recover with `git merge --abort`.\n \n+MERGING TAG\n+-----------\n+\n+When merging a tag (annotated or signed), Git will create a merge commit\n+even if a fast-forward merge is possible (see above).\n+The commit message template will be created from the tag message.\n+Additionally, the signature check will be reported as a comment\n+if the tag was signed. See also linkgit:git-tag[1].\n+\n HOW CONFLICTS ARE PRESENTED\n ---------------------------\n \ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex 0bcbe0a..70d1ec0 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -26,7 +26,7 @@ set to `no` at the beginning of them.\n --ff::\n \tWhen the merge resolves as a fast-forward, only update the branch\n \tpointer, without creating a merge commit.  This is the default\n-\tbehavior.\n+\tbehavior (except when merging a tag).\n \n --no-ff::\n \tCreate a merge commit even when the merge resolves as a\n-- \n1.7.11.7\n"},{"id":"211779","messageId":"1363802682.6289.46.camel@test.quest-ce.net","threadId":"33229","inReplyTo":"7vfvzrjrad.fsf@alter.siamese.dyndns.org","subject":"Re: git merge <tag> behavior","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-20T18:04:42Z","receivedAt":"2013-03-20T18:04:42Z","isPatch":false,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nLe mardi 19 mars 2013 à 09:19 -0700, Junio C Hamano a écrit :\n> Yann Droneaud <ydroneaud@opteya.com> writes:\n> \n> > 1) there's no mention of the git merge <tag> behavior in git-merge.1\n\n> Yes; we welcome documentation patches.\n> \n\nSent.\n\n> > 2) git merge <tag> VS git merge <object-id>\n> >\n> > If <tag> is an object (not a lightweight/reference tag), git merge <tag>\n> > ...\n> > But, if you use the tag object-id instead of its name, for example using\n> > git merge `git parse-rev <tag>`,\n[EDIT]\n> > signature is not checked. Git still create a merge commit, but doesn't\n> > prepare a commit message with the tag message and the signature:\n> >\n> > It would be great to have Git using the tag message and check the\n> > signature.\n> \n> Perhaps, but if you feed the $(git rev-parse v1.12.2) to merge, your\n> subject will not be able to say \"Merge tag 'v1.12.2'\" in the first\n> place, so I do not think you would want to encourage such usage in\n> the first place.\n\nI think if someone want to merge the tag object-id instead of the tag,\nthe commit subject/message should probably not make a reference to the\ntag.\n\nThe only use case for such tag merging by commit-id would be to get\nconsistent behavior in case of tag deletion. The named tag could be\nrecreated to point to another point in time. So when looking at the\nmerge commit message and searching for the tag (by name) could be\nmisleading.\n\nPS: and what about my third issue ?\n\nRegards.\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"211782","messageId":"1363803172.6289.49.camel@test.quest-ce.net","threadId":"33229","inReplyTo":"1363802682.6289.46.camel@test.quest-ce.net","subject":"Re: git merge <tag> behavior","fromName":"Yann Droneaud","fromEmail":"yann@droneaud.fr","sentAt":"2013-03-20T18:12:52Z","receivedAt":"2013-03-20T18:12:52Z","isPatch":false,"sender":{"key":"yann@droneaud.fr","avatar":null},"body":"Hi,\n \nLe mercredi 20 mars 2013 à 19:04 +0100, Yann Droneaud a écrit :\n> > > 2) git merge <tag> VS git merge <object-id>\n> > >\n> > > If <tag> is an object (not a lightweight/reference tag), git merge <tag>\n> > > ...\n> > > But, if you use the tag object-id instead of its name, for example using\n> > > git merge `git parse-rev <tag>`,\n> [EDIT]\n> > > signature is not checked. Git still create a merge commit, but doesn't\n> > > prepare a commit message with the tag message and the signature:\n> > >\n> > > It would be great to have Git using the tag message and check the\n> > > signature.\n> > \n> > Perhaps, but if you feed the $(git rev-parse v1.12.2) to merge, your\n> > subject will not be able to say \"Merge tag 'v1.12.2'\" in the first\n> > place, so I do not think you would want to encourage such usage in\n> > the first place.\n> \n> I think if someone want to merge the tag object-id instead of the tag,\n> the commit subject/message should probably not make a reference to the\n> tag.\n> \n> The only use case for such tag merging by commit-id would be to get\n> consistent behavior in case of tag deletion. The named tag could be\n> recreated to point to another point in time. So when looking at the\n> merge commit message and searching for the tag (by name) could be\n> misleading.\n> \n\nBut but do not take those remarks as a feature request.\nI was just asking for clarification/comment on the behavior difference\nbetween merging tag/tag object-id.\n\nRegards\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"211796","messageId":"7vwqt1ewp3.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"1363803172.6289.49.camel@test.quest-ce.net","subject":"Re: git merge <tag> behavior","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-20T18:46:16Z","receivedAt":"2013-03-20T18:46:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Droneaud <yann@droneaud.fr> writes:\n\n> But but do not take those remarks as a feature request.\n> I was just asking for clarification/comment on the behavior difference\n> between merging tag/tag object-id.\n\nIf you are asking why things are as they are, the answer is simply\nbecause \"git merge $(git rev-parse v1.2.3)\" was not even considered\nwhile adding the support to pull signed tags.\n\nWe did find the use case for \"git merge v1.2.3\" interesting and\nimportant enough to give it a proper support with defined semantics.\n\"git merge $(git rev-parse v1.2.3)\" may behave differently but it\nwas not because we found the use case for it important and designed\na behaviour that is different from merging the tag by name that\nsuits that use case.\n\nIt is just we didn't even think giving the bare object name to name\nan annotated or signed tag on the command line is interesting, and\nthe command does whatever the implementation happens to do to such\nan input.\n\nI think I sent out a \"how about this\" patch.  Have you tried it?\n"},{"id":"211801","messageId":"20130320185434.GP3655@google.com","threadId":"33229","inReplyTo":"1363802033-26868-1-git-send-email-ydroneaud@opteya.com","subject":"Re: [PATCH] Documentation: merging a tag is a special case","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-03-20T18:54:34Z","receivedAt":"2013-03-20T18:54:34Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Yann Droneaud wrote:\n\n> When asking Git to merge a tag (such as a signed tag or annotated tag),\n> it will always create a merge commit even if fast-forward was possible.\n> It's like having --no-ff present on the command line.\n\nThanks.  This looks good, modulo some nitpicks.\n\n[...]\n> --- a/Documentation/git-merge.txt\n> +++ b/Documentation/git-merge.txt\n> @@ -170,6 +170,15 @@ happens:\n>  If you tried a merge which resulted in complex conflicts and\n>  want to start over, you can recover with `git merge --abort`.\n>  \n> +MERGING TAG\n> +-----------\n> +\n> +When merging a tag (annotated or signed), Git will create a merge commit\n\nHow about something like \"When merging an annotated or signed tag\" or\n\"When merging an annotated (and possibly signed) tag\"?  The above text\ncan be misread as meaning \"When merging any tag, no matter whether it\nis annotated or signed\", which is needlessly confusing for people who\ndon't know about unannotated tags.\n\n[...]\n> --- a/Documentation/merge-options.txt\n> +++ b/Documentation/merge-options.txt\n> @@ -26,7 +26,7 @@ set to `no` at the beginning of them.\n>  --ff::\n>  \tWhen the merge resolves as a fast-forward, only update the branch\n>  \tpointer, without creating a merge commit.  This is the default\n> -\tbehavior.\n> +\tbehavior (except when merging a tag).\n\ns/a tag/an annotated tag/ here as well.\n\nBy the way, what about the possibility of dropping this implicit\n--no-ff?  I think Linus could get used to passing --no-ff explicitly\nwhen responding to pull requests.  I could go either way on it.\n\nIt is certainly useful to document the current state before\nconsidering changing it, so with the tweaks mentioned above,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n"},{"id":"211805","messageId":"7vboadevpk.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"1363802033-26868-1-git-send-email-ydroneaud@opteya.com","subject":"Re: [PATCH] Documentation: merging a tag is a special case","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-20T19:07:35Z","receivedAt":"2013-03-20T19:07:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> When asking Git to merge a tag (such as a signed tag or annotated tag),\n> it will always create a merge commit even if fast-forward was possible.\n> It's like having --no-ff present on the command line.\n>\n> It's a difference from the default behavior described in git-merge.txt.\n> It should be documented as an exception of \"FAST-FORWARD MERGE\" section\n> and \"--ff\" option description.\n>\n> Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>\n> ---\n>  Documentation/git-merge.txt     | 9 +++++++++\n>  Documentation/merge-options.txt | 2 +-\n>  2 files changed, 10 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\n> index c852a26..84bc873 100644\n> --- a/Documentation/git-merge.txt\n> +++ b/Documentation/git-merge.txt\n> @@ -170,6 +170,15 @@ happens:\n>  If you tried a merge which resulted in complex conflicts and\n>  want to start over, you can recover with `git merge --abort`.\n>  \n> +MERGING TAG\n> +-----------\n> +\n> +When merging a tag (annotated or signed), Git will create a merge commit\n> +even if a fast-forward merge is possible (see above).\n> +The commit message template will be created from the tag message.\n> +Additionally, the signature check will be reported as a comment\n> +if the tag was signed. See also linkgit:git-tag[1].\n> +\n\nIt would make it more helpful to readers to describe how _not_ to\ncreate such a merge commit if it is unwanted, and how the request to\nmerge a tag interacts with --ff-only option.\n\n>  HOW CONFLICTS ARE PRESENTED\n>  ---------------------------\n>  \n> diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\n> index 0bcbe0a..70d1ec0 100644\n> --- a/Documentation/merge-options.txt\n> +++ b/Documentation/merge-options.txt\n> @@ -26,7 +26,7 @@ set to `no` at the beginning of them.\n>  --ff::\n>  \tWhen the merge resolves as a fast-forward, only update the branch\n>  \tpointer, without creating a merge commit.  This is the default\n> -\tbehavior.\n> +\tbehavior (except when merging a tag).\n\nWith this update, the reader will be left wondering what would be\nthe default when she asks Git to merge a tag, no?\n\n>  --no-ff::\n>  \tCreate a merge commit even when the merge resolves as a\n"},{"id":"211888","messageId":"7vmwtwa5xa.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"7vboadevpk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Documentation: merging a tag is a special case","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-21T19:50:25Z","receivedAt":"2013-03-21T19:50:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> +MERGING TAG\n>> +-----------\n>> +\n>> +When merging a tag (annotated or signed), Git will create a merge commit\n>> +...\n>> +if the tag was signed. See also linkgit:git-tag[1].\n>> +\n>\n> It would make it more helpful to readers to describe how _not_ to\n> create such a merge commit if it is unwanted, and how the request to\n> merge a tag interacts with --ff-only option.\n>\n>> @@ -26,7 +26,7 @@ set to `no` at the beginning of them.\n>>  --ff::\n>>  \tWhen the merge resolves as a fast-forward, only update the branch\n>>  \tpointer, without creating a merge commit.  This is the default\n>> -\tbehavior.\n>> +\tbehavior (except when merging a tag).\n>\n> With this update, the reader will be left wondering what would be\n> the default when she asks Git to merge a tag, no?\n\nTaking Jonathan's input and the above into account, perhaps we can\ndo something like this on top of the posted patch?\n\n Documentation/git-merge.txt     | 26 +++++++++++++++++++++-----\n Documentation/merge-options.txt |  5 +++--\n 2 files changed, 24 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex f7e68e1..75b5ee7 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -173,11 +173,27 @@ want to start over, you can recover with `git merge --abort`.\n MERGING TAG\n -----------\n \n-When merging a tag (annotated or signed), Git will create a merge commit\n-even if a fast-forward merge is possible (see above).\n-The commit message template will be created from the tag message.\n-Additionally, the signature check will be reported as a comment\n-if the tag was signed. See also linkgit:git-tag[1].\n+When merging an annotated (and possibly signed) tag, Git always\n+creates a merge commit even if a fast-forward merge is possible, and\n+the commit message template is prepared with the tag message.  \n+Additionally, the signature check is reported as a comment\n+if the tag is signed.  See also linkgit:git-tag[1].\n+\n+Consequently a request `git merge --ff-only v1.2.3` to merge such a\n+tag would fail.\n+\n+When you want to just integrate with the work leading to the commit\n+that happens to be tagged, e.g. synchronizing with an upstream\n+release point, you may not want to make an unnecessary merge commit\n+especially when you do not have any work on your own.  In such a\n+case, you can \"unwrap\" the tag yourself before feeding it to `git\n+merge`, e.g.\n+\n+---\n+git fetch origin\n+git merge [--ff-only] v1.2.3^0\n+---\n+\n \n HOW CONFLICTS ARE PRESENTED\n ---------------------------\ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex 70d1ec0..34a8445 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -26,11 +26,12 @@ set to `no` at the beginning of them.\n --ff::\n \tWhen the merge resolves as a fast-forward, only update the branch\n \tpointer, without creating a merge commit.  This is the default\n-\tbehavior (except when merging a tag).\n+\tbehavior.\n \n --no-ff::\n \tCreate a merge commit even when the merge resolves as a\n-\tfast-forward.\n+\tfast-forward.  This is the default behaviour when merging an\n+\tannotated (and possibly signed) tag.\n \n --ff-only::\n \tRefuse to merge and exit with a non-zero status unless the\n"},{"id":"211891","messageId":"20130321195624.GH29311@google.com","threadId":"33229","inReplyTo":"7vmwtwa5xa.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Documentation: merging a tag is a special case","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-03-21T19:56:24Z","receivedAt":"2013-03-21T19:56:24Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> +Consequently a request `git merge --ff-only v1.2.3` to merge such a\n> +tag would fail.\n> +\n> +When you want to just integrate with the work leading to the commit\n> +that happens to be tagged, e.g. synchronizing with an upstream\n> +release point, you may not want to make an unnecessary merge commit\n> +especially when you do not have any work on your own.  In such a\n> +case, you can \"unwrap\" the tag yourself before feeding it to `git\n> +merge`, e.g.\n> +\n> +---\n> +git fetch origin\n> +git merge [--ff-only] v1.2.3^0\n> +---\n\nNice and clear, but doesn't this contradict b5c9f1c1b0ed (merge: do\nnot create a signed tag merge under --ff-only option, 2012-02-05)?\n"},{"id":"211893","messageId":"7vehf8a4ze.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"20130321195624.GH29311@google.com","subject":"Re: [PATCH] Documentation: merging a tag is a special case","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-21T20:10:45Z","receivedAt":"2013-03-21T20:10:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Nice and clear, but doesn't this contradict b5c9f1c1b0ed (merge: do\n> not create a signed tag merge under --ff-only option, 2012-02-05)?\n\nIt does X-<.  Here is a replacement.\n\nThe \"--ff-only v1.2.3 will fail\" can be left unsaid because it would\nfail (and succeed) under the same condition \"-ff-only v1.2.3^0\"\nwould.\n\n Documentation/git-merge.txt | 15 +++++++--------\n 1 file changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex df2d28d..d1f3df9 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -179,19 +179,18 @@ the commit message template is prepared with the tag message.\n Additionally, the signature check is reported as a comment\n if the tag is signed.  See also linkgit:git-tag[1].\n \n-Consequently a request `git merge --ff-only v1.2.3` to merge such a\n-tag would fail.\n-\n When you want to just integrate with the work leading to the commit\n that happens to be tagged, e.g. synchronizing with an upstream\n-release point, you may not want to make an unnecessary merge commit\n-especially when you do not have any work on your own.  In such a\n-case, you can \"unwrap\" the tag yourself before feeding it to `git\n-merge`, e.g.\n+release point, you may not want to make an unnecessary merge commit.\n+\n+In such a case, you can \"unwrap\" the tag yourself before feeding it\n+to `git merge`, or pass `--ff-only` when you do not have any work on\n+your own. e.g.\n \n ---\n git fetch origin\n-git merge [--ff-only] v1.2.3^0\n+git merge v1.2.3^0\n+git merge --ff-only v1.2.3\n ---\n \n \n"},{"id":"211894","messageId":"loom.20130321T212911-611@post.gmane.org","threadId":"33229","inReplyTo":"1363704914.6289.39.camel@test.quest-ce.net","subject":"Re: git merge <tag> behavior","fromName":"Max Nanasy","fromEmail":"max.nanasy@gmail.com","sentAt":"2013-03-21T20:31:30Z","receivedAt":"2013-03-21T20:31:30Z","isPatch":false,"sender":{"key":"max.nanasy@gmail.com","avatar":"https://avatars.githubusercontent.com/u/628032?v=4"},"body":"Yann Droneaud <ydroneaud <at> opteya.com> writes:\n\n> \n> 3) Merge options can't be overridden.\n> \n> If I modify .git/config to set a merge option, for example forcing\n> fast-forward merge, this option cannot be overridden on command line:\n> \n\n(git merge --no-ff-only --no-ff) should work.  The --no-ff-only overrides\nthe --ff-only configuration setting, and the --no-ff ensures that the merge\nis not a fast-forward.\n"},{"id":"211895","messageId":"20130321203909.GJ29311@google.com","threadId":"33229","inReplyTo":"7vehf8a4ze.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Documentation: merging a tag is a special case","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-03-21T20:39:09Z","receivedAt":"2013-03-21T20:39:09Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n>               Here is a replacement.\n\nLooks good.  Thanks for taking care of this.\n"},{"id":"211903","messageId":"1363902468-14764-1-git-send-email-ydroneaud@opteya.com","threadId":"33229","inReplyTo":"7vehf8a4ze.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Documentation: merging a tag is a special case","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-21T21:47:48Z","receivedAt":"2013-03-21T21:47:48Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nJust a little change I made on my own.\nThe other part are definitely better than my version, so I propose\nto merge all the patches in the thread with you as author,\nputting Jonathan Nieder and myself as reviewers.\n\nRegards\n\n Documentation/git-merge.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex dd90feb..42391f2 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -176,8 +176,8 @@ MERGING TAG\n When merging an annotated (and possibly signed) tag, Git always\n creates a merge commit even if a fast-forward merge is possible, and\n the commit message template is prepared with the tag message.\n-Additionally, the signature check is reported as a comment\n-if the tag is signed.  See also linkgit:git-tag[1].\n+Additionally, if the tag is signed, the signature check is reported\n+as a comment in the message template. See also linkgit:git-tag[1].\n \n When you want to just integrate with the work leading to the commit\n that happens to be tagged, e.g. synchronizing with an upstream\n-- \n1.7.11.7\n"},{"id":"211904","messageId":"1363903068-15905-1-git-send-email-ydroneaud@opteya.com","threadId":"33229","inReplyTo":"1363902468-14764-1-git-send-email-ydroneaud@opteya.com","subject":"[PATCH v2] Documentation: merging a tag is a special case","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-21T21:57:48Z","receivedAt":"2013-03-21T21:57:48Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nWhen asking Git to merge a tag (such as a signed tag or annotated tag),\nit will always create a merge commit even if fast-forward was possible.\nIt's like having --no-ff present on the command line.\n\nIt's a difference from the default behavior described in git-merge.txt.\nIt should be documented as an exception of \"FAST-FORWARD MERGE\" section\nand \"--ff\" option description.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nReviewed-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n Documentation/git-merge.txt     | 24 ++++++++++++++++++++++++\n Documentation/merge-options.txt |  3 ++-\n 2 files changed, 26 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex c852a26..42391f2 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -170,6 +170,30 @@ happens:\n If you tried a merge which resulted in complex conflicts and\n want to start over, you can recover with `git merge --abort`.\n \n+MERGING TAG\n+-----------\n+\n+When merging an annotated (and possibly signed) tag, Git always\n+creates a merge commit even if a fast-forward merge is possible, and\n+the commit message template is prepared with the tag message.\n+Additionally, if the tag is signed, the signature check is reported\n+as a comment in the message template. See also linkgit:git-tag[1].\n+\n+When you want to just integrate with the work leading to the commit\n+that happens to be tagged, e.g. synchronizing with an upstream\n+release point, you may not want to make an unnecessary merge commit.\n+\n+In such a case, you can \"unwrap\" the tag yourself before feeding it\n+to `git merge`, or pass `--ff-only` when you do not have any work on\n+your own. e.g.\n+\n+---\n+git fetch origin\n+git merge v1.2.3^0\n+git merge --ff-only v1.2.3\n+---\n+\n+\n HOW CONFLICTS ARE PRESENTED\n ---------------------------\n \ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex 0bcbe0a..34a8445 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -30,7 +30,8 @@ set to `no` at the beginning of them.\n \n --no-ff::\n \tCreate a merge commit even when the merge resolves as a\n-\tfast-forward.\n+\tfast-forward.  This is the default behaviour when merging an\n+\tannotated (and possibly signed) tag.\n \n --ff-only::\n \tRefuse to merge and exit with a non-zero status unless the\n-- \n1.7.11.7\n"},{"id":"211909","messageId":"20130321224120.GC12223@google.com","threadId":"33229","inReplyTo":"1363903068-15905-1-git-send-email-ydroneaud@opteya.com","subject":"Re: [PATCH v2] Documentation: merging a tag is a special case","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-03-21T22:41:20Z","receivedAt":"2013-03-21T22:41:20Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Yann Droneaud wrote:\n\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nYes, I think this is in good shape now.\n"},{"id":"211924","messageId":"cdc4f45e7520ce1fc48588c260214717@meuh.org","threadId":"33229","inReplyTo":"loom.20130321T212911-611@post.gmane.org","subject":"Re: git merge <tag> behavior","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-22T09:16:20Z","receivedAt":"2013-03-22T09:16:20Z","isPatch":false,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nLe 21.03.2013 21:31, Max Nanasy a écrit :\n> Yann Droneaud <ydroneaud <at> opteya.com> writes:\n>\n>>\n>> 3) Merge options can't be overridden.\n>>\n>> If I modify .git/config to set a merge option, for example forcing\n>> fast-forward merge, this option cannot be overridden on command \n>> line:\n>>\n>\n> (git merge --no-ff-only --no-ff) should work.  The --no-ff-only \n> overrides\n> the --ff-only configuration setting, and the --no-ff ensures that the \n> merge\n> is not a fast-forward.\n>\n\nThanks. I wasn't aware of the --no-ff-only option and\nthought --no-ff would be the opposite of --ff-only,\nor at least disable it given the order of the options.\n\nPlease find a patch to document option --no-ff-only\n\n   Documentation/merge-options.txt | 4 ++++\n   1 file changed, 4 insertions(+)\n\ndiff --git a/Documentation/merge-options.txt\nb/Documentation/merge-options.txt\nindex 0bcbe0a..20a31cf 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -37,6 +37,10 @@ set to `no` at the beginning of them.\n  \tcurrent `HEAD` is already up-to-date or the merge can be\n  \tresolved as a fast-forward.\n\n+--no-ff-only::\n+\tDisable `--ff-only` behavior, eg. allows creation of merge commit.\n+\tThis is the default behavior.\n+\n   --log[=<n>]::\n   --no-log::\n  \tIn addition to branch names, populate the log message with\n"},{"id":"211926","messageId":"1363946943-30269-1-git-send-email-ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cdc4f45e7520ce1fc48588c260214717@meuh.org","subject":"[PATCH] t7600: test merge configuration override","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-22T10:09:03Z","receivedAt":"2013-03-22T10:09:03Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Set the configuration variable 'merge.ff' to either 'only' or 'no'\nand check that this configuration can be overridden on command line.\n\nAdditionally, test for currently not tested option '--no-ff-only'\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7600-merge.sh | 26 ++++++++++++++++++++++++++\n 1 file changed, 26 insertions(+)\n\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 5e19598..b524bdb 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -254,6 +254,32 @@ test_expect_success 'merges with merge.ff=only' '\n \tverify_head $c3\n '\n \n+test_expect_success 'merges with merge.ff=only and --no-ff-only' '\n+\tgit reset --hard c1 &&\n+\ttest_tick &&\n+\ttest_when_finished \"git config --unset merge.ff\" &&\n+\tgit config merge.ff only &&\n+\ttest_must_fail git merge --no-ff c2 &&\n+\tgit merge --no-ff-only c2 &&\n+\n+\tgit reset --hard c1 &&\n+\tgit merge --no-ff-only --no-ff c2\n+'\n+\n+test_expect_success 'merges with merge.ff=no and --ff' '\n+\tgit reset --hard c0 &&\n+\ttest_tick &&\n+\ttest_when_finished \"git config --unset merge.ff\" &&\n+\tgit config merge.ff no &&\n+\ttest_must_fail git merge --ff-only c1 &&\n+\tgit merge --ff c1 &&\n+\tverify_head $c1 &&\n+\n+\tgit reset --hard c0 &&\n+\tgit merge --ff --ff-only c1 &&\n+\tverify_head $c1\n+'\n+\n test_expect_success 'merge c0 with c1 (no-commit)' '\n \tgit reset --hard c0 &&\n \tgit merge --no-commit c1 &&\n-- \n1.7.11.7\n"},{"id":"211928","messageId":"12567.1632391915$1363949912@news.gmane.org","threadId":"33229","inReplyTo":"1363704914.6289.39.camel@test.quest-ce.net","subject":"[PATCH] t7600: merge tag shoud create a merge commit","fromName":"","fromEmail":"y@quest-ce.net","sentAt":"2013-03-22T10:57:30Z","receivedAt":"2013-03-22T10:57:30Z","isPatch":true,"sender":{"key":"y@quest-ce.net","avatar":null},"body":"From: Yann Droneaud <ydroneaud@opteya.com>\n\nThis test ensures a merge commit is always created\nwhen merging an annotated (signed) tag without --ff-only option.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n\nHere's a proposition for a test tath check the creation of a merge commit\nwhen merging a tag.\n\nIt's not in final shape: the line \n\n    EDITOR=false test_must_fail git merge signed\n\nshould failed, but doesn't: the commit merge is created with\nthe default message, just like --no-edit was given.\n\nI'm making a mistake somewhere, since the EDITOR=false trick\nworks, it's even used in the next test, for --no-edit testing.\n\nRegards.\n\n t/t7600-merge.sh | 22 +++++++++++++++++++++-\n 1 file changed, 21 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex b524bdb..486f1bf 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -697,10 +697,30 @@ test_expect_success 'merge --no-ff --edit' '\n \ttest_cmp actual expected\n '\n \n+test_expect_failure GPG 'merge tag should create a merge commit' '\n+\tgit reset --hard c0 &&\n+\tgit commit --allow-empty -m \"A newer commit\" &&\n+\tgit tag -f -s -m \"A newer commit\" signed &&\n+\tgit reset --hard c0 &&\n+\n+\tgit merge signed &&\n+\tgit rev-parse signed^0 >expect &&\n+\tgit rev-parse HEAD^0 >actual &&\n+\t! test_cmp actual expect &&\n+\n+\tgit reset --hard c0 &&\n+\tgit commit --allow-empty -m \"An other newer commit\" &&\n+\tgit tag -f -s -m \"An other newer commit\" signed &&\n+\tgit reset --hard c0 &&\n+\n+\tEDITOR=false test_must_fail git merge signed &&\n+\tverify_head \"$c0\"\n+'\n+\n test_expect_success GPG 'merge --ff-only tag' '\n \tgit reset --hard c0 &&\n \tgit commit --allow-empty -m \"A newer commit\" &&\n-\tgit tag -s -m \"A newer commit\" signed &&\n+\tgit tag -f -s -m \"A newer commit\" signed &&\n \tgit reset --hard c0 &&\n \n \tgit merge --ff-only signed &&\n-- \n1.7.11.7\n"},{"id":"299221","messageId":"1363949850-11927-1-git-send-email-y","threadId":"33229","inReplyTo":"1363704914.6289.39.camel@test.quest-ce.net","subject":"[PATCH] t7600: merge tag shoud create a merge commit","fromName":"","fromEmail":"y@quest-ce.net","sentAt":"2013-03-22T10:57:30Z","receivedAt":"2013-03-22T10:57:30Z","isPatch":true,"sender":{"key":"y@quest-ce.net","avatar":null},"body":"From: Yann Droneaud <ydroneaud@opteya.com>\n\nThis test ensures a merge commit is always created\nwhen merging an annotated (signed) tag without --ff-only option.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n\nHere's a proposition for a test tath check the creation of a merge commit\nwhen merging a tag.\n\nIt's not in final shape: the line \n\n    EDITOR=false test_must_fail git merge signed\n\nshould failed, but doesn't: the commit merge is created with\nthe default message, just like --no-edit was given.\n\nI'm making a mistake somewhere, since the EDITOR=false trick\nworks, it's even used in the next test, for --no-edit testing.\n\nRegards.\n\n t/t7600-merge.sh | 22 +++++++++++++++++++++-\n 1 file changed, 21 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex b524bdb..486f1bf 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -697,10 +697,30 @@ test_expect_success 'merge --no-ff --edit' '\n \ttest_cmp actual expected\n '\n \n+test_expect_failure GPG 'merge tag should create a merge commit' '\n+\tgit reset --hard c0 &&\n+\tgit commit --allow-empty -m \"A newer commit\" &&\n+\tgit tag -f -s -m \"A newer commit\" signed &&\n+\tgit reset --hard c0 &&\n+\n+\tgit merge signed &&\n+\tgit rev-parse signed^0 >expect &&\n+\tgit rev-parse HEAD^0 >actual &&\n+\t! test_cmp actual expect &&\n+\n+\tgit reset --hard c0 &&\n+\tgit commit --allow-empty -m \"An other newer commit\" &&\n+\tgit tag -f -s -m \"An other newer commit\" signed &&\n+\tgit reset --hard c0 &&\n+\n+\tEDITOR=false test_must_fail git merge signed &&\n+\tverify_head \"$c0\"\n+'\n+\n test_expect_success GPG 'merge --ff-only tag' '\n \tgit reset --hard c0 &&\n \tgit commit --allow-empty -m \"A newer commit\" &&\n-\tgit tag -s -m \"A newer commit\" signed &&\n+\tgit tag -f -s -m \"A newer commit\" signed &&\n \tgit reset --hard c0 &&\n \n \tgit merge --ff-only signed &&\n-- \n1.7.11.7\n\n"},{"id":"211940","messageId":"7vvc8j8p9m.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"1363946943-30269-1-git-send-email-ydroneaud@opteya.com","subject":"Re: [PATCH] t7600: test merge configuration override","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-22T14:47:49Z","receivedAt":"2013-03-22T14:47:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> +test_expect_success 'merges with merge.ff=only and --no-ff-only' '\n> +\tgit reset --hard c1 &&\n> +\ttest_tick &&\n> +\ttest_when_finished \"git config --unset merge.ff\" &&\n> +\tgit config merge.ff only &&\n\nI see this was copied from existing tests, but we should use\n\"test_config\" these days.  It would be a good approach to first do a\npreparatory patch to convert the existing ones to use \"test_config\"\nand then to redo this patch using \"test_config\" on top of it.\n"},{"id":"211941","messageId":"7vr4j78p8a.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"1363949850-11927-1-git-send-email-y","subject":"Re: [PATCH] t7600: merge tag shoud create a merge commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-22T14:48:37Z","receivedAt":"2013-03-22T14:48:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"y@quest-ce.net writes:\n\n> From: Yann Droneaud <ydroneaud@opteya.com>\n>\n> This test ensures a merge commit is always created\n> when merging an annotated (signed) tag without --ff-only option.\n>\n> Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>\n> ---\n>\n> Here's a proposition for a test tath check the creation of a merge commit\n> when merging a tag.\n>\n> It's not in final shape: the line \n>\n>     EDITOR=false test_must_fail git merge signed\n\nBecause test_must_fail is a shell function, single-shot environment\nassignment like this should not be used.\n"},{"id":"211944","messageId":"831c87ad325075b6049ef52c24477da2@meuh.org","threadId":"33229","inReplyTo":"7vr4j78p8a.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] t7600: merge tag shoud create a merge commit","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-22T14:56:15Z","receivedAt":"2013-03-22T14:56:15Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Le 22.03.2013 15:48, Junio C Hamano a écrit :\n>>\n>> It's not in final shape: the line\n>>\n>>     EDITOR=false test_must_fail git merge signed\n>\n> Because test_must_fail is a shell function, single-shot environment\n> assignment like this should not be used.\n\nIt's used throughout the test. The test 'merge --no-edit tag should \nskip editor' is using it.\n\nBefore posting my half useful test, I used \"EDITOR=false test_must_fail \nset\" in --verbose mode to find if EDITOR was correctly defined passed \ntest_must_fail, and it was.\n\nSo it's still not clear why it's failing at failing. And it's making me \nangry.\n\nRegards.\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"211949","messageId":"20130322150536.GE3083@sigill.intra.peff.net","threadId":"33229","inReplyTo":"831c87ad325075b6049ef52c24477da2@meuh.org","subject":"Re: [PATCH] t7600: merge tag shoud create a merge commit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-03-22T15:05:36Z","receivedAt":"2013-03-22T15:05:36Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 22, 2013 at 03:56:15PM +0100, Yann Droneaud wrote:\n\n> Le 22.03.2013 15:48, Junio C Hamano a écrit :\n> >>\n> >>It's not in final shape: the line\n> >>\n> >>    EDITOR=false test_must_fail git merge signed\n> >\n> >Because test_must_fail is a shell function, single-shot environment\n> >assignment like this should not be used.\n> \n> It's used throughout the test. The test 'merge --no-edit tag should\n> skip editor' is using it.\n\nIt's OK to do:\n\n  SINGLE_SHOT=foo some_real_command\n\nand it's OK to do:\n\n  some_fun args\n\nbut it's not OK to do:\n\n  SINGLE_SHOT=foo some_function args\n\nBecause some POSIX shells do not create a new environment for the\nfunction (and SINGLE_SHOT will persist after the call, polluting the\nenvironment).\n\n> Before posting my half useful test, I used \"EDITOR=false\n> test_must_fail set\" in --verbose mode to find if EDITOR was correctly\n> defined passed test_must_fail, and it was.\n\nI do not think there is a shell that does not set it; it is only that\nsome shells do not _unset_ it.\n\n-Peff\n"},{"id":"211951","messageId":"7v38vn8nm4.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"cdc4f45e7520ce1fc48588c260214717@meuh.org","subject":"Re: git merge <tag> behavior","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-22T15:23:31Z","receivedAt":"2013-03-22T15:23:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> Thanks. I wasn't aware of the --no-ff-only option and\n> thought --no-ff would be the opposite of --ff-only,\n> or at least disable it given the order of the options.\n>\n> Please find a patch to document option --no-ff-only\n>\n>   Documentation/merge-options.txt | 4 ++++\n>   1 file changed, 4 insertions(+)\n>\n> diff --git a/Documentation/merge-options.txt\n> b/Documentation/merge-options.txt\n> index 0bcbe0a..20a31cf 100644\n> --- a/Documentation/merge-options.txt\n> +++ b/Documentation/merge-options.txt\n> @@ -37,6 +37,10 @@ set to `no` at the beginning of them.\n>  \tcurrent `HEAD` is already up-to-date or the merge can be\n>  \tresolved as a fast-forward.\n>\n> +--no-ff-only::\n> +\tDisable `--ff-only` behavior, eg. allows creation of merge commit.\n> +\tThis is the default behavior.\n> +\n\nWe should follow the usual\n\n\t--option::\n        --no-option::\n        \tdescription for both\n\nconvention for this one, before or after fixing the existing --ff/--no-ff\ndescription.\n\n>   --log[=<n>]::\n>   --no-log::\n>  \tIn addition to branch names, populate the log message with\n"},{"id":"212117","messageId":"cover.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"7vvc8j8p9m.fsf@alter.siamese.dyndns.org","subject":"[PATCH 00/15] Use test_config","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:05:59Z","receivedAt":"2013-03-24T21:05:59Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Please find some patches to use test_config/test_unconfig\n\nInstead of using construct such as:\n   test_when_finished \"git config --unset <key>\"\n   git config <key> <value>\nuses\n   test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n    \nAdditionally, instead of\n   git config <key> \"\"\nor\n   git config --unset <key>\n uses\n   test_unconfig <key>\nThe latter doesn't failed if <key> is not defined.\n\nPatch \"t7600: use test_config to set/unset git config variables\"\nis more important than the other and must be carefully reviewed\nregarded to the --no-log --no-ff behavior.\n\nOthers patches are fairly simple.\n\nTestsuite results are the same after the patches.\nTested against master, 7b592fadf1e23b10b913e0771b9f711770597266\n\nYann Droneaud (15):\n  t4018: remove test_config implementation\n  t7810: remove test_config implementation\n  t7811: remove test_config implementation\n  t3400: use test_config to set/unset git config variables\n  t4304: use test_config to set/unset git config variables\n  t4034: use test_config/test_unconfig to set/unset git config\n    variables\n  t4202: use test_config/test_unconfig to set/unset git config\n    variables\n  t5520: use test_config to set/unset git config variables\n  t5541: use test_config to set/unset git config variables\n  t7500: use test_config to set/unset git config variables\n  t7502: use test_config to set/unset git config variables\n  t7508: use test_config to set/unset git config variables\n  t7600: use test_config to set/unset git config variables\n  t9500: use test_config to set/unset git config variables\n  t7502: remove clear_config\n\n t/t3400-rebase.sh                      |  3 +-\n t/t3404-rebase-interactive.sh          |  3 +-\n t/t4018-diff-funcname.sh               |  5 ---\n t/t4034-diff-words.sh                  |  7 ++--\n t/t4202-log.sh                         | 28 +++++-----------\n t/t5520-pull.sh                        | 12 +++----\n t/t5541-http-push.sh                   |  3 +-\n t/t7500-commit.sh                      |  6 ++--\n t/t7502-commit.sh                      | 40 +++++------------------\n t/t7508-status.sh                      | 46 +++++++++-----------------\n t/t7600-merge.sh                       | 60 +++++++++++++++-------------------\n t/t7810-grep.sh                        |  5 ---\n t/t7811-grep-open.sh                   |  5 ---\n t/t9500-gitweb-standalone-no-errors.sh |  3 +-\n 14 files changed, 72 insertions(+), 154 deletions(-)\n\n-- \n1.7.11.7\n"},{"id":"212119","messageId":"d20701f5abc8402c142378c06e4317882978ab51.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 01/15] t4018: remove test_config implementation","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:00Z","receivedAt":"2013-03-24T21:06:00Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"test_config is provided by the test library,\na private version is not needed.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t4018-diff-funcname.sh | 5 -----\n 1 file changed, 5 deletions(-)\n\ndiff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh\nindex 082d3e8..38a092a 100755\n--- a/t/t4018-diff-funcname.sh\n+++ b/t/t4018-diff-funcname.sh\n@@ -93,11 +93,6 @@ sed -e '\n \ts/song;/song();/\n ' <Beer.perl >Beer-correct.perl\n \n-test_config () {\n-\tgit config \"$1\" \"$2\" &&\n-\ttest_when_finished \"git config --unset $1\"\n-}\n-\n test_expect_funcname () {\n \tlang=${2-java}\n \ttest_expect_code 1 git diff --no-index -U1 \\\n-- \n1.7.11.7\n"},{"id":"212118","messageId":"737a11bd025649bec5fcc7d31534a125c849b842.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 02/15] t7810: remove test_config implementation","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:01Z","receivedAt":"2013-03-24T21:06:01Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"test_config is provided by the test library,\na private version is not needed.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7810-grep.sh | 5 -----\n 1 file changed, 5 deletions(-)\n\ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex f698001..500eb50 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -1084,11 +1084,6 @@ test_expect_success 'grep -E pattern with grep.patternType=fixed' '\n \ttest_cmp expected actual\n '\n \n-test_config() {\n-\tgit config \"$1\" \"$2\" &&\n-\ttest_when_finished \"git config --unset $1\"\n-}\n-\n cat >expected <<EOF\n hello.c<RED>:<RESET>int main(int argc, const char **argv)\n hello.c<RED>-<RESET>{\n-- \n1.7.11.7\n"},{"id":"212126","messageId":"4b3024f2678000dd8edfa35047c68438f5119cd5.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 03/15] t7811: remove test_config implementation","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:02Z","receivedAt":"2013-03-24T21:06:02Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"test_config is provided by the test library,\na private version is not needed.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7811-grep-open.sh | 5 -----\n 1 file changed, 5 deletions(-)\n\ndiff --git a/t/t7811-grep-open.sh b/t/t7811-grep-open.sh\nindex a895778..e1951a5 100755\n--- a/t/t7811-grep-open.sh\n+++ b/t/t7811-grep-open.sh\n@@ -125,11 +125,6 @@ test_expect_success 'modified file' '\n \ttest_cmp empty out\n '\n \n-test_config() {\n-\tgit config \"$1\" \"$2\" &&\n-\ttest_when_finished \"git config --unset $1\"\n-}\n-\n test_expect_success 'copes with color settings' '\n \trm -f actual &&\n \techo grep.h >expect &&\n-- \n1.7.11.7\n"},{"id":"212120","messageId":"00788763fe791a5b2bc181f4dfae9247f57f3cb4.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 04/15] t3400: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:03Z","receivedAt":"2013-03-24T21:06:03Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t3400-rebase.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 1de0ebd..f6cc102 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -138,8 +138,7 @@ test_expect_success 'rebase a single mode change' '\n '\n \n test_expect_success 'rebase is not broken by diff.renames' '\n-\tgit config diff.renames copies &&\n-\ttest_when_finished \"git config --unset diff.renames\" &&\n+\ttest_config diff.renames copies &&\n \tgit checkout filemove &&\n \tGIT_TRACE=1 git rebase force-3way\n '\n-- \n1.7.11.7\n"},{"id":"212129","messageId":"46b1dba5f3e4aeec0023bc796a5967b8e5399c00.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 05/15] t4304: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:04Z","receivedAt":"2013-03-24T21:06:04Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nTests are modified to assume correct (default) configuration at entry,\nand to reset the modified configuration variables at the end.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t3404-rebase-interactive.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 15dcbd4..a58406d 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -937,8 +937,7 @@ test_expect_success 'rebase --edit-todo can be used to modify todo' '\n test_expect_success 'rebase -i respects core.commentchar' '\n \tgit reset --hard &&\n \tgit checkout E^0 &&\n-\tgit config core.commentchar \"\\\\\" &&\n-\ttest_when_finished \"git config --unset core.commentchar\" &&\n+\ttest_config core.commentchar \"\\\\\" &&\n \twrite_script remove-all-but-first.sh <<-\\EOF &&\n \tsed -e \"2,\\$s/^/\\\\\\\\/\" \"$1\" >\"$1.tmp\" &&\n \tmv \"$1.tmp\" \"$1\"\n-- \n1.7.11.7\n"},{"id":"212132","messageId":"e64177b7746115668ff6041fe163bd1f276db3de.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 06/15] t4034: use test_config/test_unconfig to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:05Z","receivedAt":"2013-03-24T21:06:05Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nAdditionally, instead of\n     git config <key> \"\"\nor\n     git config --unset <key>\nuses\n     test_unconfig <key>\nThe latter doesn't failed if <key> is not defined.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t4034-diff-words.sh | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex 40ab333..f2f55fc 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -230,7 +230,7 @@ test_expect_success '.gitattributes override config' '\n '\n \n test_expect_success 'setup: remove diff driver regex' '\n-\ttest_might_fail git config --unset diff.testdriver.wordRegex\n+\ttest_unconfig diff.testdriver.wordRegex\n '\n \n test_expect_success 'use configured regex' '\n@@ -335,8 +335,7 @@ test_expect_success 'word-diff with diff.sbe' '\n \n \tc\n \tEOF\n-\ttest_when_finished \"git config --unset diff.suppress-blank-empty\" &&\n-\tgit config diff.suppress-blank-empty true &&\n+\ttest_config diff.suppress-blank-empty true &&\n \tword_diff --word-diff=plain\n '\n \n@@ -368,7 +367,7 @@ test_expect_success 'setup history with two files' '\n \n test_expect_success 'wordRegex for the first file does not apply to the second' '\n \techo \"*.tex diff=tex\" >.gitattributes &&\n-\tgit config diff.tex.wordRegex \"[a-z]+|.\" &&\n+\ttest_config diff.tex.wordRegex \"[a-z]+|.\" &&\n \tcat >expect <<-\\EOF &&\n \t\tdiff --git a/a.tex b/a.tex\n \t\t--- a/a.tex\n-- \n1.7.11.7\n"},{"id":"212121","messageId":"f8332db5794d0f4accc7c4a0b4c0e5b106eda493.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 07/15] t4202: use test_config/test_unconfig to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:06Z","receivedAt":"2013-03-24T21:06:06Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nAdditionally, instead of\n     git config <key> \"\"\nor\n     git config --unset <key>\nuses\n     test_unconfig <key>\nThe latter doesn't failed if <key> is not defined.\n\nTests are modified to assume correct (default) configuration at entry,\nand to reset the modified configuration variables at the end.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t4202-log.sh | 28 ++++++++--------------------\n 1 file changed, 8 insertions(+), 20 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex fa686b8..9243a97 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -419,8 +419,6 @@ test_expect_success 'log --graph with merge' '\n '\n \n test_expect_success 'log.decorate configuration' '\n-\ttest_might_fail git config --unset-all log.decorate &&\n-\n \tgit log --oneline >expect.none &&\n \tgit log --oneline --decorate >expect.short &&\n \tgit log --oneline --decorate=full >expect.full &&\n@@ -429,8 +427,7 @@ test_expect_success 'log.decorate configuration' '\n \tgit log --oneline >actual &&\n \ttest_cmp expect.short actual &&\n \n-\tgit config --unset-all log.decorate &&\n-\tgit config log.decorate true &&\n+\ttest_config log.decorate true &&\n \tgit log --oneline >actual &&\n \ttest_cmp expect.short actual &&\n \tgit log --oneline --decorate=full >actual &&\n@@ -438,8 +435,7 @@ test_expect_success 'log.decorate configuration' '\n \tgit log --oneline --decorate=no >actual &&\n \ttest_cmp expect.none actual &&\n \n-\tgit config --unset-all log.decorate &&\n-\tgit config log.decorate no &&\n+\ttest_config log.decorate no &&\n \tgit log --oneline >actual &&\n \ttest_cmp expect.none actual &&\n \tgit log --oneline --decorate >actual &&\n@@ -447,8 +443,7 @@ test_expect_success 'log.decorate configuration' '\n \tgit log --oneline --decorate=full >actual &&\n \ttest_cmp expect.full actual &&\n \n-\tgit config --unset-all log.decorate &&\n-\tgit config log.decorate 1 &&\n+\ttest_config log.decorate 1 &&\n \tgit log --oneline >actual &&\n \ttest_cmp expect.short actual &&\n \tgit log --oneline --decorate=full >actual &&\n@@ -456,8 +451,7 @@ test_expect_success 'log.decorate configuration' '\n \tgit log --oneline --decorate=no >actual &&\n \ttest_cmp expect.none actual &&\n \n-\tgit config --unset-all log.decorate &&\n-\tgit config log.decorate short &&\n+\ttest_config log.decorate short &&\n \tgit log --oneline >actual &&\n \ttest_cmp expect.short actual &&\n \tgit log --oneline --no-decorate >actual &&\n@@ -465,8 +459,7 @@ test_expect_success 'log.decorate configuration' '\n \tgit log --oneline --decorate=full >actual &&\n \ttest_cmp expect.full actual &&\n \n-\tgit config --unset-all log.decorate &&\n-\tgit config log.decorate full &&\n+\ttest_config log.decorate full &&\n \tgit log --oneline >actual &&\n \ttest_cmp expect.full actual &&\n \tgit log --oneline --no-decorate >actual &&\n@@ -474,16 +467,15 @@ test_expect_success 'log.decorate configuration' '\n \tgit log --oneline --decorate >actual &&\n \ttest_cmp expect.short actual\n \n-\tgit config --unset-all log.decorate &&\n+\ttest_unconfig log.decorate &&\n \tgit log --pretty=raw >expect.raw &&\n-\tgit config log.decorate full &&\n+\ttest_config log.decorate full &&\n \tgit log --pretty=raw >actual &&\n \ttest_cmp expect.raw actual\n \n '\n \n test_expect_success 'reflog is expected format' '\n-\ttest_might_fail git config --remove-section log &&\n \tgit log -g --abbrev-commit --pretty=oneline >expect &&\n \tgit reflog >actual &&\n \ttest_cmp expect actual\n@@ -496,10 +488,6 @@ test_expect_success 'whatchanged is expected format' '\n '\n \n test_expect_success 'log.abbrevCommit configuration' '\n-\ttest_when_finished \"git config --unset log.abbrevCommit\" &&\n-\n-\ttest_might_fail git config --unset log.abbrevCommit &&\n-\n \tgit log --abbrev-commit >expect.log.abbrev &&\n \tgit log --no-abbrev-commit >expect.log.full &&\n \tgit log --pretty=raw >expect.log.raw &&\n@@ -508,7 +496,7 @@ test_expect_success 'log.abbrevCommit configuration' '\n \tgit whatchanged --abbrev-commit >expect.whatchanged.abbrev &&\n \tgit whatchanged --no-abbrev-commit >expect.whatchanged.full &&\n \n-\tgit config log.abbrevCommit true &&\n+\ttest_config log.abbrevCommit true &&\n \n \tgit log >actual &&\n \ttest_cmp expect.log.abbrev actual &&\n-- \n1.7.11.7\n"},{"id":"212133","messageId":"94763817377b46e79e1fabd559133301d638ca70.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 08/15] t5520: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:07Z","receivedAt":"2013-03-24T21:06:07Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t5520-pull.sh | 12 ++++--------\n 1 file changed, 4 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 35304b4..cb1a4c5 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -96,8 +96,7 @@ test_expect_success '--rebase' '\n '\n test_expect_success 'pull.rebase' '\n \tgit reset --hard before-rebase &&\n-\tgit config --bool pull.rebase true &&\n-\ttest_when_finished \"git config --unset pull.rebase\" &&\n+\ttest_config pull.rebase true &&\n \tgit pull . copy &&\n \ttest $(git rev-parse HEAD^) = $(git rev-parse copy) &&\n \ttest new = $(git show HEAD:file2)\n@@ -105,8 +104,7 @@ test_expect_success 'pull.rebase' '\n \n test_expect_success 'branch.to-rebase.rebase' '\n \tgit reset --hard before-rebase &&\n-\tgit config --bool branch.to-rebase.rebase true &&\n-\ttest_when_finished \"git config --unset branch.to-rebase.rebase\" &&\n+\ttest_config branch.to-rebase.rebase true &&\n \tgit pull . copy &&\n \ttest $(git rev-parse HEAD^) = $(git rev-parse copy) &&\n \ttest new = $(git show HEAD:file2)\n@@ -114,10 +112,8 @@ test_expect_success 'branch.to-rebase.rebase' '\n \n test_expect_success 'branch.to-rebase.rebase should override pull.rebase' '\n \tgit reset --hard before-rebase &&\n-\tgit config --bool pull.rebase true &&\n-\ttest_when_finished \"git config --unset pull.rebase\" &&\n-\tgit config --bool branch.to-rebase.rebase false &&\n-\ttest_when_finished \"git config --unset branch.to-rebase.rebase\" &&\n+\ttest_config pull.rebase true &&\n+\ttest_config branch.to-rebase.rebase false &&\n \tgit pull . copy &&\n \ttest $(git rev-parse HEAD^) != $(git rev-parse copy) &&\n \ttest new = $(git show HEAD:file2)\n-- \n1.7.11.7\n"},{"id":"212127","messageId":"587db999963cfa775a94b5bf3107b2ba7176a80f.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 09/15] t5541: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:08Z","receivedAt":"2013-03-24T21:06:08Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t5541-http-push.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/t/t5541-http-push.sh b/t/t5541-http-push.sh\nindex 4b4b4a6..4086f02 100755\n--- a/t/t5541-http-push.sh\n+++ b/t/t5541-http-push.sh\n@@ -181,8 +181,7 @@ test_expect_success 'push (chunked)' '\n \tgit checkout master &&\n \ttest_commit commit path3 &&\n \tHEAD=$(git rev-parse --verify HEAD) &&\n-\tgit config http.postbuffer 4 &&\n-\ttest_when_finished \"git config --unset http.postbuffer\" &&\n+\ttest_config http.postbuffer 4 &&\n \tgit push -v -v origin $BRANCH 2>err &&\n \tgrep \"POST git-receive-pack (chunked)\" err &&\n \t(cd \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git &&\n-- \n1.7.11.7\n"},{"id":"212131","messageId":"74151b665c2e3ddbb99818ef20e95a0e7a849ee9.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 10/15] t7500: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:09Z","receivedAt":"2013-03-24T21:06:09Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7500-commit.sh | 6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t7500-commit.sh b/t/t7500-commit.sh\nindex 1c908f4..436b7b6 100755\n--- a/t/t7500-commit.sh\n+++ b/t/t7500-commit.sh\n@@ -36,8 +36,7 @@ test_expect_success 'nonexistent template file should return error' '\n '\n \n test_expect_success 'nonexistent template file in config should return error' '\n-\tgit config commit.template \"$PWD\"/notexist &&\n-\ttest_when_finished \"git config --unset commit.template\" &&\n+\ttest_config commit.template \"$PWD\"/notexist &&\n \t(\n \t\tGIT_EDITOR=\"echo hello >\\\"\\$1\\\"\" &&\n \t\texport GIT_EDITOR &&\n@@ -93,14 +92,13 @@ test_expect_success '-t option should be short for --template' '\n \n test_expect_success 'config-specified template should commit' '\n \techo \"new template\" > \"$TEMPLATE\" &&\n-\tgit config commit.template \"$TEMPLATE\" &&\n+\ttest_config commit.template \"$TEMPLATE\" &&\n \techo \"more content\" >> foo &&\n \tgit add foo &&\n \t(\n \t\ttest_set_editor \"$TEST_DIRECTORY\"/t7500/add-content &&\n \t\tgit commit\n \t) &&\n-\tgit config --unset commit.template &&\n \tcommit_msg_is \"new templatecommit message\"\n '\n \n-- \n1.7.11.7\n"},{"id":"212130","messageId":"2f1fd34c7a69254d964778345a8cddea9e877ea4.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 11/15] t7502: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:10Z","receivedAt":"2013-03-24T21:06:10Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7502-commit.sh | 8 +++-----\n 1 file changed, 3 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex f9b44b7..619d438 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -171,10 +171,9 @@ test_expect_success 'verbose' '\n \n test_expect_success 'verbose respects diff config' '\n \n-\tgit config color.diff always &&\n+\ttest_config color.diff always &&\n \tgit status -v >actual &&\n-\tgrep \"\\[1mdiff --git\" actual &&\n-\tgit config --unset color.diff\n+\tgrep \"\\[1mdiff --git\" actual\n '\n \n mesg_with_comment_and_newlines='\n@@ -534,8 +533,7 @@ use_template=\"-t template\"\n try_commit_status_combo\n \n test_expect_success 'commit --status with custom comment character' '\n-\ttest_when_finished \"git config --unset core.commentchar\" &&\n-\tgit config core.commentchar \";\" &&\n+\ttest_config core.commentchar \";\" &&\n \ttry_commit --status &&\n \ttest_i18ngrep \"^; Changes to be committed:\" .git/COMMIT_EDITMSG\n '\n-- \n1.7.11.7\n"},{"id":"212122","messageId":"b067bae5607f94705b4e12a1911bebc48ebb96f3.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 12/15] t7508: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:11Z","receivedAt":"2013-03-24T21:06:11Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7508-status.sh | 46 ++++++++++++++++------------------------------\n 1 file changed, 16 insertions(+), 30 deletions(-)\n\ndiff --git a/t/t7508-status.sh b/t/t7508-status.sh\nindex aecb4d1..e2ffdac 100755\n--- a/t/t7508-status.sh\n+++ b/t/t7508-status.sh\n@@ -131,8 +131,7 @@ cat >expect <<\\EOF\n EOF\n \n test_expect_success 'status (advice.statusHints false)' '\n-\ttest_when_finished \"git config --unset advice.statusHints\" &&\n-\tgit config advice.statusHints false &&\n+\ttest_config advice.statusHints false &&\n \tgit status >output &&\n \ttest_i18ncmp expect output\n \n@@ -332,8 +331,7 @@ test_expect_success 'status -uno' '\n '\n \n test_expect_success 'status (status.showUntrackedFiles no)' '\n-\tgit config status.showuntrackedfiles no\n-\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n+\ttest_config status.showuntrackedfiles no &&\n \tgit status >output &&\n \ttest_i18ncmp expect output\n '\n@@ -348,12 +346,11 @@ cat >expect <<EOF\n #\n # Untracked files not listed\n EOF\n-git config advice.statusHints false\n test_expect_success 'status -uno (advice.statusHints false)' '\n+\ttest_config advice.statusHints false &&\n \tgit status -uno >output &&\n \ttest_i18ncmp expect output\n '\n-git config --unset advice.statusHints\n \n cat >expect << EOF\n  M dir1/modified\n@@ -400,8 +397,7 @@ test_expect_success 'status -unormal' '\n '\n \n test_expect_success 'status (status.showUntrackedFiles normal)' '\n-\tgit config status.showuntrackedfiles normal\n-\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n+\ttest_config status.showuntrackedfiles normal\n \tgit status >output &&\n \ttest_i18ncmp expect output\n '\n@@ -459,8 +455,7 @@ test_expect_success 'status -uall' '\n '\n \n test_expect_success 'status (status.showUntrackedFiles all)' '\n-\tgit config status.showuntrackedfiles all\n-\ttest_when_finished \"git config --unset status.showuntrackedfiles\" &&\n+\ttest_config status.showuntrackedfiles all\n \tgit status >output &&\n \ttest_i18ncmp expect output\n '\n@@ -485,10 +480,9 @@ test_expect_success 'status -s -uall' '\n \ttest_cmp expect output\n '\n test_expect_success 'status -s (status.showUntrackedFiles all)' '\n-\tgit config status.showuntrackedfiles all\n+\ttest_config status.showuntrackedfiles all &&\n \tgit status -s >output &&\n \trm -rf dir3 &&\n-\tgit config --unset status.showuntrackedfiles &&\n \ttest_cmp expect output\n '\n \n@@ -588,15 +582,13 @@ cat >expect <<\\EOF\n EOF\n \n test_expect_success 'status with color.ui' '\n-\tgit config color.ui always &&\n-\ttest_when_finished \"git config --unset color.ui\" &&\n+\ttest_config color.ui always &&\n \tgit status | test_decode_color >output &&\n \ttest_i18ncmp expect output\n '\n \n test_expect_success 'status with color.status' '\n-\tgit config color.status always &&\n-\ttest_when_finished \"git config --unset color.status\" &&\n+\ttest_config color.status always &&\n \tgit status | test_decode_color >output &&\n \ttest_i18ncmp expect output\n '\n@@ -720,8 +712,7 @@ EOF\n \n test_expect_success 'status without relative paths' '\n \n-\tgit config status.relativePaths false &&\n-\ttest_when_finished \"git config --unset status.relativePaths\" &&\n+\ttest_config status.relativePaths false &&\n \t(cd dir1 && git status) >output &&\n \ttest_i18ncmp expect output\n \n@@ -740,8 +731,7 @@ EOF\n \n test_expect_success 'status -s without relative paths' '\n \n-\tgit config status.relativePaths false &&\n-\ttest_when_finished \"git config --unset status.relativePaths\" &&\n+\ttest_config status.relativePaths false &&\n \t(cd dir1 && git status -s) >output &&\n \ttest_cmp expect output\n \n@@ -1038,15 +1028,14 @@ test_expect_success '--ignore-submodules=untracked suppresses submodules with un\n '\n \n test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '\n-\tgit config diff.ignoreSubmodules dirty &&\n+\ttest_config diff.ignoreSubmodules dirty &&\n \tgit status >output &&\n \ttest_i18ncmp expect output &&\n \tgit config --add -f .gitmodules submodule.subname.ignore untracked &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status >output &&\n \ttest_i18ncmp expect output &&\n-\tgit config -f .gitmodules  --remove-section submodule.subname &&\n-\tgit config --unset diff.ignoreSubmodules\n+\tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '\n@@ -1066,15 +1055,14 @@ test_expect_success '--ignore-submodules=dirty suppresses submodules with untrac\n '\n \n test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '\n-\tgit config diff.ignoreSubmodules dirty &&\n+\ttest_config diff.ignoreSubmodules dirty &&\n \tgit status >output &&\n \t! test -s actual &&\n \tgit config --add -f .gitmodules submodule.subname.ignore dirty &&\n \tgit config --add -f .gitmodules submodule.subname.path sm &&\n \tgit status >output &&\n \ttest_i18ncmp expect output &&\n-\tgit config -f .gitmodules  --remove-section submodule.subname &&\n-\tgit config --unset diff.ignoreSubmodules\n+\tgit config -f .gitmodules  --remove-section submodule.subname\n '\n \n test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '\n@@ -1291,15 +1279,13 @@ cat > expect << EOF\n EOF\n \n test_expect_success \"status (core.commentchar with submodule summary)\" '\n-\ttest_when_finished \"git config --unset core.commentchar\" &&\n-\tgit config core.commentchar \";\" &&\n+\ttest_config core.commentchar \";\" &&\n \tgit status >output &&\n \ttest_i18ncmp expect output\n '\n \n test_expect_success \"status (core.commentchar with two chars with submodule summary)\" '\n-\ttest_when_finished \"git config --unset core.commentchar\" &&\n-\tgit config core.commentchar \";;\" &&\n+\ttest_config core.commentchar \";;\" &&\n \tgit status >output &&\n \ttest_i18ncmp expect output\n '\n-- \n1.7.11.7\n"},{"id":"212135","messageId":"48e5b9a14fdebd7257d859eda05477dc2956d525.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 13/15] t7600: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:12Z","receivedAt":"2013-03-24T21:06:12Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nTests are modified to assume default configuration at entry,\nand to reset the modified configuration variables at the end.\n\nTest 'merge log message' was relying on the presence of option `--no-ff`\nin the configuration. With the option, git show -s --pretty=format:%b HEAD\nproduces an empty line and without the option, it produces an empty file.\nThe test is modified to check with and without `--no-ff` option.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7600-merge.sh | 60 ++++++++++++++++++++++++--------------------------------\n 1 file changed, 26 insertions(+), 34 deletions(-)\n\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 5e19598..2f70433 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -56,7 +56,8 @@ create_merge_msgs () {\n \t\techo &&\n \t\tgit log --no-merges ^HEAD c2 c3\n \t} >squash.1-5-9 &&\n-\techo >msg.nolog &&\n+\t: >msg.nologff &&\n+\techo >msg.nolognoff &&\n \t{\n \t\techo \"* tag 'c3':\" &&\n \t\techo \"  commit 3\" &&\n@@ -244,8 +245,7 @@ test_expect_success 'merges with --ff-only' '\n test_expect_success 'merges with merge.ff=only' '\n \tgit reset --hard c1 &&\n \ttest_tick &&\n-\ttest_when_finished \"git config --unset merge.ff\" &&\n-\tgit config merge.ff only &&\n+\ttest_config merge.ff \"only\" &&\n \ttest_must_fail git merge c2 &&\n \ttest_must_fail git merge c3 &&\n \ttest_must_fail git merge c2 c3 &&\n@@ -336,7 +336,7 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c1 with c2 (no-commit in config)' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"--no-commit\" &&\n+\ttest_config branch.master.mergeoptions \"--no-commit\" &&\n \tgit merge c2 &&\n \tverify_merge file result.1-5 &&\n \tverify_head $c1 &&\n@@ -346,12 +346,11 @@ test_expect_success 'merge c1 with c2 (no-commit in config)' '\n test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c1 with c2 (log in config)' '\n-\tgit config branch.master.mergeoptions \"\" &&\n \tgit reset --hard c1 &&\n \tgit merge --log c2 &&\n \tgit show -s --pretty=tformat:%s%n%b >expect &&\n \n-\tgit config branch.master.mergeoptions --log &&\n+\ttest_config branch.master.mergeoptions \"--log\" &&\n \tgit reset --hard c1 &&\n \tgit merge c2 &&\n \tgit show -s --pretty=tformat:%s%n%b >actual &&\n@@ -360,17 +359,12 @@ test_expect_success 'merge c1 with c2 (log in config)' '\n '\n \n test_expect_success 'merge c1 with c2 (log in config gets overridden)' '\n-\ttest_when_finished \"git config --remove-section branch.master\" &&\n-\ttest_when_finished \"git config --remove-section merge\" &&\n-\ttest_might_fail git config --remove-section branch.master &&\n-\ttest_might_fail git config --remove-section merge &&\n-\n \tgit reset --hard c1 &&\n \tgit merge c2 &&\n \tgit show -s --pretty=tformat:%s%n%b >expect &&\n \n-\tgit config branch.master.mergeoptions \"--no-log\" &&\n-\tgit config merge.log true &&\n+\ttest_config branch.master.mergeoptions \"--no-log\" &&\n+\ttest_config merge.log \"true\" &&\n \tgit reset --hard c1 &&\n \tgit merge c2 &&\n \tgit show -s --pretty=tformat:%s%n%b >actual &&\n@@ -380,7 +374,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '\n \n test_expect_success 'merge c1 with c2 (squash in config)' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"--squash\" &&\n+\ttest_config branch.master.mergeoptions \"--squash\" &&\n \tgit merge c2 &&\n \tverify_merge file result.1-5 &&\n \tverify_head $c1 &&\n@@ -392,7 +386,7 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'override config option -n with --summary' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"-n\" &&\n+\ttest_config branch.master.mergeoptions \"-n\" &&\n \ttest_tick &&\n \tgit merge --summary c2 >diffstat.txt &&\n \tverify_merge file result.1-5 msg.1-5 &&\n@@ -406,7 +400,7 @@ test_expect_success 'override config option -n with --summary' '\n \n test_expect_success 'override config option -n with --stat' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"-n\" &&\n+\ttest_config branch.master.mergeoptions \"-n\" &&\n \ttest_tick &&\n \tgit merge --stat c2 >diffstat.txt &&\n \tverify_merge file result.1-5 msg.1-5 &&\n@@ -422,7 +416,7 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'override config option --stat' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"--stat\" &&\n+\ttest_config branch.master.mergeoptions \"--stat\" &&\n \ttest_tick &&\n \tgit merge -n c2 >diffstat.txt &&\n \tverify_merge file result.1-5 msg.1-5 &&\n@@ -438,7 +432,7 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c1 with c2 (override --no-commit)' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"--no-commit\" &&\n+\ttest_config branch.master.mergeoptions \"--no-commit\" &&\n \ttest_tick &&\n \tgit merge --commit c2 &&\n \tverify_merge file result.1-5 msg.1-5 &&\n@@ -449,7 +443,7 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c1 with c2 (override --squash)' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"--squash\" &&\n+\ttest_config branch.master.mergeoptions \"--squash\" &&\n \ttest_tick &&\n \tgit merge --no-squash c2 &&\n \tverify_merge file result.1-5 msg.1-5 &&\n@@ -460,7 +454,6 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c0 with c1 (no-ff)' '\n \tgit reset --hard c0 &&\n-\tgit config branch.master.mergeoptions \"\" &&\n \ttest_tick &&\n \tgit merge --no-ff c1 &&\n \tverify_merge file result.1 &&\n@@ -471,10 +464,9 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c0 with c1 (merge.ff=false)' '\n \tgit reset --hard c0 &&\n-\tgit config merge.ff false &&\n+\ttest_config merge.ff \"false\" &&\n \ttest_tick &&\n \tgit merge c1 &&\n-\tgit config --remove-section merge &&\n \tverify_merge file result.1 &&\n \tverify_parents $c0 $c1\n '\n@@ -482,22 +474,19 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'combine branch.master.mergeoptions with merge.ff' '\n \tgit reset --hard c0 &&\n-\tgit config branch.master.mergeoptions --ff &&\n-\tgit config merge.ff false &&\n+\ttest_config branch.master.mergeoptions \"--ff\" &&\n+\ttest_config merge.ff \"false\" &&\n \ttest_tick &&\n \tgit merge c1 &&\n-\tgit config --remove-section \"branch.master\" &&\n-\tgit config --remove-section \"merge\" &&\n \tverify_merge file result.1 &&\n \tverify_parents \"$c0\"\n '\n \n test_expect_success 'tolerate unknown values for merge.ff' '\n \tgit reset --hard c0 &&\n-\tgit config merge.ff something-new &&\n+\ttest_config merge.ff \"something-new\" &&\n \ttest_tick &&\n \tgit merge c1 2>message &&\n-\tgit config --remove-section \"merge\" &&\n \tverify_head \"$c1\" &&\n \ttest_cmp empty message\n '\n@@ -515,7 +504,7 @@ test_expect_success 'combining --ff-only and --no-ff is refused' '\n \n test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '\n \tgit reset --hard c0 &&\n-\tgit config branch.master.mergeoptions \"--no-ff\" &&\n+\ttest_config branch.master.mergeoptions \"--no-ff\" &&\n \tgit merge --ff c1 &&\n \tverify_merge file result.1 &&\n \tverify_head $c1\n@@ -525,14 +514,20 @@ test_expect_success 'merge log message' '\n \tgit reset --hard c0 &&\n \tgit merge --no-log c2 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\n-\ttest_cmp msg.nolog msg.act &&\n+\ttest_cmp msg.nologff msg.act &&\n+\n+\tgit reset --hard c0 &&\n+\ttest_config branch.master.mergeoptions \"--no-ff\" &&\n+\tgit merge --no-log c2 &&\n+\tgit show -s --pretty=format:%b HEAD >msg.act &&\n+\ttest_cmp msg.nolognoff msg.act &&\n \n \tgit merge --log c3 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\n \ttest_cmp msg.log msg.act &&\n \n \tgit reset --hard HEAD^ &&\n-\tgit config merge.log yes &&\n+\ttest_config merge.log \"yes\" &&\n \tgit merge c3 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\n \ttest_cmp msg.log msg.act\n@@ -542,7 +537,6 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c1 with c0, c2, c0, and c1' '\n        git reset --hard c1 &&\n-       git config branch.master.mergeoptions \"\" &&\n        test_tick &&\n        git merge c0 c2 c0 c1 &&\n        verify_merge file result.1-5 &&\n@@ -553,7 +547,6 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c1 with c0, c2, c0, and c1' '\n        git reset --hard c1 &&\n-       git config branch.master.mergeoptions \"\" &&\n        test_tick &&\n        git merge c0 c2 c0 c1 &&\n        verify_merge file result.1-5 &&\n@@ -564,7 +557,6 @@ test_debug 'git log --graph --decorate --oneline --all'\n \n test_expect_success 'merge c1 with c1 and c2' '\n        git reset --hard c1 &&\n-       git config branch.master.mergeoptions \"\" &&\n        test_tick &&\n        git merge c1 c2 &&\n        verify_merge file result.1-5 &&\n-- \n1.7.11.7\n"},{"id":"212128","messageId":"b89138fdd40290a8697ef4e46a29c1d5a4dcf390.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 14/15] t9500: use test_config to set/unset git config variables","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:13Z","receivedAt":"2013-03-24T21:06:13Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Instead of using construct such as:\n    test_when_finished \"git config --unset <key>\"\n    git config <key> <value>\nuses\n    test_config <key> <value>\nThe latter takes care of removing <key> at the end of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t9500-gitweb-standalone-no-errors.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 90bb605..6783c14 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -539,8 +539,7 @@ test_expect_success \\\n \t test_when_finished \"GIT_COMMITTER_NAME=\\\"C O Mitter\\\"\" &&\n \t echo \"ISO-8859-1\" >> file &&\n \t git add file &&\n-\t git config i18n.commitencoding ISO-8859-1 &&\n-\t test_when_finished \"git config --unset i18n.commitencoding\" &&\n+\t test_config i18n.commitencoding ISO-8859-1 &&\n \t git commit -F \"$TEST_DIRECTORY\"/t3900/ISO8859-1.txt &&\n \t gitweb_run \"p=.git;a=commit\"'\n \n-- \n1.7.11.7\n"},{"id":"212134","messageId":"25d62be2c030306929dd11f92a7ac4be8b227ea1.1364158574.git.ydroneaud@opteya.com","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"[PATCH 15/15] t7502: remove clear_config","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-24T21:06:14Z","receivedAt":"2013-03-24T21:06:14Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Using test_config ensure the configuration variable are removed\nat the end of the test, there's no need to remove variable\nat the beginning of the test.\n\nSigned-off-by: Yann Droneaud <ydroneaud@opteya.com>\n---\n t/t7502-commit.sh | 32 ++++++--------------------------\n 1 file changed, 6 insertions(+), 26 deletions(-)\n\ndiff --git a/t/t7502-commit.sh b/t/t7502-commit.sh\nindex 619d438..256137f 100755\n--- a/t/t7502-commit.sh\n+++ b/t/t7502-commit.sh\n@@ -434,16 +434,6 @@ EOF\n \n echo '## Custom template' >template\n \n-clear_config () {\n-\t(\n-\t\tgit config --unset-all \"$1\"\n-\t\tcase $? in\n-\t\t0|5)\texit 0 ;;\n-\t\t*)\texit 1 ;;\n-\t\tesac\n-\t)\n-}\n-\n try_commit () {\n \tgit reset --hard &&\n \techo >>negative &&\n@@ -459,67 +449,57 @@ try_commit () {\n try_commit_status_combo () {\n \n \ttest_expect_success 'commit' '\n-\t\tclear_config commit.status &&\n \t\ttry_commit \"\" &&\n \t\ttest_i18ngrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit' '\n-\t\tclear_config commit.status &&\n \t\ttry_commit \"\" &&\n \t\ttest_i18ngrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit --status' '\n-\t\tclear_config commit.status &&\n \t\ttry_commit --status &&\n \t\ttest_i18ngrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit --no-status' '\n-\t\tclear_config commit.status &&\n \t\ttry_commit --no-status &&\n \t\ttest_i18ngrep ! \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit with commit.status = yes' '\n-\t\tclear_config commit.status &&\n-\t\tgit config commit.status yes &&\n+\t\ttest_config commit.status yes &&\n \t\ttry_commit \"\" &&\n \t\ttest_i18ngrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit with commit.status = no' '\n-\t\tclear_config commit.status &&\n-\t\tgit config commit.status no &&\n+\t\ttest_config commit.status no &&\n \t\ttry_commit \"\" &&\n \t\ttest_i18ngrep ! \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit --status with commit.status = yes' '\n-\t\tclear_config commit.status &&\n-\t\tgit config commit.status yes &&\n+\t\ttest_config commit.status yes &&\n \t\ttry_commit --status &&\n \t\ttest_i18ngrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit --no-status with commit.status = yes' '\n-\t\tclear_config commit.status &&\n-\t\tgit config commit.status yes &&\n+\t\ttest_config commit.status yes &&\n \t\ttry_commit --no-status &&\n \t\ttest_i18ngrep ! \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit --status with commit.status = no' '\n-\t\tclear_config commit.status &&\n-\t\tgit config commit.status no &&\n+\t\ttest_config commit.status no &&\n \t\ttry_commit --status &&\n \t\ttest_i18ngrep \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n \n \ttest_expect_success 'commit --no-status with commit.status = no' '\n-\t\tclear_config commit.status &&\n-\t\tgit config commit.status no &&\n+\t\ttest_config commit.status no &&\n \t\ttry_commit --no-status &&\n \t\ttest_i18ngrep ! \"^# Changes to be committed:\" .git/COMMIT_EDITMSG\n \t'\n-- \n1.7.11.7\n"},{"id":"212381","messageId":"7vtxnwq3y1.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"25d62be2c030306929dd11f92a7ac4be8b227ea1.1364158574.git.ydroneaud@opteya.com","subject":"Re: [PATCH 15/15] t7502: remove clear_config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-27T15:04:38Z","receivedAt":"2013-03-27T15:04:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> Using test_config ensure the configuration variable are removed\n> at the end of the test, there's no need to remove variable\n> at the beginning of the test.\n>\n> Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>\n\nThis is a good change in the longer term, but there must not be any\nother topic in-flight that adds new tests that modify configuration\nin a persistent way, which your previous patch based on 'master'\nwouldn't have addressed, for this to be a safe change (I assume that\nyou already have checked that).\n\nOtherwise these apparently redundant unsets need to be left as \"belt\nand suspenders\" safety.  The same for the change to 4202 in [PATCH\n07/15].\n\nThanks.\n"},{"id":"212382","messageId":"7vmwtoq3xb.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"cover.1364158574.git.ydroneaud@opteya.com","subject":"Re: [PATCH 00/15] Use test_config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-03-27T15:05:04Z","receivedAt":"2013-03-27T15:05:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Yann Droneaud <ydroneaud@opteya.com> writes:\n\n> Tested against master, 7b592fadf1e23b10b913e0771b9f711770597266\n\nIs this because I suggested you to clean things up while you were\ntouching in a vicinity of something that could use this clean-up?\n\nIf so, please first clean _that_ script in a patch, and then add the\nchange you wanted to do in another patch, as a single two-patch\nseries, without touching anything else that is not related to that\nchange.  The patch to t7600 is the one that needs to become two\npatches, one to clean up and the other to add tests for --no-ff.\n\nThe rest, as a separate \"only cleaning up, doing nothing else\"\nseries, are fine as a follow-up, but please make sure that they do\nnot touch anything in-flight (one easy way to check is to see \"git\ndiff --name-only maint pu -- t/\").  I would prefer to see \"clean-up\nonly\" changes that introduce unnecessary conflicts with other real\nfeatures and fixes held off until the dust settles.\n\n> Yann Droneaud (15):\n>   t4018: remove test_config implementation\n>   t7810: remove test_config implementation\n>   t7811: remove test_config implementation\n\nWe already have equivalents of these in-flight.\n\n>   t7600: use test_config to set/unset git config variables\n\nNeeds to be split into two.\n"},{"id":"212395","messageId":"ec6c6b2101cf035b5dea7f7110ddf706@meuh.org","threadId":"33229","inReplyTo":"7vmwtoq3xb.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 00/15] Use test_config","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-03-27T16:19:34Z","receivedAt":"2013-03-27T16:19:34Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nLe 27.03.2013 16:05, Junio C Hamano a écrit :\n> Yann Droneaud <ydroneaud@opteya.com> writes:\n>\n>> Tested against master, 7b592fadf1e23b10b913e0771b9f711770597266\n>\n> Is this because I suggested you to clean things up while you were\n> touching in a vicinity of something that could use this clean-up?\n>\n\nYes, grep'ing shows others usage of the test_config pattern. I patched \nthem all.\n\n> If so, please first clean _that_ script in a patch, and then add the\n> change you wanted to do in another patch, as a single two-patch\n> series, without touching anything else that is not related to that\n> change.  The patch to t7600 is the one that needs to become two\n> patches, one to clean up and the other to add tests for --no-ff.\n>\n\nActually the initial patch adding test for --no-ff-only is not part of \nthis series.\n\n\nPatch against t7600 has a special note about a strange behavor found \nwhile testing\ntest_config \"anyware\", that's why there's somes line added to the test \nand a note\nin the commit message.\n\nI was waiting for your opinion on this change in the test, but more, on \nthe difference\nof behavior exhibited in the patched test \"merge log message\":\n\n   git merge --no-log\n   git show -s --pretty=format:%b HEAD\n\nvs\n\n   git merge --no-ff --no-log\n   git show -s --pretty=format:%b HEAD\n\n\nFirst produce an empty file, while the second produce an empty line.\n\nThis was revealed by changing test \"merge c0 with c1 (ff overrides \nno-ff)\n-    git config branch.master.mergeoptions \"--no-ff\" &&\n-    test_config branch.master.mergeoptions \"--no-ff\" &&\n\n\nI could split this patch in a first patch that add the behavor test to \n\"merge log message\" test,\nthan I could rebase the patch series against.\nAnd later, submit my proposition for new tests in t7600 regarding \n--no-ff-only and tags.\n\n> The rest, as a separate \"only cleaning up, doing nothing else\"\n> series, are fine as a follow-up, but please make sure that they do\n> not touch anything in-flight (one easy way to check is to see \"git\n> diff --name-only maint pu -- t/\").  I would prefer to see \"clean-up\n> only\" changes that introduce unnecessary conflicts with other real\n> features and fixes held off until the dust settles.\n>\n\nIt's a good advice that fit perfectly in \nDocumentation/SubmittingPatches.\n\nRegards.\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"212813","messageId":"1364846239-8802-1-git-send-email-gitster@pobox.com","threadId":"33229","inReplyTo":"7v7gl3jmx0.fsf_-_@alter.siamese.dyndns.org","subject":"[PATCH 0/3] Merging an annotated tag object","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-01T19:57:16Z","receivedAt":"2013-04-01T19:57:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This is a patch I posted as an illustration, and then have been\ncarrying in my tree a while, with some tests.\n\nJunio C Hamano (3):\n  merge: a random object may not necssarily be a commit\n  t6200: use test_config/test_unconfig\n  t6200: test message for merging of an annotated tag\n\n builtin/merge.c          |  13 ++++++\n t/t6200-fmt-merge-msg.sh | 100 ++++++++++++++++++++++++++++++++---------------\n 2 files changed, 81 insertions(+), 32 deletions(-)\n\n-- \n1.8.2-480-g064f421\n"},{"id":"212811","messageId":"1364846239-8802-2-git-send-email-gitster@pobox.com","threadId":"33229","inReplyTo":"1364846239-8802-1-git-send-email-gitster@pobox.com","subject":"[PATCH 1/3] merge: a random object may not necssarily be a commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-01T19:57:17Z","receivedAt":"2013-04-01T19:57:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The user could have said \"git merge $(git rev-parse v1.0.0)\"; we\nshouldn't mark it as \"Merge commit '15999998fb...'\" as the merge\nname, even though such an invocation might be crazy.\n\nWe could even read the \"tag \" header from the tag object and replace\nthe object name the user gave us, but let's not lose the information\nby doing so, at least not yet.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/merge.c | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/builtin/merge.c b/builtin/merge.c\nindex 0ec8f0d..990e90c 100644\n--- a/builtin/merge.c\n+++ b/builtin/merge.c\n@@ -516,6 +516,19 @@ static void merge_name(const char *remote, struct strbuf *msg)\n \t\tstrbuf_release(&line);\n \t\tgoto cleanup;\n \t}\n+\n+\tif (remote_head->util) {\n+\t\tstruct merge_remote_desc *desc;\n+\t\tdesc = merge_remote_util(remote_head);\n+\t\tif (desc && desc->obj && desc->obj->type == OBJ_TAG) {\n+\t\t\tstrbuf_addf(msg, \"%s\\t\\t%s '%s'\\n\",\n+\t\t\t\t    sha1_to_hex(desc->obj->sha1),\n+\t\t\t\t    typename(desc->obj->type),\n+\t\t\t\t    remote);\n+\t\t\tgoto cleanup;\n+\t\t}\n+\t}\n+\n \tstrbuf_addf(msg, \"%s\\t\\tcommit '%s'\\n\",\n \t\tsha1_to_hex(remote_head->object.sha1), remote);\n cleanup:\n-- \n1.8.2-480-g064f421\n"},{"id":"212812","messageId":"1364846239-8802-3-git-send-email-gitster@pobox.com","threadId":"33229","inReplyTo":"1364846239-8802-1-git-send-email-gitster@pobox.com","subject":"[PATCH 2/3] t6200: use test_config/test_unconfig","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-01T19:57:18Z","receivedAt":"2013-04-01T19:57:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The tests were already well protected from previous ones by running\n\"git config --unset\" on variables early they do not want to see, but\nit is easier to make sure they start from a clean state by using\nmore modern test_config/test_unconfig helper functions.\n\nIt turns out that the last test depended on the merge.summary\nconfiguration previous one leaves behind.  Set it explicitly in it.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t6200-fmt-merge-msg.sh | 61 +++++++++++++++++++++++-------------------------\n 1 file changed, 29 insertions(+), 32 deletions(-)\n\ndiff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh\nindex 992c2a0..f84bb0c 100755\n--- a/t/t6200-fmt-merge-msg.sh\n+++ b/t/t6200-fmt-merge-msg.sh\n@@ -112,8 +112,8 @@ test_expect_success '[merge] summary/log configuration' '\n \t  Common #1\n \tEOF\n \n-\tgit config merge.log true &&\n-\ttest_might_fail git config --unset-all merge.summary &&\n+\ttest_config merge.log true &&\n+\ttest_unconfig merge.summary &&\n \n \tgit checkout master &&\n \ttest_tick &&\n@@ -121,8 +121,8 @@ test_expect_success '[merge] summary/log configuration' '\n \n \tgit fmt-merge-msg <.git/FETCH_HEAD >actual1 &&\n \n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary true &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary true &&\n \n \tgit checkout master &&\n \ttest_tick &&\n@@ -134,11 +134,6 @@ test_expect_success '[merge] summary/log configuration' '\n \ttest_cmp expected actual2\n '\n \n-test_expect_success 'setup: clear [merge] configuration' '\n-\ttest_might_fail git config --unset-all merge.log &&\n-\ttest_might_fail git config --unset-all merge.summary\n-'\n-\n test_expect_success 'setup FETCH_HEAD' '\n \tgit checkout master &&\n \ttest_tick &&\n@@ -248,14 +243,14 @@ test_expect_success 'fmt-merge-msg -m' '\n \t  Common #1\n \tEOF\n \n-\ttest_might_fail git config --unset merge.log &&\n-\ttest_might_fail git config --unset merge.summary &&\n+\ttest_unconfig merge.log &&\n+\ttest_unconfig merge.summary &&\n \tgit checkout master &&\n \tgit fetch \"$(pwd)\" left &&\n \tgit fmt-merge-msg -m \"Sync with left\" <.git/FETCH_HEAD >actual &&\n \tgit fmt-merge-msg --log -m \"Sync with left\" \\\n \t\t\t\t\t<.git/FETCH_HEAD >actual.log &&\n-\tgit config merge.log true &&\n+\ttest_config merge.log true &&\n \tgit fmt-merge-msg -m \"Sync with left\" \\\n \t\t\t\t\t<.git/FETCH_HEAD >actual.log-config &&\n \tgit fmt-merge-msg --no-log -m \"Sync with left\" \\\n@@ -290,29 +285,29 @@ test_expect_success 'setup: expected shortlog for two branches' '\n '\n \n test_expect_success 'shortlog for two branches' '\n-\tgit config merge.log true &&\n-\ttest_might_fail git config --unset-all merge.summary &&\n+\ttest_config merge.log true &&\n+\ttest_unconfig merge.summary &&\n \tgit checkout master &&\n \ttest_tick &&\n \tgit fetch . left right &&\n \tgit fmt-merge-msg <.git/FETCH_HEAD >actual1 &&\n \n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary true &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary true &&\n \tgit checkout master &&\n \ttest_tick &&\n \tgit fetch . left right &&\n \tgit fmt-merge-msg <.git/FETCH_HEAD >actual2 &&\n \n-\tgit config merge.log yes &&\n-\ttest_might_fail git config --unset-all merge.summary &&\n+\ttest_config merge.log yes &&\n+\ttest_unconfig merge.summary &&\n \tgit checkout master &&\n \ttest_tick &&\n \tgit fetch . left right &&\n \tgit fmt-merge-msg <.git/FETCH_HEAD >actual3 &&\n \n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary yes &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary yes &&\n \tgit checkout master &&\n \ttest_tick &&\n \tgit fetch . left right &&\n@@ -325,8 +320,8 @@ test_expect_success 'shortlog for two branches' '\n '\n \n test_expect_success 'merge-msg -F' '\n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary yes &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary yes &&\n \tgit checkout master &&\n \ttest_tick &&\n \tgit fetch . left right &&\n@@ -335,8 +330,8 @@ test_expect_success 'merge-msg -F' '\n '\n \n test_expect_success 'merge-msg -F in subdirectory' '\n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary yes &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary yes &&\n \tgit checkout master &&\n \ttest_tick &&\n \tgit fetch . left right &&\n@@ -350,8 +345,8 @@ test_expect_success 'merge-msg -F in subdirectory' '\n '\n \n test_expect_success 'merge-msg with nothing to merge' '\n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary yes &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary yes &&\n \n \t>empty &&\n \n@@ -376,8 +371,8 @@ test_expect_success 'merge-msg tag' '\n \t  Common #1\n \tEOF\n \n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary yes &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary yes &&\n \n \tgit checkout master &&\n \ttest_tick &&\n@@ -406,8 +401,8 @@ test_expect_success 'merge-msg two tags' '\n \t  Common #1\n \tEOF\n \n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary yes &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary yes &&\n \n \tgit checkout master &&\n \ttest_tick &&\n@@ -436,8 +431,8 @@ test_expect_success 'merge-msg tag and branch' '\n \t  Common #1\n \tEOF\n \n-\ttest_might_fail git config --unset-all merge.log &&\n-\tgit config merge.summary yes &&\n+\ttest_unconfig merge.log &&\n+\ttest_config merge.summary yes &&\n \n \tgit checkout master &&\n \ttest_tick &&\n@@ -464,6 +459,8 @@ test_expect_success 'merge-msg lots of commits' '\n \t\techo \"  ...\"\n \t} >expected &&\n \n+\ttest_config merge.summary yes &&\n+\n \tgit checkout master &&\n \ttest_tick &&\n \tgit fetch . long &&\n-- \n1.8.2-480-g064f421\n"},{"id":"212814","messageId":"1364846239-8802-4-git-send-email-gitster@pobox.com","threadId":"33229","inReplyTo":"1364846239-8802-1-git-send-email-gitster@pobox.com","subject":"[PATCH 3/3] t6200: test message for merging of an annotated tag","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-01T19:57:19Z","receivedAt":"2013-04-01T19:57:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Signed-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t6200-fmt-merge-msg.sh | 39 +++++++++++++++++++++++++++++++++++++++\n 1 file changed, 39 insertions(+)\n\ndiff --git a/t/t6200-fmt-merge-msg.sh b/t/t6200-fmt-merge-msg.sh\nindex f84bb0c..f73ecea 100755\n--- a/t/t6200-fmt-merge-msg.sh\n+++ b/t/t6200-fmt-merge-msg.sh\n@@ -469,4 +469,43 @@ test_expect_success 'merge-msg lots of commits' '\n \ttest_cmp expected actual\n '\n \n+test_expect_success 'merge-msg with \"merging\" an annotated tag' '\n+\ttest_config merge.log true &&\n+\n+\tgit checkout master^0 &&\n+\tgit commit --allow-empty -m \"One step ahead\" &&\n+\tgit tag -a -m \"An annotated one\" annote HEAD &&\n+\n+\tgit checkout master &&\n+\tgit fetch . annote &&\n+\n+\tgit fmt-merge-msg <.git/FETCH_HEAD >actual &&\n+\t{\n+\t\tcat <<-\\EOF\n+\t\tMerge tag '\\''annote'\\''\n+\n+\t\tAn annotated one\n+\n+\t\t* tag '\\''annote'\\'':\n+\t\t  One step ahead\n+\t\tEOF\n+\t} >expected &&\n+\ttest_cmp expected actual &&\n+\n+\ttest_when_finished \"git reset --hard\" &&\n+\tannote=$(git rev-parse annote) &&\n+\tgit merge --no-commit $annote &&\n+\t{\n+\t\tcat <<-EOF\n+\t\tMerge tag '\\''$annote'\\''\n+\n+\t\tAn annotated one\n+\n+\t\t* tag '\\''$annote'\\'':\n+\t\t  One step ahead\n+\t\tEOF\n+\t} >expected &&\n+\ttest_cmp expected .git/MERGE_MSG\n+'\n+\n test_done\n-- \n1.8.2-480-g064f421\n"},{"id":"212832","messageId":"1364856675.26812.3.camel@test.quest-ce.net","threadId":"33229","inReplyTo":"1364846239-8802-2-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 1/3] merge: a random object may not necssarily be a commit","fromName":"Yann Droneaud","fromEmail":"ydroneaud@opteya.com","sentAt":"2013-04-01T22:51:15Z","receivedAt":"2013-04-01T22:51:15Z","isPatch":true,"sender":{"key":"ydroneaud@opteya.com","avatar":"https://avatars.githubusercontent.com/u/881377?v=4"},"body":"Hi,\n\nLe lundi 01 avril 2013 à 12:57 -0700, Junio C Hamano a écrit :\n> The user could have said \"git merge $(git rev-parse v1.0.0)\"; we\n> shouldn't mark it as \"Merge commit '15999998fb...'\" as the merge\n> name, even though such an invocation might be crazy.\n> \n> We could even read the \"tag \" header from the tag object and replace\n> the object name the user gave us, but let's not lose the information\n> by doing so, at least not yet.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nThanks for the patch.\n\nI gave it a try and found the behavior rather good.\n\nMerging a tag object by its name or by its object-id are now using the\nsame behavor: it is more consistent. \n\nTested-by: Yann Droneaud <ydroneaud@opteya.com>\n\nPS: there's a typo in the commit title :)\n\nRegards.\n\n-- \nYann Droneaud\nOPTEYA\n"},{"id":"212850","messageId":"20130402053004.GC22089@sigill.intra.peff.net","threadId":"33229","inReplyTo":"1364846239-8802-2-git-send-email-gitster@pobox.com","subject":"Re: [PATCH 1/3] merge: a random object may not necssarily be a commit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T05:30:04Z","receivedAt":"2013-04-02T05:30:04Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Apr 01, 2013 at 12:57:17PM -0700, Junio C Hamano wrote:\n\n> The user could have said \"git merge $(git rev-parse v1.0.0)\"; we\n> shouldn't mark it as \"Merge commit '15999998fb...'\" as the merge\n> name, even though such an invocation might be crazy.\n> \n> We could even read the \"tag \" header from the tag object and replace\n> the object name the user gave us, but let's not lose the information\n> by doing so, at least not yet.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n>  builtin/merge.c | 13 +++++++++++++\n>  1 file changed, 13 insertions(+)\n> \n> diff --git a/builtin/merge.c b/builtin/merge.c\n> index 0ec8f0d..990e90c 100644\n> --- a/builtin/merge.c\n> +++ b/builtin/merge.c\n> @@ -516,6 +516,19 @@ static void merge_name(const char *remote, struct strbuf *msg)\n>  \t\tstrbuf_release(&line);\n>  \t\tgoto cleanup;\n>  \t}\n> +\n> +\tif (remote_head->util) {\n> +\t\tstruct merge_remote_desc *desc;\n> +\t\tdesc = merge_remote_util(remote_head);\n> +\t\tif (desc && desc->obj && desc->obj->type == OBJ_TAG) {\n> +\t\t\tstrbuf_addf(msg, \"%s\\t\\t%s '%s'\\n\",\n> +\t\t\t\t    sha1_to_hex(desc->obj->sha1),\n> +\t\t\t\t    typename(desc->obj->type),\n> +\t\t\t\t    remote);\n> +\t\t\tgoto cleanup;\n> +\t\t}\n> +\t}\n> +\n>  \tstrbuf_addf(msg, \"%s\\t\\tcommit '%s'\\n\",\n>  \t\tsha1_to_hex(remote_head->object.sha1), remote);\n\nI guess there is no other object type besides OBJ_TAG and OBJ_COMMIT\nthat would yield something we could merge, but it feels weird that you\ncheck only for OBJ_TAG here, and otherwise still say \"commit\". Would the\nintent be more clear if it just said:\n\n  if (desc && desc->obj && desc->obj->type != OBJ_COMMIT) {\n          ...\n\n?\n\n-Peff\n"},{"id":"212887","messageId":"7vk3olgemi.fsf@alter.siamese.dyndns.org","threadId":"33229","inReplyTo":"20130402053004.GC22089@sigill.intra.peff.net","subject":"Re: [PATCH 1/3] merge: a random object may not necssarily be a commit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-04-02T15:02:13Z","receivedAt":"2013-04-02T15:02:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Apr 01, 2013 at 12:57:17PM -0700, Junio C Hamano wrote:\n>\n>> The user could have said \"git merge $(git rev-parse v1.0.0)\"; we\n>> shouldn't mark it as \"Merge commit '15999998fb...'\" as the merge\n>> name, even though such an invocation might be crazy.\n>> \n>> We could even read the \"tag \" header from the tag object and replace\n>> the object name the user gave us, but let's not lose the information\n>> by doing so, at least not yet.\n>> \n>> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>> ---\n>>  builtin/merge.c | 13 +++++++++++++\n>>  1 file changed, 13 insertions(+)\n>> \n>> diff --git a/builtin/merge.c b/builtin/merge.c\n>> index 0ec8f0d..990e90c 100644\n>> --- a/builtin/merge.c\n>> +++ b/builtin/merge.c\n>> @@ -516,6 +516,19 @@ static void merge_name(const char *remote, struct strbuf *msg)\n>>  \t\tstrbuf_release(&line);\n>>  \t\tgoto cleanup;\n>>  \t}\n>> +\n>> +\tif (remote_head->util) {\n>> +\t\tstruct merge_remote_desc *desc;\n>> +\t\tdesc = merge_remote_util(remote_head);\n>> +\t\tif (desc && desc->obj && desc->obj->type == OBJ_TAG) {\n>> +\t\t\tstrbuf_addf(msg, \"%s\\t\\t%s '%s'\\n\",\n>> +\t\t\t\t    sha1_to_hex(desc->obj->sha1),\n>> +\t\t\t\t    typename(desc->obj->type),\n>> +\t\t\t\t    remote);\n>> +\t\t\tgoto cleanup;\n>> +\t\t}\n>> +\t}\n>> +\n>>  \tstrbuf_addf(msg, \"%s\\t\\tcommit '%s'\\n\",\n>>  \t\tsha1_to_hex(remote_head->object.sha1), remote);\n>\n> I guess there is no other object type besides OBJ_TAG and OBJ_COMMIT\n> that would yield something we could merge, but it feels weird that you\n> check only for OBJ_TAG here, and otherwise still say \"commit\". Would the\n> intent be more clear if it just said:\n>\n>   if (desc && desc->obj && desc->obj->type != OBJ_COMMIT) {\n>           ...\n>\n> ?\n\nI suspect not.\n\nThe point of the added code is that it knows we want to special case\nmerging a tag object, and it wants to keep any other case behaving\nthe same as before.\n"},{"id":"212888","messageId":"20130402150343.GA18642@sigill.intra.peff.net","threadId":"33229","inReplyTo":"7vk3olgemi.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/3] merge: a random object may not necssarily be a commit","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-04-02T15:03:44Z","receivedAt":"2013-04-02T15:03:44Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 02, 2013 at 08:02:13AM -0700, Junio C Hamano wrote:\n\n> >> +\tif (remote_head->util) {\n> >> +\t\tstruct merge_remote_desc *desc;\n> >> +\t\tdesc = merge_remote_util(remote_head);\n> >> +\t\tif (desc && desc->obj && desc->obj->type == OBJ_TAG) {\n> >> +\t\t\tstrbuf_addf(msg, \"%s\\t\\t%s '%s'\\n\",\n> >> +\t\t\t\t    sha1_to_hex(desc->obj->sha1),\n> >> +\t\t\t\t    typename(desc->obj->type),\n> >> +\t\t\t\t    remote);\n> >> +\t\t\tgoto cleanup;\n> >> +\t\t}\n> >> +\t}\n> >> +\n> >>  \tstrbuf_addf(msg, \"%s\\t\\tcommit '%s'\\n\",\n> >>  \t\tsha1_to_hex(remote_head->object.sha1), remote);\n> >\n> > I guess there is no other object type besides OBJ_TAG and OBJ_COMMIT\n> > that would yield something we could merge, but it feels weird that you\n> > check only for OBJ_TAG here, and otherwise still say \"commit\". Would the\n> > intent be more clear if it just said:\n> >\n> >   if (desc && desc->obj && desc->obj->type != OBJ_COMMIT) {\n> >           ...\n> >\n> > ?\n> \n> I suspect not.\n> \n> The point of the added code is that it knows we want to special case\n> merging a tag object, and it wants to keep any other case behaving\n> the same as before.\n\nAh. I read it as \"if we have a random object, we do not want to just say\n\"commit X\", because it is not a commit.\n\n-Peff\n"}]}