{"thread":{"id":"22746","subject":"[PATCH] merge: --no-ff configuration setting","startedAt":"2010-02-22T02:59:15Z","lastAt":"2010-02-23T06:32:10Z","messageCount":3,"participants":["Bryan Alves","Stephen Boyd","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"135202","messageId":"1266807555-86199-1-git-send-email-bryanalves@gmail.com","threadId":"22746","inReplyTo":null,"subject":"[PATCH] merge: --no-ff configuration setting","fromName":"Bryan Alves","fromEmail":"bryanalves@gmail.com","sentAt":"2010-02-22T02:59:15Z","receivedAt":"2010-02-22T02:59:15Z","isPatch":true,"sender":{"key":"bryanalves@gmail.com","avatar":null},"body":"Add a new configuration option, merge.allowfastforward\n\nWhen set to false, causes --no-ff to be the default behavior\nfor merges. When set to true, or not present, the default\nbehavior is unchanged, and acts like --ff is set.\n\nSigned-off-by: Bryan Alves <bryanalves@gmail.com>\n---\n Documentation/merge-options.txt |    4 +++-\n builtin-merge.c                 |    3 +++\n 2 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt\nindex 3b83dba..6638af7 100644\n--- a/Documentation/merge-options.txt\n+++ b/Documentation/merge-options.txt\n@@ -14,7 +14,9 @@ inspect and further tweak the merge result before committing.\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+resolved as a fast-forward.  --no-ff can be made the\n+default behavior with the configuration option\n+merge.allowfastforward\n \n --log::\n --no-log::\ndiff --git a/builtin-merge.c b/builtin-merge.c\nindex 3aaec7b..a96aaac 100644\n--- a/builtin-merge.c\n+++ b/builtin-merge.c\n@@ -495,6 +495,9 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n \t\tfree(buf);\n \t}\n \n+\tif (!strcmp(k, \"merge.allowfastforward\"))\n+\t\tallow_fast_forward = !git_config_bool(k, v);\n+\n \tif (!strcmp(k, \"merge.diffstat\") || !strcmp(k, \"merge.stat\"))\n \t\tshow_diffstat = git_config_bool(k, v);\n \telse if (!strcmp(k, \"pull.twohead\"))\n-- \n1.6.6.1\n"},{"id":"135395","messageId":"4B836DCE.7010606@gmail.com","threadId":"22746","inReplyTo":"1266807555-86199-1-git-send-email-bryanalves@gmail.com","subject":"Re: [PATCH] merge: --no-ff configuration setting","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-02-23T05:55:26Z","receivedAt":"2010-02-23T05:55:26Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On 02/21/2010 06:59 PM, Bryan Alves wrote:\n> Add a new configuration option, merge.allowfastforward\n>\n> When set to false, causes --no-ff to be the default behavior\n> for merges. When set to true, or not present, the default\n> behavior is unchanged, and acts like --ff is set.\n\nThe subject says --no-ff configuration but the option is for --ff.\nSounds confusing. In other words, shouldn't it be\nmerge.disallowfastforward or merge.nofastforward? Or maybe the subject\nshould be \"merge: --ff configuration setting\"\n\nAlso could you just use branch.<name>.mergeoptions and not introduce yet\nanother config option? Or maybe there's some reasoning why you always\nwant to have merge commits in your workflow?\n\nFinally if this goes in please add a description to Documentation/config.txt\n"},{"id":"135396","messageId":"7vljekbgyd.fsf@alter.siamese.dyndns.org","threadId":"22746","inReplyTo":"1266807555-86199-1-git-send-email-bryanalves@gmail.com","subject":"Re: [PATCH] merge: --no-ff configuration setting","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-23T06:32:10Z","receivedAt":"2010-02-23T06:32:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bryan Alves <bryanalves@gmail.com> writes:\n\n>  Documentation/merge-options.txt |    4 +++-\n>  builtin-merge.c                 |    3 +++\n\nThis needs tests to make sure that existing programs that internally use\n\"git merge\" (e.g. \"rebase -m\", \"rebase -i\") do not break when the end user\nhas this configuration set in the repository, in addition to that \"merge\"\nworks as expected with and without this configuration variable, with\ncombinations with the use of relevant command line options.\n"}]}