{"thread":{"id":"18182","subject":"[PATCH 1/3] config: add git_config_option_string()","startedAt":"2009-03-06T22:15:12Z","lastAt":"2010-04-02T17:19:44Z","messageCount":15,"participants":["Jay Soffian","Junio C Hamano","jean-luc malet"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"107244","messageId":"cover.1236377358.git.jaysoffian@gmail.com","threadId":"18182","inReplyTo":null,"subject":"[PATCH 0/3] Re: how to have --no-ff be the default for all branch","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-06T22:15:12Z","receivedAt":"2009-03-06T22:15:12Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"2009/3/6 jean-luc malet <jeanluc.malet@gmail.com>:\n> I would like that it is the default for all branch and that I use --ff\n> when I want to do fast forward merge\n> I know that I can set it up for one branch\n> git config add branch.master.mergeoption --no-ff\n> but I want it to be the default no just for one branch but for all branch\n> git config add branch.*.mergeoption --no-ff\n> don't work....\n\nThis series should do it for you. It teaches merge to support\nmerge.options, which is the default for all merge operations.\n\nJay Soffian (3):\n  config: add git_config_option_string()\n  builtin-merge: refactor to use git_config_option_string\n  builtin-merge: add support for default merge options\n\n Documentation/git-merge.txt |   11 +++-\n builtin-merge.c             |   24 +++----\n cache.h                     |    2 +\n config.c                    |   39 ++++++++++++\n parse-options.c             |    2 +\n t/t7600-merge.sh            |  143 ++++++++++++++++++++++++++++++++++++-------\n 6 files changed, 182 insertions(+), 39 deletions(-)\n"},{"id":"107243","messageId":"12addb53ef5c0e62ee22847591c8e7b884dc0bd2.1236377358.git.jaysoffian@gmail.com","threadId":"18182","inReplyTo":"cover.1236377358.git.jaysoffian@gmail.com","subject":"[PATCH 1/3] config: add git_config_option_string()","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-06T22:15:13Z","receivedAt":"2009-03-06T22:15:13Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"This patch teaches config a new function, git_config_option_string(),\nwhich parses a string using parse-options.\n\nThis is useful for any command that allows command-line options to\nappear in a config.\n\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\n---\nOriginally I had just factored this into its own function in\nbuiltin-merge, but it seemed that it might be generally useful, so I\nmoved it to config.c\n\n cache.h         |    2 ++\n config.c        |   39 +++++++++++++++++++++++++++++++++++++++\n parse-options.c |    2 ++\n 3 files changed, 43 insertions(+), 0 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 189151d..c6d3f05 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -854,6 +854,8 @@ extern unsigned long git_config_ulong(const char *, const char *);\n extern int git_config_bool_or_int(const char *, const char *, int *);\n extern int git_config_bool(const char *, const char *);\n extern int git_config_string(const char **, const char *, const char *);\n+struct option;\n+extern int git_config_option_string(const struct option *, int, const char *, const char *);\n extern int git_config_set(const char *, const char *);\n extern int git_config_set_multivar(const char *, const char *, const char *, int);\n extern int git_config_rename_section(const char *, const char *);\ndiff --git a/config.c b/config.c\nindex 0c8c76f..29cfd5b 100644\n--- a/config.c\n+++ b/config.c\n@@ -7,6 +7,7 @@\n  */\n #include \"cache.h\"\n #include \"exec_cmd.h\"\n+#include \"parse-options.h\"\n \n #define MAXNAME (256)\n \n@@ -353,6 +354,44 @@ int git_config_string(const char **dest, const char *var, const char *value)\n \treturn 0;\n }\n \n+int git_config_option_string(const struct option *options, int flags,\n+\t\t\t     const char *var, const char *value)\n+{\n+\tint argc, ret;\n+\tconst char **argv;\n+\tchar *buf;\n+\tstruct parse_opt_ctx_t ctx;\n+\n+\tif (!value)\n+\t\treturn config_error_nonbool(var);\n+\n+\tbuf = xstrdup(value);\n+\tif ((argc = split_cmdline(buf, &argv)) < 0) {\n+\t\tfree(buf);\n+\t\treturn error(\"Malformed value for %s\", var);\n+\t}\n+\targv = xrealloc(argv, sizeof(*argv) * (argc + 2));\n+\tmemmove(argv + 1, argv, sizeof(*argv) * (argc + 1));\n+\targc++;\n+\n+\tparse_options_start(&ctx, argc, argv, flags);\n+\tswitch (parse_options_step(&ctx, options, NULL)) {\n+\tcase PARSE_OPT_DONE:\n+\t\tret = parse_options_end(&ctx);\n+\t\tbreak;\n+\tcase PARSE_OPT_HELP: /* not supported in a config */\n+\tdefault: /* PARSE_OPT_UNKNOWN */\n+\t\tif (ctx.argv[0][1] == '-') {\n+\t\t\tret = error(\"unknown option `%s'\", ctx.argv[0] + 2);\n+\t\t} else {\n+\t\t\tret = error(\"unknown switch `%c'\", *ctx.opt);\n+\t\t}\n+\t\tbreak;\n+\t}\n+\tfree(buf);\n+\treturn ret;\n+}\n+\n static int git_default_core_config(const char *var, const char *value)\n {\n \t/* This needs a better name */\ndiff --git a/parse-options.c b/parse-options.c\nindex 4c5d09d..7996b50 100644\n--- a/parse-options.c\n+++ b/parse-options.c\n@@ -356,6 +356,8 @@ int parse_options(int argc, const char **argv, const struct option *options,\n int usage_with_options_internal(const char * const *usagestr,\n \t\t\t\tconst struct option *opts, int full)\n {\n+\tif (!usagestr)\n+\t\treturn PARSE_OPT_HELP;\n \tfprintf(stderr, \"usage: %s\\n\", *usagestr++);\n \twhile (*usagestr && **usagestr)\n \t\tfprintf(stderr, \"   or: %s\\n\", *usagestr++);\n-- \n1.6.2.rc2.332.g5d21b\n"},{"id":"107247","messageId":"13f0016028b195541b8b5d9149292150cbb13ab7.1236377358.git.jaysoffian@gmail.com","threadId":"18182","inReplyTo":"12addb53ef5c0e62ee22847591c8e7b884dc0bd2.1236377358.git.jaysoffian@gmail.com","subject":"[PATCH 2/3] builtin-merge: refactor to use git_config_option_string","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-06T22:15:14Z","receivedAt":"2009-03-06T22:15:14Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"This patch teaches builtin-merge to use git_config_option_string() for\nparsing branch.<name>.mergeoptions\n\nAs a side-effect, setting branch.<name>.mergeoptions to \"\" is no longer\nsupported. The tests have been modified to reflect this fact, along with\nsome minor refactoring to support additional tests in the next patch.\n\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\n---\nI think the side-effect is fine, since why would anyone have an empty\nmergeoptions in their config? But if the list disagrees, it's trivial to\nmodify the preceeding patch to skip over an empty config w/o it being an\nerror.\n\nAlso, it seems like the with_config() utility function here might be\nuseful for other test scripts, so perhaps it should go into test-lib.sh?\n\n builtin-merge.c  |   14 +---------\n t/t7600-merge.sh |   74 +++++++++++++++++++++++++++++++++++++----------------\n 2 files changed, 52 insertions(+), 36 deletions(-)\n\ndiff --git a/builtin-merge.c b/builtin-merge.c\nindex 6d2160d..504f2be 100644\n--- a/builtin-merge.c\n+++ b/builtin-merge.c\n@@ -452,20 +452,8 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n \tif (branch && !prefixcmp(k, \"branch.\") &&\n \t\t!prefixcmp(k + 7, branch) &&\n \t\t!strcmp(k + 7 + strlen(branch), \".mergeoptions\")) {\n-\t\tconst char **argv;\n-\t\tint argc;\n-\t\tchar *buf;\n-\n-\t\tbuf = xstrdup(v);\n-\t\targc = split_cmdline(buf, &argv);\n-\t\tif (argc < 0)\n+\t\tif (git_config_option_string(builtin_merge_options, 0, k, v))\n \t\t\tdie(\"Bad branch.%s.mergeoptions string\", branch);\n-\t\targv = xrealloc(argv, sizeof(*argv) * (argc + 2));\n-\t\tmemmove(argv + 1, argv, sizeof(*argv) * (argc + 1));\n-\t\targc++;\n-\t\tparse_options(argc, argv, builtin_merge_options,\n-\t\t\t      builtin_merge_usage, 0);\n-\t\tfree(buf);\n \t}\n \n \tif (!strcmp(k, \"merge.diffstat\") || !strcmp(k, \"merge.stat\"))\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex e5b210b..9db8bb4 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -188,6 +188,37 @@ verify_no_mergehead() {\n \tfi\n }\n \n+with_config() {\n+\tnames_to_unset=\n+\tretval=0\n+\twhile test $# -gt 1\n+\tdo\n+\t\tif test \"$1\" = \"--\"\n+\t\tthen\n+\t\t\tshift\n+\t\t\tbreak\n+\t\tfi\n+\t\tif git config \"$1\" \"$2\"\n+\t\tthen\n+\t\t\tnames_to_unset=\"$names_to_unset $1\"\n+\t\t\tshift\n+\t\t\tshift\n+\t\telse\n+\t\t\tretval=1\n+\t\t\tbreak\n+\t\tfi\n+\tdone\n+\tif test $retval = 0\n+\tthen\n+\t\tgit \"$@\"\n+\t\tretval=$?\n+\tfi\n+\tfor name in $names_to_unset\n+\tdo\n+\t\tgit config --unset \"$name\"\n+\tdone\n+\treturn $retval\n+}\n \n test_expect_success 'setup' '\n \tgit add file &&\n@@ -327,8 +358,8 @@ test_debug 'gitk --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-\tgit merge c2 &&\n+\twith_config branch.master.mergeoptions --no-commit -- \\\n+\t\tmerge c2 &&\n \tverify_merge file result.1-5 &&\n \tverify_head $c1 &&\n \tverify_mergeheads $c2\n@@ -338,8 +369,8 @@ test_debug 'gitk --all'\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-\tgit merge c2 &&\n+\twith_config branch.master.mergeoptions --squash -- \\\n+\t\tmerge c2 &&\n \tverify_merge file result.1-5 &&\n \tverify_head $c1 &&\n \tverify_no_mergehead &&\n@@ -350,9 +381,9 @@ test_debug 'gitk --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_tick &&\n-\tgit merge --summary c2 >diffstat.txt &&\n+\twith_config branch.master.mergeoptions -n -- \\\n+\t\tmerge --summary c2 >diffstat.txt &&\n \tverify_merge file result.1-5 msg.1-5 &&\n \tverify_parents $c1 $c2 &&\n \tif ! grep \"^ file |  *2 +-$\" diffstat.txt\n@@ -364,9 +395,9 @@ 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_tick &&\n-\tgit merge --stat c2 >diffstat.txt &&\n+\twith_config branch.master.mergeoptions -n -- \\\n+\t\tmerge --stat c2 >diffstat.txt &&\n \tverify_merge file result.1-5 msg.1-5 &&\n \tverify_parents $c1 $c2 &&\n \tif ! grep \"^ file |  *2 +-$\" diffstat.txt\n@@ -380,9 +411,9 @@ test_debug 'gitk --all'\n \n test_expect_success 'override config option --stat' '\n \tgit reset --hard c1 &&\n-\tgit config branch.master.mergeoptions \"--stat\" &&\n \ttest_tick &&\n-\tgit merge -n c2 >diffstat.txt &&\n+\twith_config branch.master.mergeoptions --stat -- \\\n+\t\tmerge -n c2 >diffstat.txt &&\n \tverify_merge file result.1-5 msg.1-5 &&\n \tverify_parents $c1 $c2 &&\n \tif grep \"^ file |  *2 +-$\" diffstat.txt\n@@ -396,9 +427,9 @@ test_debug 'gitk --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_tick &&\n-\tgit merge --commit c2 &&\n+\twith_config branch.master.mergeoptions --no-commit -- \\\n+\t\tmerge --commit c2 &&\n \tverify_merge file result.1-5 msg.1-5 &&\n \tverify_parents $c1 $c2\n '\n@@ -407,9 +438,9 @@ test_debug 'gitk --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_tick &&\n-\tgit merge --no-squash c2 &&\n+\twith_config branch.master.mergeoptions --squash -- \\\n+\t\tmerge --no-squash c2 &&\n \tverify_merge file result.1-5 msg.1-5 &&\n \tverify_parents $c1 $c2\n '\n@@ -418,7 +449,6 @@ test_debug 'gitk --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@@ -434,15 +464,16 @@ test_expect_success 'combining --squash 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-\tgit merge --ff c1 &&\n+\twith_config branch.master.mergeoptions --no-ff -- \\\n+\t\tmerge --ff c1 &&\n \tverify_merge file result.1 &&\n \tverify_head $c1\n '\n \n test_expect_success 'merge log message' '\n \tgit reset --hard c0 &&\n-\tgit merge --no-log c2 &&\n+\twith_config branch.master.mergeoptions --no-ff -- \\\n+\t\tmerge --no-log c2 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\n \tverify_diff msg.nolog msg.act \"[OOPS] bad merge log message\" &&\n \n@@ -451,8 +482,8 @@ test_expect_success 'merge log message' '\n \tverify_diff msg.log msg.act \"[OOPS] bad merge log message\" &&\n \n \tgit reset --hard HEAD^ &&\n-\tgit config merge.log yes &&\n-\tgit merge c3 &&\n+\twith_config merge.log yes -- \\\n+\t\tmerge c3 &&\n \tgit show -s --pretty=format:%b HEAD >msg.act &&\n \tverify_diff msg.log msg.act \"[OOPS] bad merge log message\"\n '\n@@ -461,7 +492,6 @@ test_debug 'gitk --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@@ -472,7 +502,6 @@ test_debug 'gitk --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@@ -483,7 +512,6 @@ test_debug 'gitk --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.6.2.rc2.332.g5d21b\n"},{"id":"107245","messageId":"9f755b5bae0b02c5cb3e01680acf71fe7153be04.1236377358.git.jaysoffian@gmail.com","threadId":"18182","inReplyTo":"13f0016028b195541b8b5d9149292150cbb13ab7.1236377358.git.jaysoffian@gmail.com","subject":"[PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-06T22:15:15Z","receivedAt":"2009-03-06T22:15:15Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"This patch teaches merge a new setting, merge.options, which is\nprocessed before any of the other merge configuration settings. It may\nbe used to establish a default which can then be overridden by more\nspecific branch.<name>.mergeoptions (or, obviously, command-line\nswitches).\n\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\n---\n Documentation/git-merge.txt |   11 +++++--\n builtin-merge.c             |   10 ++++++\n t/t7600-merge.sh            |   69 +++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 87 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex f7be584..3cb06e7 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -47,10 +47,15 @@ CONFIGURATION\n -------------\n include::merge-config.txt[]\n \n+merge.options::\n+\tSets default options for merging. The syntax and supported options are\n+\tequal to that of 'git-merge'. Arguments are split by spaces, and may be\n+\tquoted in the same way as alias.* config options.\n+\n branch.<name>.mergeoptions::\n-\tSets default options for merging into branch <name>. The syntax and\n-\tsupported options are equal to that of 'git-merge', but option values\n-\tcontaining whitespace characters are currently not supported.\n+\tSets default options for merging into branch <name>. This setting is\n+\thandled after `merge.options`, so it may be used to override any\n+\tsettings appearing there. The syntax is identical to `merge.options`.\n \n HOW MERGE WORKS\n ---------------\ndiff --git a/builtin-merge.c b/builtin-merge.c\nindex 504f2be..1f124b3 100644\n--- a/builtin-merge.c\n+++ b/builtin-merge.c\n@@ -447,6 +447,15 @@ cleanup:\n \tstrbuf_release(&bname);\n }\n \n+static int git_merge_config_default(const char *k, const char *v, void *cb)\n+{\n+\tif (!strcmp(k, \"merge.options\")) {\n+\t\tif (git_config_option_string(builtin_merge_options, 0, k, v))\n+\t\t\tdie(\"Bad merge.options string\");\n+\t}\n+\treturn 0;\n+}\n+\n static int git_merge_config(const char *k, const char *v, void *cb)\n {\n \tif (branch && !prefixcmp(k, \"branch.\") &&\n@@ -838,6 +847,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \tif (is_null_sha1(head))\n \t\thead_invalid = 1;\n \n+\tgit_config(git_merge_config_default, NULL);\n \tgit_config(git_merge_config, NULL);\n \n \t/* for color.ui */\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 9db8bb4..aaecdab 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -367,6 +367,16 @@ test_expect_success 'merge c1 with c2 (no-commit in config)' '\n \n test_debug 'gitk --all'\n \n+test_expect_success 'merge c1 with c2 (no-commit in merge.options)' '\n+\tgit reset --hard c1 &&\n+\twith_config merge.options --no-commit -- merge c2 &&\n+\tverify_merge file result.1-5 &&\n+\tverify_head $c1 &&\n+\tverify_mergeheads $c2\n+'\n+\n+test_debug 'gitk --all'\n+\n test_expect_success 'merge c1 with c2 (squash in config)' '\n \tgit reset --hard c1 &&\n \twith_config branch.master.mergeoptions --squash -- \\\n@@ -379,6 +389,17 @@ test_expect_success 'merge c1 with c2 (squash in config)' '\n \n test_debug 'gitk --all'\n \n+test_expect_success 'merge c1 with c2 (squash in merge.options)' '\n+\tgit reset --hard c1 &&\n+\twith_config merge.options --squash -- merge c2 &&\n+\tverify_merge file result.1-5 &&\n+\tverify_head $c1 &&\n+\tverify_no_mergehead &&\n+\tverify_diff squash.1-5 .git/SQUASH_MSG \"[OOPS] bad squash message\"\n+'\n+\n+test_debug 'gitk --all'\n+\n test_expect_success 'override config option -n with --summary' '\n \tgit reset --hard c1 &&\n \ttest_tick &&\n@@ -425,6 +446,54 @@ test_expect_success 'override config option --stat' '\n \n test_debug 'gitk --all'\n \n+test_expect_success 'override merge.options -n with branch mergeoptions --summary' '\n+\tgit reset --hard c1 &&\n+\ttest_tick &&\n+\twith_config merge.options -n branch.master.mergeoptions --summary -- \\\n+\t\tmerge c2 >diffstat.txt &&\n+\tverify_merge file result.1-5 msg.1-5 &&\n+\tverify_parents $c1 $c2 &&\n+\tif ! grep \"^ file |  *2 +-$\" diffstat.txt\n+\tthen\n+\t\techo \"[OOPS] diffstat was not generated with --summary\"\n+\t\tfalse\n+\tfi\n+'\n+\n+test_debug 'gitk --all'\n+\n+test_expect_success 'override merge.options -n with branch mergeoptions --stat' '\n+\tgit reset --hard c1 &&\n+\ttest_tick &&\n+\twith_config merge.options -n branch.master.mergeoptions --stat -- \\\n+\t\tmerge c2 >diffstat.txt &&\n+\tverify_merge file result.1-5 msg.1-5 &&\n+\tverify_parents $c1 $c2 &&\n+\tif ! grep \"^ file |  *2 +-$\" diffstat.txt\n+\tthen\n+\t\techo \"[OOPS] diffstat was not generated with --stat\"\n+\t\tfalse\n+\tfi\n+'\n+\n+test_debug 'gitk --all'\n+\n+test_expect_success 'override merge.options --stat' '\n+\tgit reset --hard c1 &&\n+\ttest_tick &&\n+\twith_config merge.options --stat branch.master.mergeoptions -n -- \\\n+\t\tmerge c2 >diffstat.txt &&\n+\tverify_merge file result.1-5 msg.1-5 &&\n+\tverify_parents $c1 $c2 &&\n+\tif grep \"^ file |  *2 +-$\" diffstat.txt\n+\tthen\n+\t\techo \"[OOPS] diffstat was generated\"\n+\t\tfalse\n+\tfi\n+'\n+\n+test_debug 'gitk --all'\n+\n test_expect_success 'merge c1 with c2 (override --no-commit)' '\n \tgit reset --hard c1 &&\n \ttest_tick &&\n-- \n1.6.2.rc2.332.g5d21b\n"},{"id":"107250","messageId":"7vr61aqngu.fsf@gitster.siamese.dyndns.org","threadId":"18182","inReplyTo":"9f755b5bae0b02c5cb3e01680acf71fe7153be04.1236377358.git.jaysoffian@gmail.com","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-06T22:46:09Z","receivedAt":"2009-03-06T22:46:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> @@ -838,6 +847,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n>  \tif (is_null_sha1(head))\n>  \t\thead_invalid = 1;\n>  \n> +\tgit_config(git_merge_config_default, NULL);\n>  \tgit_config(git_merge_config, NULL);\n\n\nThe placement of this comes before parse_options(), just like the part\nthat slurps \"branch.*.mergeoptions\", so it can be overridden by the\ncommand line just like \"branch.*.mergeoptions\" can, which is good.\n\nWhen you are on branch \"frotz\", your config have both merge.options and\nbranch.frotz.mergeoptions, and you give some other options from the\ncommand line, how should they interact?  I'd expect the branch.*.options\nto take effect, ignoring merge.options entirely.\n\nI think the right way to structure this is to change the code in\ngit_merge_config() that accepts \"branch.*.mergeoptions\" to just store a\nxstrdup() pointer away, add a similar thing in the same function for the\nnew \"merge.options\" variable.  Get rid of your git_merge_config_default\nfunction that forces git_config() to iterate over the same config file one\nmore time.  And after the config parser returns, run the parse_options\nonly once.\n\nIn other words, the overall code structure would look like this:\n\nstatic char *options_from_config;\nstatic int options_from_config_taken_from_branch_config;\n\nstatic int git_merge_config(...)\n{\n\tif (branch && !prefixcmp(k, \"branch.\") ... ) {\n\t\t/*\n                 * We may have found merge.options first;\n\t\t * free it and override it with the value of\n                 * branch.*.mergeoptions for the current branch\n                 * we just found.\n                 */\n        \tfree(options_from_config);\n               \toptions_from_config_taken_from_branch_config = 1;\n               \toptions_from_config = xstrdup(value);\n\t\treturn 0;\n\t}\n        if (!strcmp(k, \"merge.options\")) {\n\t\t/*\n                 * Do not override branch.*.mergeoptions for the\n                 * current branch if we already found one.\n                 */\n               \tif (!options_from_config_taken_from_branch_config)\n                \toptions_from_config = xstrdup(value);\n\t\treturn 0;\n\t}\n        ...\n}\n\nint cmd_merge(...)\n{\n\t...\n        git_config(git_merge_config, NULL);\n        if (options_from_config)\n\t\t/*\n                 * There is a \"prime\" options given in\n                 * the configuration file.  Parse it.\n                 */\n                git_config_option_string(builtin_merge_options, ...,\n                \t\t\toptions_from_config);\n\t...\n        argc = parse_options(argc, argv, builtin_merge_options,...);\n\t...\n}\n\nIf for some reason you would want to have cumulative options across\nbranch.*.merge, merge.options and the command line, then you would instead\nkeep two separate strings, and call git_config_option_string() for both of\nthem, before processing the real command line options.\n\nHmm?\n"},{"id":"107253","messageId":"76718490903061516l62869424q4bd4cfa64fe2195e@mail.gmail.com","threadId":"18182","inReplyTo":"7vr61aqngu.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-06T23:16:08Z","receivedAt":"2009-03-06T23:16:08Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Fri, Mar 6, 2009 at 5:46 PM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> When you are on branch \"frotz\", your config have both merge.options and\n> branch.frotz.mergeoptions, and you give some other options from the\n> command line, how should they interact?  I'd expect the branch.*.options\n> to take effect, ignoring merge.options entirely.\n\nReally? I didn't think that would be consistent with the fact that the\nthe command line options override branch.*.options, but don't replace\nthem. So I specifically coded it such that there are three separate\nlayers all merged together. (Which is also how I documented it in the\nman page.)\n\n> If for some reason you would want to have cumulative options across\n\nWhich I do, or I wouldn't have coded it that way. :-)\n\n> branch.*.merge, merge.options and the command line, then you would instead\n> keep two separate strings, and call git_config_option_string() for both of\n> them, before processing the real command line options.\n\nAh, right that would be better.\n\nj.\n"},{"id":"107259","messageId":"1236386675-23308-1-git-send-email-jaysoffian@gmail.com","threadId":"18182","inReplyTo":"76718490903061516l62869424q4bd4cfa64fe2195e@mail.gmail.com","subject":"[PATCH v2 3/3] builtin-merge: add support for default merge options","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-07T00:44:35Z","receivedAt":"2009-03-07T00:44:35Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"This patch teaches merge a new setting, merge.options, which is\nprocessed before any of the other merge configuration settings. It may\nbe used to establish a default which can then be overridden by more\nspecific branch.<name>.mergeoptions (or, obviously, command-line\nswitches).\n\nSigned-off-by: Jay Soffian <jaysoffian@gmail.com>\n---\nOn Fri, Mar 6, 2009 at 5:46 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> If for some reason you would want to have cumulative options across\n> branch.*.merge, merge.options and the command line, then you would instead\n> keep two separate strings, and call git_config_option_string() for both of\n> them, before processing the real command line options.\n\nWhich is what this version does. I also made the explanation of this behavior\nin the man page more explicit.\n\n Documentation/git-merge.txt |   12 +++++--\n builtin-merge.c             |   22 +++++++++++--\n t/t7600-merge.sh            |   69 +++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 96 insertions(+), 7 deletions(-)\n\ndiff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt\nindex f7be584..5d80a78 100644\n--- a/Documentation/git-merge.txt\n+++ b/Documentation/git-merge.txt\n@@ -47,10 +47,16 @@ CONFIGURATION\n -------------\n include::merge-config.txt[]\n \n+merge.options::\n+\tSets default options for merging. The syntax and supported options are\n+\tequal to that of 'git-merge'. Arguments are split by spaces, and may be\n+\tquoted in the same way as alias.* config options.\n+\n branch.<name>.mergeoptions::\n-\tSets default options for merging into branch <name>. The syntax and\n-\tsupported options are equal to that of 'git-merge', but option values\n-\tcontaining whitespace characters are currently not supported.\n+\tSets default options for merging into branch <name>. This setting is\n+\thandled after and is cumulative to `merge.options`. So it may override,\n+\tbut does replace, any settings appearing there. The syntax is identical\n+\tto `merge.options`.\n \n HOW MERGE WORKS\n ---------------\ndiff --git a/builtin-merge.c b/builtin-merge.c\nindex 504f2be..d4dc4fe 100644\n--- a/builtin-merge.c\n+++ b/builtin-merge.c\n@@ -50,6 +50,8 @@ static unsigned char head[20], stash[20];\n static struct strategy **use_strategies;\n static size_t use_strategies_nr, use_strategies_alloc;\n static const char *branch;\n+static const char *branch_option_string = NULL;\n+static const char *default_option_string = NULL;\n static int verbosity;\n \n static struct strategy all_strategy[] = {\n@@ -451,10 +453,8 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n {\n \tif (branch && !prefixcmp(k, \"branch.\") &&\n \t\t!prefixcmp(k + 7, branch) &&\n-\t\t!strcmp(k + 7 + strlen(branch), \".mergeoptions\")) {\n-\t\tif (git_config_option_string(builtin_merge_options, 0, k, v))\n-\t\t\tdie(\"Bad branch.%s.mergeoptions string\", branch);\n-\t}\n+\t\t!strcmp(k + 7 + strlen(branch), \".mergeoptions\"))\n+\t\t\treturn git_config_string(&branch_option_string, k, v);\n \n \tif (!strcmp(k, \"merge.diffstat\") || !strcmp(k, \"merge.stat\"))\n \t\tshow_diffstat = git_config_bool(k, v);\n@@ -462,6 +462,8 @@ static int git_merge_config(const char *k, const char *v, void *cb)\n \t\treturn git_config_string(&pull_twohead, k, v);\n \telse if (!strcmp(k, \"pull.octopus\"))\n \t\treturn git_config_string(&pull_octopus, k, v);\n+\telse if (!strcmp(k, \"merge.options\"))\n+\t\treturn git_config_string(&default_option_string, k, v);\n \telse if (!strcmp(k, \"merge.log\") || !strcmp(k, \"merge.summary\"))\n \t\toption_log = git_config_bool(k, v);\n \treturn git_diff_ui_config(k, v, cb);\n@@ -839,6 +841,18 @@ int cmd_merge(int argc, const char **argv, const char *prefix)\n \t\thead_invalid = 1;\n \n \tgit_config(git_merge_config, NULL);\n+\tif (default_option_string) {\n+\t\tif (git_config_option_string(builtin_merge_options, 0,\n+\t\t    \"merge.options\", default_option_string))\n+\t\t\tdie(\"Bad merge.options string\");\n+\t}\n+\tif (branch_option_string) {\n+\t\tstrbuf_addf(&buf, \"branch.%s.mergeoptions\", branch);\n+\t\tif (git_config_option_string(builtin_merge_options, 0,\n+\t\t     buf.buf, branch_option_string))\n+\t\t\tdie(\"Bad %s string\", buf.buf);\n+\t\tstrbuf_reset(&buf);\n+\t}\n \n \t/* for color.ui */\n \tif (diff_use_color_default == -1)\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 9db8bb4..aaecdab 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -367,6 +367,16 @@ test_expect_success 'merge c1 with c2 (no-commit in config)' '\n \n test_debug 'gitk --all'\n \n+test_expect_success 'merge c1 with c2 (no-commit in merge.options)' '\n+\tgit reset --hard c1 &&\n+\twith_config merge.options --no-commit -- merge c2 &&\n+\tverify_merge file result.1-5 &&\n+\tverify_head $c1 &&\n+\tverify_mergeheads $c2\n+'\n+\n+test_debug 'gitk --all'\n+\n test_expect_success 'merge c1 with c2 (squash in config)' '\n \tgit reset --hard c1 &&\n \twith_config branch.master.mergeoptions --squash -- \\\n@@ -379,6 +389,17 @@ test_expect_success 'merge c1 with c2 (squash in config)' '\n \n test_debug 'gitk --all'\n \n+test_expect_success 'merge c1 with c2 (squash in merge.options)' '\n+\tgit reset --hard c1 &&\n+\twith_config merge.options --squash -- merge c2 &&\n+\tverify_merge file result.1-5 &&\n+\tverify_head $c1 &&\n+\tverify_no_mergehead &&\n+\tverify_diff squash.1-5 .git/SQUASH_MSG \"[OOPS] bad squash message\"\n+'\n+\n+test_debug 'gitk --all'\n+\n test_expect_success 'override config option -n with --summary' '\n \tgit reset --hard c1 &&\n \ttest_tick &&\n@@ -425,6 +446,54 @@ test_expect_success 'override config option --stat' '\n \n test_debug 'gitk --all'\n \n+test_expect_success 'override merge.options -n with branch mergeoptions --summary' '\n+\tgit reset --hard c1 &&\n+\ttest_tick &&\n+\twith_config merge.options -n branch.master.mergeoptions --summary -- \\\n+\t\tmerge c2 >diffstat.txt &&\n+\tverify_merge file result.1-5 msg.1-5 &&\n+\tverify_parents $c1 $c2 &&\n+\tif ! grep \"^ file |  *2 +-$\" diffstat.txt\n+\tthen\n+\t\techo \"[OOPS] diffstat was not generated with --summary\"\n+\t\tfalse\n+\tfi\n+'\n+\n+test_debug 'gitk --all'\n+\n+test_expect_success 'override merge.options -n with branch mergeoptions --stat' '\n+\tgit reset --hard c1 &&\n+\ttest_tick &&\n+\twith_config merge.options -n branch.master.mergeoptions --stat -- \\\n+\t\tmerge c2 >diffstat.txt &&\n+\tverify_merge file result.1-5 msg.1-5 &&\n+\tverify_parents $c1 $c2 &&\n+\tif ! grep \"^ file |  *2 +-$\" diffstat.txt\n+\tthen\n+\t\techo \"[OOPS] diffstat was not generated with --stat\"\n+\t\tfalse\n+\tfi\n+'\n+\n+test_debug 'gitk --all'\n+\n+test_expect_success 'override merge.options --stat' '\n+\tgit reset --hard c1 &&\n+\ttest_tick &&\n+\twith_config merge.options --stat branch.master.mergeoptions -n -- \\\n+\t\tmerge c2 >diffstat.txt &&\n+\tverify_merge file result.1-5 msg.1-5 &&\n+\tverify_parents $c1 $c2 &&\n+\tif grep \"^ file |  *2 +-$\" diffstat.txt\n+\tthen\n+\t\techo \"[OOPS] diffstat was generated\"\n+\t\tfalse\n+\tfi\n+'\n+\n+test_debug 'gitk --all'\n+\n test_expect_success 'merge c1 with c2 (override --no-commit)' '\n \tgit reset --hard c1 &&\n \ttest_tick &&\n-- \n1.6.2.rc2.332.g5d21b\n"},{"id":"107261","messageId":"7v63imqhcz.fsf@gitster.siamese.dyndns.org","threadId":"18182","inReplyTo":"76718490903061516l62869424q4bd4cfa64fe2195e@mail.gmail.com","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-07T00:58:04Z","receivedAt":"2009-03-07T00:58:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> On Fri, Mar 6, 2009 at 5:46 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>> When you are on branch \"frotz\", your config have both merge.options and\n>> branch.frotz.mergeoptions, and you give some other options from the\n>> command line, how should they interact?  I'd expect the branch.*.options\n>> to take effect, ignoring merge.options entirely.\n>\n> Really? I didn't think that would be consistent with the fact that the\n> the command line options override branch.*.options, but don't replace\n> them.\n\nI think cumulative option in configuration is bad in practice, but I'll\nexplain why after talking about something else.\n\nI think it would be much better if you did not introduce a new\nconfiguration merge.options which is not consistent with everything else\nto begin with.\n\nInstead, if your addition was literally to allow saying things like this,\nit would be much easier to understand.\n\n\t[branch \"*\"]\n        \tmergeoptions = ...\n                remote = origin\n                rebase = true\n\t[branch \"frotz\"]\n        \tmergeoptions = ; nothing\n                rebase = false\n\t[branch \"nitfol\"]\n        \tremote = xyzzy\n\nWhen on branch 'nitfol', because there is an overriding \"remote\" defined,\nwe would not look at branch.*.remote and fetch from xyzzy instead of\nfetching from the default origin.  Because there is no \"rebase\" defined\nfor that branch, we would use branch.*.rebase=true from the fall-back\ndefault.\n\nWhen on branch 'frotz', because you have an explicit mergeoptions that\nsays \"I do not want any\", it would override whatever is defined for the\ncorresponding fall-back default branch.*.mergeoptions.\n\nHaving explained that I think branch.*.mergeoptions is syntactically nicer\nand more extensible as the UI to the end user, let's discuss the\n\"cumulative\" aspect.  In the following, I'll keep using branch.*.$option,\nbut you can read it as if I said merge.options and the discussion is the\nsame.\n\nThere are two reasons why you as an end user specify a concrete value\n(e.g. \"empty\") for a concrete branch name (e.g. branch.frotz.mergeoptions).\nOne is because you know the current value set to the fall-back default\n(e.g. branch.*.mergeoptions) is not suitable for this particular branch.\nAnother is because you know you may want to change the fall-back default\nsometime in the future, and you do not want that to affect your setting\nyou are making for this particular branch today.\n\nFor the purpose of the first reason above, if you allowed cumulative\noption, the end user needs to inspect branch.*.$option and come up with a\ncountermanding set of options to set to branch.frotz.$option.  If there is\nno cumulative option, the end user does not have to worry about what\nbranch.*.$option says.  Non-cumulative is simply easier to understand.\n\nFor the purpose of the second reason above, when the user has to update\nbranch.frotz.$option because some external situation changed (e.g. the\nuser used to be an e-mail contributor, but now gained \"push privilege\";\nthe user became the primary maintainer; etc.), the same argument on\nmaintenance burden as above holds.  To update branch.*.$option, you need\nto inspect every branch.$specific.$option (or lack thereof) as well in\neither way.\n\nSo overall, cumulative configuration tend to be more cumbersome for the\nend user to manage.\n\nYou cannot draw a direct analogy with the command line options, which is\nused as a single-shot override by nature.  The user knows what usually\nhappens when he says \"git pull\" while on branch 'frotz' without options,\nand countermanding specific aspects (but not necessarily others) of the\noperation for this single invocation.  Because the configuration values\nare set so that the user can set-and-forget the exact syntax to invoke\neach feature, cumulativeness between configured default and command line\noverride makes more sense.\n"},{"id":"107263","messageId":"76718490903061756g4ca88c21h8bf786048d4ad05@mail.gmail.com","threadId":"18182","inReplyTo":"7v63imqhcz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-07T01:56:21Z","receivedAt":"2009-03-07T01:56:21Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Fri, Mar 6, 2009 at 7:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> I think it would be much better if you did not introduce a new\n> configuration merge.options which is not consistent with everything else\n> to begin with.\n>\n> Instead, if your addition was literally to allow saying things like this,\n> it would be much easier to understand.\n>\n>        [branch \"*\"]\n>                mergeoptions = ...\n>                remote = origin\n>                rebase = true\n\nOkay. That's probably a more invasive patch, because a lot more code\npaths look at [branch ...], but I'll look into it.\n\n> So overall, cumulative configuration tend to be more cumbersome for the\n> end user to manage.\n\nOkay, you've convinced me.\n\nj.\n"},{"id":"107277","messageId":"7vzlfxpzqq.fsf@gitster.siamese.dyndns.org","threadId":"18182","inReplyTo":"76718490903061756g4ca88c21h8bf786048d4ad05@mail.gmail.com","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-07T07:18:37Z","receivedAt":"2009-03-07T07:18:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jay Soffian <jaysoffian@gmail.com> writes:\n\n> On Fri, Mar 6, 2009 at 7:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> I think it would be much better if you did not introduce a new\n>> configuration merge.options which is not consistent with everything else\n>> to begin with.\n>>\n>> Instead, if your addition was literally to allow saying things like this,\n>> it would be much easier to understand.\n>>\n>>        [branch \"*\"]\n>>                mergeoptions = ...\n>>                remote = origin\n>>                rebase = true\n>\n> Okay. That's probably a more invasive patch, because a lot more code\n> paths look at [branch ...], but I'll look into it.\n\nNote that you do not have to cover branch.*.remote and other things in the\nsame patch.  The first one could just handle branch.*.mergeoptions and you\ncan let later patches to implement the fallbacks for other variables.\n"},{"id":"107300","messageId":"76718490903070548u4545ec12me4698fef0df6c7b0@mail.gmail.com","threadId":"18182","inReplyTo":"7vzlfxpzqq.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2009-03-07T13:48:37Z","receivedAt":"2009-03-07T13:48:37Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Sat, Mar 7, 2009 at 2:18 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Note that you do not have to cover branch.*.remote and other things in the\n> same patch.  The first one could just handle branch.*.mergeoptions and you\n> can let later patches to implement the fallbacks for other variables.\n\nOh, indeed, but I think I do need to provide all the patches at once.\nOtherwise it will just be very confusing and I anticipate a user\nasking \"how come I can use branch.*.mergeoptions, but none of the\nother branch.*.foo settings work?\"\n\nAnd to be honest, that concern extends beyond branch.*. \"How come git\nfoo allows defaults, but git bar does not?\" seems like a valid\nquestion, and while \"because no one implemented defaults for foo and\nbar\" is a valid answer, it isn't a very satisfying one (to me).\n\nThis thread is what inspired me to start the \"what's so evil about\noverriding builtins with aliases\" thread (please don't address that\nhere, I got it from the other thread). But I still wonder if we should\nprovide defaults consistently instead of piecemeal. For example:\n\n[defaults]\n   merge = --no-ff\n\nBut I suppose that will be objected to as confusing/complicated/likely\nto have side-effects.\n\nj.\n"},{"id":"107326","messageId":"1de9d39c0903071131pdb2b125hce7c49642843c9f8@mail.gmail.com","threadId":"18182","inReplyTo":"7vzlfxpzqq.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"jean-luc malet","fromEmail":"jeanluc.malet@gmail.com","sentAt":"2009-03-07T19:31:45Z","receivedAt":"2009-03-07T19:31:45Z","isPatch":true,"sender":{"key":"jeanluc.malet@gmail.com","avatar":null},"body":"as a user,\n1) I looked how to override defaults, since merge seems to use --ff as\ndefault, I looked if there was any global config to override that.\nnothing found... so go back to google\n2) I found on the web that we can set it using\nbranch.branchname.mergeoptions so I said \"what if I use a branch named\n*, the config file was correct and git didn't insult me so.... but not\nthe expected result...\n\nsince the commands have allready defaults builtin, why not storing\nthoses defaults in the config file? like this it's easier to update\nthem or change the way git behave....\nJLM\n\nOn Sat, Mar 7, 2009 at 8:18 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Jay Soffian <jaysoffian@gmail.com> writes:\n>\n>> On Fri, Mar 6, 2009 at 7:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> I think it would be much better if you did not introduce a new\n>>> configuration merge.options which is not consistent with everything else\n>>> to begin with.\n>>>\n>>> Instead, if your addition was literally to allow saying things like this,\n>>> it would be much easier to understand.\n>>>\n>>>        [branch \"*\"]\n>>>                mergeoptions = ...\n>>>                remote = origin\n>>>                rebase = true\n>>\n>> Okay. That's probably a more invasive patch, because a lot more code\n>> paths look at [branch ...], but I'll look into it.\n>\n> Note that you do not have to cover branch.*.remote and other things in the\n> same patch.  The first one could just handle branch.*.mergeoptions and you\n> can let later patches to implement the fallbacks for other variables.\n>\n>\n\n\n\n-- \nKISS! (Keep It Simple, Stupid!)\n(garde le simple, imbécile!)\n\"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\nsimples et qui marchent, espèce d'imbécile!\"\n-----------------------------\n\"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\nessayez donc de dormir avec un moustique dans votre chambre.\" Betty\nReese\nhttp://www.grainesdechangement.com/citations.htm\n"},{"id":"137223","messageId":"1de9d39c1003190719q10b2f019u3d4f148b9feb587d@mail.gmail.com","threadId":"18182","inReplyTo":"1de9d39c0903071131pdb2b125hce7c49642843c9f8@mail.gmail.com","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"jean-luc malet","fromEmail":"jeanluc.malet@gmail.com","sentAt":"2010-03-19T14:19:51Z","receivedAt":"2010-03-19T14:19:51Z","isPatch":true,"sender":{"key":"jeanluc.malet@gmail.com","avatar":null},"body":"Hi!\nI would like to know the status about this patch...\nI think this is a useful feature to have a default configuration\nsettable for all branch.<name>.* options\nthanks and regards\nJLM\n\nOn Sat, Mar 7, 2009 at 8:31 PM, jean-luc malet <jeanluc.malet@gmail.com> wrote:\n> as a user,\n> 1) I looked how to override defaults, since merge seems to use --ff as\n> default, I looked if there was any global config to override that.\n> nothing found... so go back to google\n> 2) I found on the web that we can set it using\n> branch.branchname.mergeoptions so I said \"what if I use a branch named\n> *, the config file was correct and git didn't insult me so.... but not\n> the expected result...\n>\n> since the commands have allready defaults builtin, why not storing\n> thoses defaults in the config file? like this it's easier to update\n> them or change the way git behave....\n> JLM\n>\n> On Sat, Mar 7, 2009 at 8:18 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Jay Soffian <jaysoffian@gmail.com> writes:\n>>\n>>> On Fri, Mar 6, 2009 at 7:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>>> I think it would be much better if you did not introduce a new\n>>>> configuration merge.options which is not consistent with everything else\n>>>> to begin with.\n>>>>\n>>>> Instead, if your addition was literally to allow saying things like this,\n>>>> it would be much easier to understand.\n>>>>\n>>>>        [branch \"*\"]\n>>>>                mergeoptions = ...\n>>>>                remote = origin\n>>>>                rebase = true\n>>>\n>>> Okay. That's probably a more invasive patch, because a lot more code\n>>> paths look at [branch ...], but I'll look into it.\n>>\n>> Note that you do not have to cover branch.*.remote and other things in the\n>> same patch.  The first one could just handle branch.*.mergeoptions and you\n>> can let later patches to implement the fallbacks for other variables.\n>>\n>>\n>\n>\n>\n> --\n> KISS! (Keep It Simple, Stupid!)\n> (garde le simple, imbécile!)\n> \"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\n> simples et qui marchent, espèce d'imbécile!\"\n> -----------------------------\n> \"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\n> essayez donc de dormir avec un moustique dans votre chambre.\" Betty\n> Reese\n> http://www.grainesdechangement.com/citations.htm\n>\n\n\n\n-- \nKISS! (Keep It Simple, Stupid!)\n(garde le simple, imbécile!)\n\"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\nsimples et qui marchent, espèce d'imbécile!\"\n-----------------------------\n\"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\nessayez donc de dormir avec un moustique dans votre chambre.\" Betty\nReese\nhttp://www.grainesdechangement.com/citations.htm\n"},{"id":"137229","messageId":"76718491003190754l217e1247t16b7f1b9f39c6182@mail.gmail.com","threadId":"18182","inReplyTo":"1de9d39c1003190719q10b2f019u3d4f148b9feb587d@mail.gmail.com","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"Jay Soffian","fromEmail":"jaysoffian@gmail.com","sentAt":"2010-03-19T14:54:46Z","receivedAt":"2010-03-19T14:54:46Z","isPatch":true,"sender":{"key":"jaysoffian@gmail.com","avatar":"https://avatars.githubusercontent.com/u/155970?v=4"},"body":"On Fri, Mar 19, 2010 at 10:19 AM, jean-luc malet\n<jeanluc.malet@gmail.com> wrote:\n> Hi!\n> I would like to know the status about this patch...\n> I think this is a useful feature to have a default configuration\n> settable for all branch.<name>.* options\n> thanks and regards\n\nI lost interest in it apparently. I see it's still marked in my TODO,\nbut I haven't had any personal time to spend on git lately.\n\nj.\n\n> On Sat, Mar 7, 2009 at 8:31 PM, jean-luc malet <jeanluc.malet@gmail.com> wrote:\n>> as a user,\n>> 1) I looked how to override defaults, since merge seems to use --ff as\n>> default, I looked if there was any global config to override that.\n>> nothing found... so go back to google\n>> 2) I found on the web that we can set it using\n>> branch.branchname.mergeoptions so I said \"what if I use a branch named\n>> *, the config file was correct and git didn't insult me so.... but not\n>> the expected result...\n>>\n>> since the commands have allready defaults builtin, why not storing\n>> thoses defaults in the config file? like this it's easier to update\n>> them or change the way git behave....\n>> JLM\n>>\n>> On Sat, Mar 7, 2009 at 8:18 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Jay Soffian <jaysoffian@gmail.com> writes:\n>>>\n>>>> On Fri, Mar 6, 2009 at 7:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>>>> I think it would be much better if you did not introduce a new\n>>>>> configuration merge.options which is not consistent with everything else\n>>>>> to begin with.\n>>>>>\n>>>>> Instead, if your addition was literally to allow saying things like this,\n>>>>> it would be much easier to understand.\n>>>>>\n>>>>>        [branch \"*\"]\n>>>>>                mergeoptions = ...\n>>>>>                remote = origin\n>>>>>                rebase = true\n>>>>\n>>>> Okay. That's probably a more invasive patch, because a lot more code\n>>>> paths look at [branch ...], but I'll look into it.\n>>>\n>>> Note that you do not have to cover branch.*.remote and other things in the\n>>> same patch.  The first one could just handle branch.*.mergeoptions and you\n>>> can let later patches to implement the fallbacks for other variables.\n>>>\n>>>\n>>\n>>\n>>\n>> --\n>> KISS! (Keep It Simple, Stupid!)\n>> (garde le simple, imbécile!)\n>> \"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\n>> simples et qui marchent, espèce d'imbécile!\"\n>> -----------------------------\n>> \"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\n>> essayez donc de dormir avec un moustique dans votre chambre.\" Betty\n>> Reese\n>> http://www.grainesdechangement.com/citations.htm\n>>\n>\n>\n>\n> --\n> KISS! (Keep It Simple, Stupid!)\n> (garde le simple, imbécile!)\n> \"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\n> simples et qui marchent, espèce d'imbécile!\"\n> -----------------------------\n> \"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\n> essayez donc de dormir avec un moustique dans votre chambre.\" Betty\n> Reese\n> http://www.grainesdechangement.com/citations.htm\n>\n"},{"id":"138439","messageId":"h2m1de9d39c1004021019sd8e8bf79ide3f0516353c069c@mail.gmail.com","threadId":"18182","inReplyTo":"76718491003190754l217e1247t16b7f1b9f39c6182@mail.gmail.com","subject":"Re: [PATCH 3/3] builtin-merge: add support for default merge options","fromName":"jean-luc malet","fromEmail":"jeanluc.malet@gmail.com","sentAt":"2010-04-02T17:19:44Z","receivedAt":"2010-04-02T17:19:44Z","isPatch":true,"sender":{"key":"jeanluc.malet@gmail.com","avatar":null},"body":"Is there someone that can review this patch and maybe include it into\nnext GIT release?\nI think it is really usefull especially when used in company\nenvironment where default policies have to be set\nthanks and regards\nJLM\n\nOn Fri, Mar 19, 2010 at 3:54 PM, Jay Soffian <jaysoffian@gmail.com> wrote:\n> On Fri, Mar 19, 2010 at 10:19 AM, jean-luc malet\n> <jeanluc.malet@gmail.com> wrote:\n>> Hi!\n>> I would like to know the status about this patch...\n>> I think this is a useful feature to have a default configuration\n>> settable for all branch.<name>.* options\n>> thanks and regards\n>\n> I lost interest in it apparently. I see it's still marked in my TODO,\n> but I haven't had any personal time to spend on git lately.\n>\n> j.\n>\n>> On Sat, Mar 7, 2009 at 8:31 PM, jean-luc malet <jeanluc.malet@gmail.com> wrote:\n>>> as a user,\n>>> 1) I looked how to override defaults, since merge seems to use --ff as\n>>> default, I looked if there was any global config to override that.\n>>> nothing found... so go back to google\n>>> 2) I found on the web that we can set it using\n>>> branch.branchname.mergeoptions so I said \"what if I use a branch named\n>>> *, the config file was correct and git didn't insult me so.... but not\n>>> the expected result...\n>>>\n>>> since the commands have allready defaults builtin, why not storing\n>>> thoses defaults in the config file? like this it's easier to update\n>>> them or change the way git behave....\n>>> JLM\n>>>\n>>> On Sat, Mar 7, 2009 at 8:18 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>>>> Jay Soffian <jaysoffian@gmail.com> writes:\n>>>>\n>>>>> On Fri, Mar 6, 2009 at 7:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>>>>> I think it would be much better if you did not introduce a new\n>>>>>> configuration merge.options which is not consistent with everything else\n>>>>>> to begin with.\n>>>>>>\n>>>>>> Instead, if your addition was literally to allow saying things like this,\n>>>>>> it would be much easier to understand.\n>>>>>>\n>>>>>>        [branch \"*\"]\n>>>>>>                mergeoptions = ...\n>>>>>>                remote = origin\n>>>>>>                rebase = true\n>>>>>\n>>>>> Okay. That's probably a more invasive patch, because a lot more code\n>>>>> paths look at [branch ...], but I'll look into it.\n>>>>\n>>>> Note that you do not have to cover branch.*.remote and other things in the\n>>>> same patch.  The first one could just handle branch.*.mergeoptions and you\n>>>> can let later patches to implement the fallbacks for other variables.\n>>>>\n>>>>\n>>>\n>>>\n>>>\n>>> --\n>>> KISS! (Keep It Simple, Stupid!)\n>>> (garde le simple, imbécile!)\n>>> \"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\n>>> simples et qui marchent, espèce d'imbécile!\"\n>>> -----------------------------\n>>> \"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\n>>> essayez donc de dormir avec un moustique dans votre chambre.\" Betty\n>>> Reese\n>>> http://www.grainesdechangement.com/citations.htm\n>>>\n>>\n>>\n>>\n>> --\n>> KISS! (Keep It Simple, Stupid!)\n>> (garde le simple, imbécile!)\n>> \"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\n>> simples et qui marchent, espèce d'imbécile!\"\n>> -----------------------------\n>> \"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\n>> essayez donc de dormir avec un moustique dans votre chambre.\" Betty\n>> Reese\n>> http://www.grainesdechangement.com/citations.htm\n>>\n>\n\n\n\n-- \nKISS! (Keep It Simple, Stupid!)\n(garde le simple, imbécile!)\n\"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses\nsimples et qui marchent, espèce d'imbécile!\"\n-----------------------------\n\"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,\nessayez donc de dormir avec un moustique dans votre chambre.\" Betty\nReese\nhttp://www.grainesdechangement.com/citations.htm\n"}]}