{"thread":{"id":"29697","subject":"Bug report: \"git-merge --ff\" should fail if branches have diverged","startedAt":"2012-02-22T21:51:05Z","lastAt":"2012-02-22T22:27:07Z","messageCount":3,"participants":["Sean Gies","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"185209","messageId":"DB0837FD-0963-4BF9-BD7B-B243F580CC1C@imgtec.com","threadId":"29697","inReplyTo":null,"subject":"Bug report: \"git-merge --ff\" should fail if branches have diverged","fromName":"Sean Gies","fromEmail":"sean.gies@imgtec.com","sentAt":"2012-02-22T21:51:05Z","receivedAt":"2012-02-22T21:51:05Z","isPatch":false,"sender":{"key":"sean.gies@imgtec.com","avatar":null},"body":"Git developers, I have a small bug report:\n\nWhen I specify the \"--ff\" option to git-merge, I expect it to perform a fast-forward merge or none at all. If the branches have diverged and a fast-forward cannot be done, I expect the command to fail. With git 1.7.6, if \"git-merge -ff\" cannot fast-forward, it falls back to creating the merge commit I did not want.\n\nThank you,\n-Sean\n"},{"id":"185214","messageId":"7vr4xm8qin.fsf@alter.siamese.dyndns.org","threadId":"29697","inReplyTo":"DB0837FD-0963-4BF9-BD7B-B243F580CC1C@imgtec.com","subject":"Re: Bug report: \"git-merge --ff\" should fail if branches have diverged","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-22T22:14:24Z","receivedAt":"2012-02-22T22:14:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sean Gies <Sean.Gies@imgtec.com> writes:\n\n> When I specify the \"--ff\" option to git-merge, I expect it to perform a\n> fast-forward merge or none at all.\n\nThat expectation needs to be adjusted with s/--ff/--ff-only/, I think.\n\nThe \"--no-ff\" option says \"Never do fast-forward and always create extra\ncommit even when the side branch is a descendant\", and the \"--ff\" option\nis a way to countermand it, i.e. \"It is ok to fast-forward this merge\".\n\nAnd there is another one \"I do not want anything bug fast forward\", and\nthat is spelled --ff-only.\n"},{"id":"185215","messageId":"7vmx8a8pxg.fsf_-_@alter.siamese.dyndns.org","threadId":"29697","inReplyTo":"7vr4xm8qin.fsf@alter.siamese.dyndns.org","subject":"[PATCH] Documentation/merge-options.txt: group \"ff\" related options together","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-22T22:27:07Z","receivedAt":"2012-02-22T22:27:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The --ff-only option was not described next to --ff and --no-ff options in\n\"git merge\" documentation, even though these three are logically together,\ndescribing one option that takes one of three values.\n\nAlso the description for '--ff' and '--no-ff' discussed what '--ff' means,\nand mentioned '--no-ff' as if it were a side-note to '--ff'.\n\nMake them into three top-level entries and list them together. This way,\nit would be more clear that the user can choose one from these three.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Perhaps a patch like this would be an improvement to make it easier to\n   find the options.\n\n Documentation/merge-options.txt |   22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex f2f1d0f..0bcbe0a 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -24,13 +24,18 @@ updated behaviour, the environment variable `GIT_MERGE_AUTOEDIT` can be\n set to `no` at the beginning of them.\n \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+\n --no-ff::\n-\tDo not generate a merge commit if the merge resolved as\n-\ta fast-forward, only update the branch pointer. This is\n-\tthe default behavior of git-merge.\n-+\n-With --no-ff Generate a merge commit even if the merge\n-resolved as a fast-forward.\n+\tCreate a merge commit even when the merge resolves as a\n+\tfast-forward.\n+\n+--ff-only::\n+\tRefuse to merge and exit with a non-zero status unless the\n+\tcurrent `HEAD` is already up-to-date or the merge can be\n+\tresolved as a fast-forward.\n \n --log[=<n>]::\n --no-log::\n@@ -65,11 +70,6 @@ merge.\n With --no-squash perform the merge and commit the result. This\n option can be used to override --squash.\n \n---ff-only::\n-\tRefuse to merge and exit with a non-zero status unless the\n-\tcurrent `HEAD` is already up-to-date or the merge can be\n-\tresolved as a fast-forward.\n-\n -s <strategy>::\n --strategy=<strategy>::\n \tUse the given merge strategy; can be supplied more than\n"}]}