{"thread":{"id":"39355","subject":"[PATCH v2 0/2] make pull.ff=true override merge.ff","startedAt":"2015-05-18T13:45:40Z","lastAt":"2015-05-18T18:22:53Z","messageCount":5,"participants":["Paul Tan","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":2},"messages":[{"id":"261440","messageId":"1431956742-25992-1-git-send-email-pyokagan@gmail.com","threadId":"39355","inReplyTo":null,"subject":"[PATCH v2 0/2] make pull.ff=true override merge.ff","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2015-05-18T13:45:40Z","receivedAt":"2015-05-18T13:45:40Z","isPatch":true,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"This is a re-roll of [1], primarily to remove the use of \"verbose\".\n\nSince b814da8 (pull: add pull.ff configuration, 2014-01-15), running\ngit-pull with the configuration pull.ff=false or pull.ff=only is\nequivalent to passing --no-ff and --ff-only to git-merge. However, if\npull.ff=true, no switch is passed to git-merge. This leads to the\nconfusing behavior where pull.ff=false or pull.ff=only is able to\noverride merge.ff, while pull.ff=true is unable to.\n\nThis patch series adds a failing test to demonstrates the above, and fixes it.\n\nThe documentation is also tweaked to clarify that pull.ff is meant to override\nmerge.ff.\n\nThe last patch makes pull.ff consistent with merge.ff by supporting the config\naliases of true and false (on, off, 0, 1).\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/268972\n\nPaul Tan (2):\n  pull: make pull.ff=true override merge.ff\n  pull: parse pull.ff as a bool or string\n\n Documentation/config.txt     | 2 +-\n git-pull.sh                  | 5 ++++-\n t/t7601-merge-pull-config.sh | 8 ++++++++\n 3 files changed, 13 insertions(+), 2 deletions(-)\n\n-- \n2.1.4\n"},{"id":"261441","messageId":"1431956742-25992-2-git-send-email-pyokagan@gmail.com","threadId":"39355","inReplyTo":"1431956742-25992-1-git-send-email-pyokagan@gmail.com","subject":"[PATCH v2 1/2] pull: make pull.ff=true override merge.ff","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2015-05-18T13:45:41Z","receivedAt":"2015-05-18T13:45:41Z","isPatch":true,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"Since b814da8 (pull: add pull.ff configuration, 2014-01-15), running\ngit-pull with the configuration pull.ff=false or pull.ff=only is\nequivalent to passing --no-ff and --ff-only to git-merge. However, if\npull.ff=true, no switch is passed to git-merge. This leads to the\nconfusing behavior where pull.ff=false or pull.ff=only is able to\noverride merge.ff, while pull.ff=true is unable to.\n\nFix this by adding the --ff switch if pull.ff=true, and add a test to\ncatch future regressions.\n\nFurthermore, clarify in the documentation that pull.ff overrides\nmerge.ff.\n\nSigned-off-by: Paul Tan <pyokagan@gmail.com>\n---\n* Removed use of \"verbose\".\n\n Documentation/config.txt     | 2 +-\n git-pull.sh                  | 3 +++\n t/t7601-merge-pull-config.sh | 8 ++++++++\n 3 files changed, 12 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 948b8b0..ec0f9ef 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -2042,7 +2042,7 @@ pull.ff::\n \ta case (equivalent to giving the `--no-ff` option from the command\n \tline). When set to `only`, only such fast-forward merges are\n \tallowed (equivalent to giving the `--ff-only` option from the\n-\tcommand line).\n+\tcommand line). This setting overrides `merge.ff` when pulling.\n \n pull.rebase::\n \tWhen true, rebase branches on top of the fetched branch, instead\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 9ed01fd..e51dd37 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -56,6 +56,9 @@ fi\n # Setup default fast-forward options via `pull.ff`\n pull_ff=$(git config pull.ff)\n case \"$pull_ff\" in\n+true)\n+\tno_ff=--ff\n+\t;;\n false)\n \tno_ff=--no-ff\n \t;;\ndiff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh\nindex f768c90..c6c44ec 100755\n--- a/t/t7601-merge-pull-config.sh\n+++ b/t/t7601-merge-pull-config.sh\n@@ -45,6 +45,14 @@ test_expect_success 'fast-forward pull succeeds with \"true\" in pull.ff' '\n \ttest \"$(git rev-parse HEAD)\" = \"$(git rev-parse c1)\"\n '\n \n+test_expect_success 'pull.ff=true overrides merge.ff=false' '\n+\tgit reset --hard c0 &&\n+\ttest_config merge.ff false &&\n+\ttest_config pull.ff true &&\n+\tgit pull . c1 &&\n+\ttest \"$(git rev-parse HEAD)\" = \"$(git rev-parse c1)\"\n+'\n+\n test_expect_success 'fast-forward pull creates merge with \"false\" in pull.ff' '\n \tgit reset --hard c0 &&\n \ttest_config pull.ff false &&\n-- \n2.1.4\n"},{"id":"261442","messageId":"1431956742-25992-3-git-send-email-pyokagan@gmail.com","threadId":"39355","inReplyTo":"1431956742-25992-1-git-send-email-pyokagan@gmail.com","subject":"[PATCH v2 2/2] pull: parse pull.ff as a bool or string","fromName":"Paul Tan","fromEmail":"pyokagan@gmail.com","sentAt":"2015-05-18T13:45:42Z","receivedAt":"2015-05-18T13:45:42Z","isPatch":true,"sender":{"key":"pyokagan@gmail.com","avatar":"https://avatars.githubusercontent.com/u/109479?v=4"},"body":"Since b814da8 (pull: add pull.ff configuration, 2014-01-15) git-pull\nsupported setting --(no-)ff via the pull.ff configuration value.\nHowever, as it only matches the string values of \"true\" and \"false\", it\ndoes not support other boolean aliases such as \"on\", \"off\", \"1\", \"0\".\nThis is inconsistent with the merge.ff setting, which supports these\naliases.\n\nFix this by using the bool_or_string_config function to retrieve the\nvalue of pull.ff.\n\nSigned-off-by: Paul Tan <pyokagan@gmail.com>\n---\n\n git-pull.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex e51dd37..09bc678 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -54,7 +54,7 @@ then\n fi\n \n # Setup default fast-forward options via `pull.ff`\n-pull_ff=$(git config pull.ff)\n+pull_ff=$(bool_or_string_config pull.ff)\n case \"$pull_ff\" in\n true)\n \tno_ff=--ff\n-- \n2.1.4\n"},{"id":"261449","messageId":"b81cabf10169c5be05099addbe6e4d27@www.dscho.org","threadId":"39355","inReplyTo":"1431956742-25992-1-git-send-email-pyokagan@gmail.com","subject":"Re: [PATCH v2 0/2] make pull.ff=true override merge.ff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-05-18T14:46:04Z","receivedAt":"2015-05-18T14:46:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Paul,\n\nOn 2015-05-18 15:45, Paul Tan wrote:\n> This is a re-roll of [1], primarily to remove the use of \"verbose\".\n\nI think these two patches are good to go now.\n\nReviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n\nCiao,\nDscho\n"},{"id":"261487","messageId":"xmqq1tidd9tu.fsf@gitster.dls.corp.google.com","threadId":"39355","inReplyTo":"b81cabf10169c5be05099addbe6e4d27@www.dscho.org","subject":"Re: [PATCH v2 0/2] make pull.ff=true override merge.ff","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-18T18:22:53Z","receivedAt":"2015-05-18T18:22:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> Hi Paul,\n>\n> On 2015-05-18 15:45, Paul Tan wrote:\n>> This is a re-roll of [1], primarily to remove the use of \"verbose\".\n>\n> I think these two patches are good to go now.\n>\n> Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>\n> Ciao,\n> Dscho\n\nYeah, looks good.  Thanks, both.\n"}]}