{"thread":{"id":"44600","subject":"[PATCH] commit: make --only --allow-empty work without paths","startedAt":"2016-12-02T22:15:23Z","lastAt":"2016-12-09T04:10:30Z","messageCount":10,"participants":["Andreas Krey","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"306821","messageId":"20161202221513.GA5370@inner.h.apk.li","threadId":"44600","inReplyTo":null,"subject":"[PATCH] commit: make --only --allow-empty work without paths","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2016-12-02T22:15:13Z","receivedAt":"2016-12-02T22:15:23Z","isPatch":true,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"--only is implied when paths are present, and required\nthem unless --amend. But with --allow-empty it should\nbe allowed as well - it is the only way to create an\nempty commit in the presence of staged changes.\n\nSigned-off-by: Andreas Krey <a.krey@gmx.de>\n---\n\nI stumbled over this omission trying\nto create an empty commit while changes\nare staged. (We use such empty commits as\nworkaround when devs forgot to put issues\ninto the actual commits. And one had\nstaged changes at that point.)\n\nArguably, requiring paths with --only is\npointless anyway because it is implicit\nin that case, but I'm happy when it works\nlike in this patch.\n\n(The interdepence of the tests is a strange thing;\nmaking --run=N somewhat pointless.)\n\n(And I hope that the patch in commit.c is\nactually sufficient for this, but have\nnot found indications to the contrary.)\n\n Documentation/git-commit.txt | 3 ++-\n builtin/commit.c             | 2 +-\n t/t7501-commit.sh            | 9 +++++++++\n 3 files changed, 12 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex f2ab0ee2e..4f8f20a36 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -265,7 +265,8 @@ FROM UPSTREAM REBASE\" section in linkgit:git-rebase[1].)\n \tIf this option is specified together with `--amend`, then\n \tno paths need to be specified, which can be used to amend\n \tthe last commit without committing changes that have\n-\talready been staged.\n+\talready been staged. If used together with `--allow-empty`\n+\tpaths are also not required, and an empty commit will be created.\n \n -u[<mode>]::\n --untracked-files[=<mode>]::\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 8976c3d29..89b66816f 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1206,7 +1206,7 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \n \tif (also + only + all + interactive > 1)\n \t\tdie(_(\"Only one of --include/--only/--all/--interactive/--patch can be used.\"));\n-\tif (argc == 0 && (also || (only && !amend)))\n+\tif (argc == 0 && (also || (only && !amend && !allow_empty)))\n \t\tdie(_(\"No paths with --include/--only does not make sense.\"));\n \tif (argc == 0 && only && amend)\n \t\tonly_include_assumed = _(\"Clever... amending the last one with dirty index.\");\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex d84897a67..0d8d89309 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -155,6 +155,15 @@ test_expect_success 'amend --only ignores staged contents' '\n \tgit diff --exit-code\n '\n \n+test_expect_success 'allow-empty --only ignores staged contents' '\n+\techo changed-again >file &&\n+\tgit add file &&\n+\tgit commit --allow-empty --only -m \"empty\" &&\n+\tgit cat-file blob HEAD:file >file.actual &&\n+\ttest_cmp file.expect file.actual &&\n+\tgit diff --exit-code\n+'\n+\n test_expect_success 'set up editor' '\n \tcat >editor <<-\\EOF &&\n \t#!/bin/sh\n-- \n2.11.0.10.g1e1b186\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"306855","messageId":"20161203043254.7ozjyucfn6uivnsh@sigill.intra.peff.net","threadId":"44600","inReplyTo":"20161202221513.GA5370@inner.h.apk.li","subject":"Re: [PATCH] commit: make --only --allow-empty work without paths","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-12-03T04:32:55Z","receivedAt":"2016-12-03T04:36:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 02, 2016 at 11:15:13PM +0100, Andreas Krey wrote:\n\n> --only is implied when paths are present, and required\n> them unless --amend. But with --allow-empty it should\n> be allowed as well - it is the only way to create an\n> empty commit in the presence of staged changes.\n\nOK. I'm not sure why you would want to create an empty commit in such a\ncase. But I do agree that this seems like a natural outcome for \"--only\n--allow-empty\". So whether it is particularly useful or not, it seems\nlike the right thing to do. The patch itself looks good to me.\n\n> Arguably, requiring paths with --only is\n> pointless anyway because it is implicit\n> in that case, but I'm happy when it works\n> like in this patch.\n\nI think the point is just to warn the user that what they've asked for\nis by definition a noop (and that's why there's already an exception for\n--amend, which _does_ make it do something). The fact that --only is\nimplicit with paths is mostly historical; at one point it was not the\ndefault. These days it's unnecessary, but retained for backwards\ncompatibility.\n\n> (The interdepence of the tests is a strange thing;\n> making --run=N somewhat pointless.)\n\nYes, I think --run is a misfeature (I actually had to look it up, as I\nhad completely forgotten that it was added). It's too hard to know which\ntests are required setup for later ones, and often the dependency is\nimplicit. If a single test script is annoyingly long to run, I'd argue\nit should be broken out into its own script (and that will let it run in\nparallel when the full suite is run, too). I don't know that t7501\nqualifies, though; it runs in about 800ms on my machine.\n\n> diff --git a/builtin/commit.c b/builtin/commit.c\n> index 8976c3d29..89b66816f 100644\n> --- a/builtin/commit.c\n> +++ b/builtin/commit.c\n> @@ -1206,7 +1206,7 @@ static int parse_and_validate_options(int argc, const char *argv[],\n>  \n>  \tif (also + only + all + interactive > 1)\n>  \t\tdie(_(\"Only one of --include/--only/--all/--interactive/--patch can be used.\"));\n> -\tif (argc == 0 && (also || (only && !amend)))\n> +\tif (argc == 0 && (also || (only && !amend && !allow_empty)))\n>  \t\tdie(_(\"No paths with --include/--only does not make sense.\"));\n>  \tif (argc == 0 && only && amend)\n>  \t\tonly_include_assumed = _(\"Clever... amending the last one with dirty index.\");\n\nI think this should be sufficient. Obviously we'll end up with an empty\ncommit, but allow_empty should cover that case later on.\n\n> diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\n> index d84897a67..0d8d89309 100755\n> --- a/t/t7501-commit.sh\n> +++ b/t/t7501-commit.sh\n> @@ -155,6 +155,15 @@ test_expect_success 'amend --only ignores staged contents' '\n>  \tgit diff --exit-code\n>  '\n>  \n> +test_expect_success 'allow-empty --only ignores staged contents' '\n> +\techo changed-again >file &&\n> +\tgit add file &&\n> +\tgit commit --allow-empty --only -m \"empty\" &&\n> +\tgit cat-file blob HEAD:file >file.actual &&\n> +\ttest_cmp file.expect file.actual &&\n> +\tgit diff --exit-code\n> +'\n> +\n\nUsually we'd put new tests at the end. I guess you wanted this here to\nmatch the \"--amend --only\" test before it. That kind of sticks this\noddball in the middle of a bunch of --amend tests, but I'm not sure it\nwould go better anywhere else. So I'm fine with it here.\n\n-Peff\n"},{"id":"306863","messageId":"20161203065949.GG19570@inner.h.apk.li","threadId":"44600","inReplyTo":"20161203043254.7ozjyucfn6uivnsh@sigill.intra.peff.net","subject":"Re: [PATCH] commit: make --only --allow-empty work without paths","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2016-12-03T06:59:49Z","receivedAt":"2016-12-03T07:00:03Z","isPatch":true,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Fri, 02 Dec 2016 23:32:55 +0000, Jeff King wrote:\n> On Fri, Dec 02, 2016 at 11:15:13PM +0100, Andreas Krey wrote:\n> \n> > --only is implied when paths are present, and required\n> > them unless --amend. But with --allow-empty it should\n> > be allowed as well - it is the only way to create an\n> > empty commit in the presence of staged changes.\n> \n> OK. I'm not sure why you would want to create an empty commit in such a\n> case.\n\nUser: Ok tool, make me a pullreq.\n\nTool: But you haven't mentioned any issue\n      in your commit messages. Which are they?\n\nUser: Ok, that would be A-123.\n\nTool: git commit --allow-empty -m 'FIX: A-123'\n\nOriginally we checked that the status output was\nempty, and later added an option for 'yes, I know\nthat there are uncommitted changes; I don't want\nthem included'.\n\nAnd then someone had staged changes, which lead me here,\nbecause there is no way now to create an empty commit\n(just for the commit message) in that situation.\nAmending the previous commit wouldn't fly with us\nbecause of a local ban on non-fast-forward pushes.\n\n...\n> > (The interdepence of the tests is a strange thing;\n> > making --run=N somewhat pointless.)\n> \n> Yes, I think --run is a misfeature (I actually had to look it up, as I\n...\n> implicit. If a single test script is annoyingly long to run, I'd argue\n\nIt wasn't about runtime but about output. I would have\nliked to see only the output of my still-failing test;\na 'stop after test X' would be helpful there.\n\nAndreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"306873","messageId":"20161203162318.uv27n4uhylobegto@sigill.intra.peff.net","threadId":"44600","inReplyTo":"20161203065949.GG19570@inner.h.apk.li","subject":"Re: [PATCH] commit: make --only --allow-empty work without paths","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-12-03T16:23:18Z","receivedAt":"2016-12-03T16:23:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Dec 03, 2016 at 07:59:49AM +0100, Andreas Krey wrote:\n\n> > OK. I'm not sure why you would want to create an empty commit in such a\n> > case.\n> \n> User: Ok tool, make me a pullreq.\n> \n> Tool: But you haven't mentioned any issue\n>       in your commit messages. Which are they?\n> \n> User: Ok, that would be A-123.\n> \n> Tool: git commit --allow-empty -m 'FIX: A-123'\n\nOK. I think \"tool\" is slightly funny here, but I get that is part of the\nreal world works. Thanks for illustrating.\n\n> > Yes, I think --run is a misfeature (I actually had to look it up, as I\n> ...\n> > implicit. If a single test script is annoyingly long to run, I'd argue\n> \n> It wasn't about runtime but about output. I would have\n> liked to see only the output of my still-failing test;\n> a 'stop after test X' would be helpful there.\n\nYou can do --verbose-only=<n>, but if the test is failing, I typically\nuse \"-v -i\". That makes everything verbose, and then stops at the\nfailing test, so you can see the output easily.\n\n-Peff\n"},{"id":"306959","messageId":"xmqqh96i3ygs.fsf@gitster.mtv.corp.google.com","threadId":"44600","inReplyTo":"20161203162318.uv27n4uhylobegto@sigill.intra.peff.net","subject":"Re: [PATCH] commit: make --only --allow-empty work without paths","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-05T20:36:19Z","receivedAt":"2016-12-05T20:36:34Z","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 Sat, Dec 03, 2016 at 07:59:49AM +0100, Andreas Krey wrote:\n>\n>> > OK. I'm not sure why you would want to create an empty commit in such a\n>> > case.\n>> \n>> User: Ok tool, make me a pullreq.\n>> \n>> Tool: But you haven't mentioned any issue\n>>       in your commit messages. Which are they?\n>> \n>> User: Ok, that would be A-123.\n>> \n>> Tool: git commit --allow-empty -m 'FIX: A-123'\n>\n> OK. I think \"tool\" is slightly funny here, but I get that is part of the\n> real world works. Thanks for illustrating.\n\nI am not sure if I understand.  Why isn't the FIX: thing added to\nthe commit being pulled by amending it?  Would the convention be for\nthe responder of a pull-request to fetch and drop the tip commit?\n\n"},{"id":"306961","messageId":"xmqqd1h63xqn.fsf@gitster.mtv.corp.google.com","threadId":"44600","inReplyTo":"20161203043254.7ozjyucfn6uivnsh@sigill.intra.peff.net","subject":"Re: [PATCH] commit: make --only --allow-empty work without paths","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-05T20:52:00Z","receivedAt":"2016-12-05T20:52:29Z","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 Fri, Dec 02, 2016 at 11:15:13PM +0100, Andreas Krey wrote:\n>\n>> --only is implied when paths are present, and required\n>> them unless --amend. But with --allow-empty it should\n>> be allowed as well - it is the only way to create an\n>> empty commit in the presence of staged changes.\n>\n> OK. I'm not sure why you would want to create an empty commit in such a\n> case. But I do agree that this seems like a natural outcome for \"--only\n> --allow-empty\". So whether it is particularly useful or not, it seems\n> like the right thing to do. The patch itself looks good to me.\n\nSlightly related topic.  \n\n>> -\tif (argc == 0 && (also || (only && !amend)))\n>> +\tif (argc == 0 && (also || (only && !amend && !allow_empty)))\n>>  \t\tdie(_(\"No paths with --include/--only does not make sense.\"));\n>>  \tif (argc == 0 && only && amend)\n>>  \t\tonly_include_assumed = _(\"Clever... amending the last one with dirty index.\");\n>\n\nWe allow \"-o --amend\" without no pathspec because that is how you\nwould reword without changing the tree object in the tip commit, and\nwe reward the user who figured out such an esoteric use with a\nmessage \"Clever...\".  I do not think if people who say \"I want to\ncreate an empty commit but I already have added changes to the\nindex\" deserve the same \"Clever...\" praise, so I will not suggest\nadding another message above.\n\nMore seriously, I suspect that the message outlived its usefulness.\nIf we wanted to make the \"use --amend -o without pathspec if you\nwant to reword the tip one without touching its tree\" easier to\ndiscover, the place to do so is in the documentation, not a message\nthat is given as a reward to those who already discovered it.\n"},{"id":"306993","messageId":"20161206093930.GE16188@inner.h.apk.li","threadId":"44600","inReplyTo":"xmqqh96i3ygs.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] commit: make --only --allow-empty work without paths","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2016-12-06T09:39:30Z","receivedAt":"2016-12-06T09:50:05Z","isPatch":true,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"On Mon, 05 Dec 2016 12:36:19 +0000, Junio C Hamano wrote:\n> Jeff King <peff@peff.net> writes:\n> > On Sat, Dec 03, 2016 at 07:59:49AM +0100, Andreas Krey wrote:\n...\n> >> Tool: git commit --allow-empty -m 'FIX: A-123'\n> >\n> > OK. I think \"tool\" is slightly funny here, but I get that is part of the\n> > real world works. Thanks for illustrating.\n> \n> I am not sure if I understand.  Why isn't the FIX: thing added to\n> the commit being pulled by amending it?\n\nBecause we don't allow push -f on our blessed repo (bitbucket).\n(Oops, answer to wrong question. But the integrators don't want\nto meddle with dev's commits, either.)\n\nThis has multiple reasons:\n\n- The percentage of people who can and would be willing\n  to do rebase -i is small. (Not that they are likely to\n  increase under this policy.)\n\n- Our build tool record builds by commit id, and when\n  you rebase (even if only for commit message edits)\n  you lose your (simple) build history.\n\n> Would the convention be for\n> the responder of a pull-request to fetch and drop the tip commit?\n\nNo, they need to keep it as there is automation hinging on the FIX line.\n\nI would much prefer people to do rebases/amends instead of this crutch,\nbut that's not for now.\n\nHmm, it just occurred to me that we might allow force pushes for specific\nusers to keep the foot-shooting ratio low.\n\n- Andreas\n\n-- \n\"Totally trivial. Famous last words.\"\nFrom: Linus Torvalds <torvalds@*.org>\nDate: Fri, 22 Jan 2010 07:29:21 -0800\n"},{"id":"307239","messageId":"20161208135029.GA16292@inner.h.apk.li","threadId":"44600","inReplyTo":"xmqqd1h63xqn.fsf@gitster.mtv.corp.google.com","subject":"[PATCH v2] commit: make --only --allow-empty work without paths","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2016-12-08T13:50:29Z","receivedAt":"2016-12-08T13:50:40Z","isPatch":true,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"--only is implied when paths are present, and required\nthem unless --amend. But with --allow-empty it should\nbe allowed as well - it is the only way to create an\nempty commit in the presence of staged changes.\n\nAlso remove the post-fact cleverness indication;\nit's in the man page anyway.\n\nSigned-off-by: Andreas Krey <a.krey@gmx.de>\n---\n\nOk, I've removed the clever message, as Junio suggested.\nI don't know what else to do to make it acceptable. :-)\nWe're going to deploy it internally anyway, but I think\nit belongs in git.git as well (aka 'Can I has \"will queue\"?').\n\n Documentation/git-commit.txt | 3 ++-\n builtin/commit.c             | 4 +---\n t/t7501-commit.sh            | 9 +++++++++\n 3 files changed, 12 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt\nindex f2ab0ee2e..4f8f20a36 100644\n--- a/Documentation/git-commit.txt\n+++ b/Documentation/git-commit.txt\n@@ -265,7 +265,8 @@ FROM UPSTREAM REBASE\" section in linkgit:git-rebase[1].)\n \tIf this option is specified together with `--amend`, then\n \tno paths need to be specified, which can be used to amend\n \tthe last commit without committing changes that have\n-\talready been staged.\n+\talready been staged. If used together with `--allow-empty`\n+\tpaths are also not required, and an empty commit will be created.\n \n -u[<mode>]::\n --untracked-files[=<mode>]::\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 8976c3d29..276c74034 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1206,10 +1206,8 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \n \tif (also + only + all + interactive > 1)\n \t\tdie(_(\"Only one of --include/--only/--all/--interactive/--patch can be used.\"));\n-\tif (argc == 0 && (also || (only && !amend)))\n+\tif (argc == 0 && (also || (only && !amend && !allow_empty)))\n \t\tdie(_(\"No paths with --include/--only does not make sense.\"));\n-\tif (argc == 0 && only && amend)\n-\t\tonly_include_assumed = _(\"Clever... amending the last one with dirty index.\");\n \tif (argc > 0 && !also && !only)\n \t\tonly_include_assumed = _(\"Explicit paths specified without -i or -o; assuming --only paths...\");\n \tif (!cleanup_arg || !strcmp(cleanup_arg, \"default\"))\ndiff --git a/t/t7501-commit.sh b/t/t7501-commit.sh\nindex d84897a67..0d8d89309 100755\n--- a/t/t7501-commit.sh\n+++ b/t/t7501-commit.sh\n@@ -155,6 +155,15 @@ test_expect_success 'amend --only ignores staged contents' '\n \tgit diff --exit-code\n '\n \n+test_expect_success 'allow-empty --only ignores staged contents' '\n+\techo changed-again >file &&\n+\tgit add file &&\n+\tgit commit --allow-empty --only -m \"empty\" &&\n+\tgit cat-file blob HEAD:file >file.actual &&\n+\ttest_cmp file.expect file.actual &&\n+\tgit diff --exit-code\n+'\n+\n test_expect_success 'set up editor' '\n \tcat >editor <<-\\EOF &&\n \t#!/bin/sh\n-- \n2.11.0.10.g1e1b186.dirty\n\n"},{"id":"307263","messageId":"xmqq1sxiv051.fsf@gitster.mtv.corp.google.com","threadId":"44600","inReplyTo":"20161208135029.GA16292@inner.h.apk.li","subject":"Re: [PATCH v2] commit: make --only --allow-empty work without paths","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-12-08T16:47:06Z","receivedAt":"2016-12-08T16:47:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Krey <a.krey@gmx.de> writes:\n\n> Ok, I've removed the clever message, as Junio suggested.\n> I don't know what else to do to make it acceptable. :-)\n> We're going to deploy it internally anyway, but I think\n> it belongs in git.git as well (aka 'Can I has \"will queue\"?').\n\nOh, sorry for being unclear.  Before I started saying \"Slightly\nrelated topic.\", after quoting \"The patch itself looks good to me.\"\nby Peff, I meant to say \"Yeah, this looks good; thanks.\", but\napparently I forgot.\n\nRemoval of \"Clever\" is a separate issue and it may make sense to do\nso, but it deserves its own commit with its own justification.\n\nSorry for making you send an extra round; let's queue the original,\nand if you still are interested, have the \"Clever\" removal as its\nown patch.\n\nThanks.\n\n\n"},{"id":"307326","messageId":"20161209041021.GB16292@inner.h.apk.li","threadId":"44600","inReplyTo":"xmqq1sxiv051.fsf@gitster.mtv.corp.google.com","subject":"[PATCH] commit: remove 'Clever' message for --only --amend","fromName":"Andreas Krey","fromEmail":"a.krey@gmx.de","sentAt":"2016-12-09T04:10:21Z","receivedAt":"2016-12-09T04:10:30Z","isPatch":true,"sender":{"key":"a.krey@gmx.de","avatar":"https://avatars.githubusercontent.com/u/37810?v=4"},"body":"That behavior is now documented, and we don't\nneed a reward afterwards.\n\nSigned-off-by: Andreas Krey <a.krey@gmx.de>\n---\n\n> Sorry for making you send an extra round; let's queue the original,\n> and if you still are interested, have the \"Clever\" removal as its\n> own patch.\n\nHere you go.\n\n builtin/commit.c | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 89b66816f..276c74034 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1208,8 +1208,6 @@ static int parse_and_validate_options(int argc, const char *argv[],\n \t\tdie(_(\"Only one of --include/--only/--all/--interactive/--patch can be used.\"));\n \tif (argc == 0 && (also || (only && !amend && !allow_empty)))\n \t\tdie(_(\"No paths with --include/--only does not make sense.\"));\n-\tif (argc == 0 && only && amend)\n-\t\tonly_include_assumed = _(\"Clever... amending the last one with dirty index.\");\n \tif (argc > 0 && !also && !only)\n \t\tonly_include_assumed = _(\"Explicit paths specified without -i or -o; assuming --only paths...\");\n \tif (!cleanup_arg || !strcmp(cleanup_arg, \"default\"))\n-- \n2.11.0.10.g1e1b186.dirty\n"}]}