{"thread":{"id":"35902","subject":"[PATCH] revert.c: Allow to specify -x via git-config","startedAt":"2014-02-18T06:56:20Z","lastAt":"2014-02-19T19:57:37Z","messageCount":10,"participants":["Guido Günther","John Keeping","Jonathan Nieder","brian m. carlson","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"234940","messageId":"20140218065620.GA3448@bogon.m.sigxcpu.org","threadId":"35902","inReplyTo":null,"subject":"[PATCH] revert.c: Allow to specify -x via git-config","fromName":"Guido Günther","fromEmail":"agx@sigxcpu.org","sentAt":"2014-02-18T06:56:20Z","receivedAt":"2014-02-18T06:56:20Z","isPatch":true,"sender":{"key":"agx@sigxcpu.org","avatar":"https://gravatar.com/avatar/2db348f1d0d0888423e5699c53ef899d81fc16e81d0aeddda0a1971ff1b2f7ec?d=mp&s=160"},"body":"Without this when maintaining stable branches it's easy to forget to use\n-x to track where a patch was cherry-picked from.\n\nSigned-off-by: Guido Günther <agx@sigxcpu.org>\n---\n Documentation/git-cherry-pick.txt |  8 ++++++++\n builtin/revert.c                  | 10 ++++++++++\n 2 files changed, 18 insertions(+)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex c205d23..c35064f 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -215,6 +215,14 @@ the working tree.\n spending extra time to avoid mistakes based on incorrectly matching\n context lines.\n \n+CONFIGURATION\n+-------------\n+\n+See linkgit:git-config[1] for core variables.\n+\n+cherrypick.record-origin::\n+\tDefault for the `-x` option. Defaults to `false`.\n+\n SEE ALSO\n --------\n linkgit:git-revert[1]\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 87659c9..df9718f 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -196,6 +196,15 @@ int cmd_revert(int argc, const char **argv, const char *prefix)\n \treturn res;\n }\n \n+static int git_cherry_pick_config(const char *var, const char *value, void *cb)\n+{\n+\tstruct replay_opts *opts = cb;\n+\n+\tif (!strcmp(var, \"cherrypick.record-origin\"))\n+\t\topts->record_origin = git_config_bool (var, value);\n+\treturn 0;\n+}\n+\n int cmd_cherry_pick(int argc, const char **argv, const char *prefix)\n {\n \tstruct replay_opts opts;\n@@ -204,6 +213,7 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)\n \tmemset(&opts, 0, sizeof(opts));\n \topts.action = REPLAY_PICK;\n \tgit_config(git_default_config, NULL);\n+\tgit_config(git_cherry_pick_config, &opts);\n \tparse_args(argc, argv, &opts);\n \tres = sequencer_pick_revisions(&opts);\n \tif (res < 0)\n-- \n1.9.0.rc3\n"},{"id":"234953","messageId":"20140218091121.GA1048@serenity.lan","threadId":"35902","inReplyTo":"20140218065620.GA3448@bogon.m.sigxcpu.org","subject":"Re: [PATCH] revert.c: Allow to specify -x via git-config","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2014-02-18T09:11:21Z","receivedAt":"2014-02-18T09:11:21Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Tue, Feb 18, 2014 at 07:56:20AM +0100, Guido Günther wrote:\n> Without this when maintaining stable branches it's easy to forget to use\n> -x to track where a patch was cherry-picked from.\n> \n> Signed-off-by: Guido Günther <agx@sigxcpu.org>\n> ---\n>  Documentation/git-cherry-pick.txt |  8 ++++++++\n>  builtin/revert.c                  | 10 ++++++++++\n>  2 files changed, 18 insertions(+)\n> \n> diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\n> index c205d23..c35064f 100644\n> --- a/Documentation/git-cherry-pick.txt\n> +++ b/Documentation/git-cherry-pick.txt\n> @@ -215,6 +215,14 @@ the working tree.\n>  spending extra time to avoid mistakes based on incorrectly matching\n>  context lines.\n>  \n> +CONFIGURATION\n> +-------------\n> +\n> +See linkgit:git-config[1] for core variables.\n> +\n> +cherrypick.record-origin::\n\nFor consistency, this should be \"cherrypick.recordOrigin\", although I\nwonder if we should permit \"cherry-pick\" here so as to keep the config\nsection the same as the name of the command.\n\nI think this should also be added to git-config(1)\n\n> +\tDefault for the `-x` option. Defaults to `false`.\n> +\n>  SEE ALSO\n>  --------\n>  linkgit:git-revert[1]\n> diff --git a/builtin/revert.c b/builtin/revert.c\n> index 87659c9..df9718f 100644\n> --- a/builtin/revert.c\n> +++ b/builtin/revert.c\n> @@ -196,6 +196,15 @@ int cmd_revert(int argc, const char **argv, const char *prefix)\n>  \treturn res;\n>  }\n>  \n> +static int git_cherry_pick_config(const char *var, const char *value, void *cb)\n> +{\n> +\tstruct replay_opts *opts = cb;\n> +\n> +\tif (!strcmp(var, \"cherrypick.record-origin\"))\n> +\t\topts->record_origin = git_config_bool (var, value);\n> +\treturn 0;\n\nIf you change this to:\n\n    return git_default_config(var, value, cb);\n\nthen the code below won't end up walking the config twice.\n\n> +}\n> +\n>  int cmd_cherry_pick(int argc, const char **argv, const char *prefix)\n>  {\n>  \tstruct replay_opts opts;\n> @@ -204,6 +213,7 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)\n>  \tmemset(&opts, 0, sizeof(opts));\n>  \topts.action = REPLAY_PICK;\n>  \tgit_config(git_default_config, NULL);\n> +\tgit_config(git_cherry_pick_config, &opts);\n>  \tparse_args(argc, argv, &opts);\n>  \tres = sequencer_pick_revisions(&opts);\n>  \tif (res < 0)\n"},{"id":"234996","messageId":"20140218174913.GB7855@google.com","threadId":"35902","inReplyTo":"20140218065620.GA3448@bogon.m.sigxcpu.org","subject":"Re: [PATCH] revert.c: Allow to specify -x via git-config","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-02-18T17:49:13Z","receivedAt":"2014-02-18T17:49:13Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nGuido Günther wrote:\n\n> Without this when maintaining stable branches it's easy to forget to use\n> -x to track where a patch was cherry-picked from.\n[...]\n> --- a/Documentation/git-cherry-pick.txt\n> +++ b/Documentation/git-cherry-pick.txt\n> @@ -215,6 +215,14 @@ the working tree.\n>  spending extra time to avoid mistakes based on incorrectly matching\n>  context lines.\n>  \n> +CONFIGURATION\n> +-------------\n> +\n> +See linkgit:git-config[1] for core variables.\n> +\n> +cherrypick.record-origin::\n> +\tDefault for the `-x` option. Defaults to `false`.\n\nI'm not convinced this is a good idea.  Even if I always want -x when\ncherry-picking to stable, isn't this going to add the extra clutter\nline when I cherry-pick on other branches?  It's especially worrying\nbecause there would be no way to override the configuration with a\nflag on the command line.  (\"-r\" which used to do that is now a\nno-op.)\n\nI would be more easily convinced by a '[branch \"foo\"]\nrecordcherrypickorigins' option that makes cherry-pick default to '-x'\nwhen and only when on the \"foo\" branch.\n\nCan you say more about the context?  Why is it important to record the\noriginal commit id?  Is it a matter of keeping a reminder of the\ncommits' similarity (which cherry-pick without '-x' does ok by reusing\nthe same message) or are people reviewing the change downstream going\nto be judging the change based on the recorded upstream commit id?\n(Like linux's stable-<version> branches --- but those have other\nrequirements so I don't think this configuration would work as is\nthere.)\n\n[...]\n> +++ b/builtin/revert.c\n> @@ -196,6 +196,15 @@ int cmd_revert(int argc, const char **argv, const char *prefix)\n[...]\n> +\tif (!strcmp(var, \"cherrypick.record-origin\"))\n> +\t\topts->record_origin = git_config_bool (var, value);\n\nMore nitpicky: git uses camelCase, not dash-delimited, for multiword\nconfiguration items.  The config parsing machinery normalizes to\nlowercase, so this would then be \"cherrypick.recordorigin\".\n\nHope that helps,\nJonathan\n"},{"id":"235000","messageId":"20140218183842.GA163138@vauxhall.crustytoothpaste.net","threadId":"35902","inReplyTo":"20140218174913.GB7855@google.com","subject":"Re: [PATCH] revert.c: Allow to specify -x via git-config","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2014-02-18T18:38:43Z","receivedAt":"2014-02-18T18:38:43Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Tue, Feb 18, 2014 at 09:49:13AM -0800, Jonathan Nieder wrote:\n> Can you say more about the context?  Why is it important to record the\n> original commit id?  Is it a matter of keeping a reminder of the\n> commits' similarity (which cherry-pick without '-x' does ok by reusing\n> the same message) or are people reviewing the change downstream going\n> to be judging the change based on the recorded upstream commit id?\n> (Like linux's stable-<version> branches --- but those have other\n> requirements so I don't think this configuration would work as is\n> there.)\n\nI can provide a use case.  At work, we merge into the maintenance and\ndevelopment branches and cherry-pick from the maintenance to the stable\nbranches.  We want committers to always use -x -s because we need to\nknow which reviewer backported the change and we want to be able to\ntrack which commits have been backported and whether any reverts also\nneed to be cherry-picked.  We also have automated tools that want this\ninformation.\n\nI usually solve this with an alias (backport = cherry-pick -x -s), but I\ncan see how this might be a useful option.\n\n-- \nbrian m. carlson / brian with sandals: Houston, Texas, US\n+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only\nOpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187\n"},{"id":"235004","messageId":"20140218192039.GC7855@google.com","threadId":"35902","inReplyTo":"20140218183842.GA163138@vauxhall.crustytoothpaste.net","subject":"Re: [PATCH] revert.c: Allow to specify -x via git-config","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-02-18T19:20:39Z","receivedAt":"2014-02-18T19:20:39Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"brian m. carlson wrote:\n\n> I can provide a use case.  At work, we merge into the maintenance and\n> development branches and cherry-pick from the maintenance to the stable\n> branches.  We want committers to always use -x -s because we need to\n> know which reviewer backported the change and we want to be able to\n> track which commits have been backported and whether any reverts also\n> need to be cherry-picked.  We also have automated tools that want this\n> information.\n>\n> I usually solve this with an alias (backport = cherry-pick -x -s), but I\n> can see how this might be a useful option.\n\nThanks for the example.\n\nHere the alias seems like a nicer solution than a configuration\nchanging the default behavior of \"git cherry-pick\" because\n\n (1) it is easy to temporarily turn the effect off, by using cherry-pick\n     directly instead of using the alias\n\n (2) it doesn't affect scripts that use cherry-pick\n\n (3) The caller explicitly specifies their intent by running \"git\n     backport\".  It doesn't affect unrelated uses of cherry-pick on\n     other branches.\n\n (4) it can be set up globally and takes effect when appropriate\n     without needing any special setup per repository\n\n (5) it also implements the other part of your backporting policy (-s)\n     and if in the future you had more backporting rules (e.g., requirement\n     to specify which commit introduced the regression that this backport\n     solves) then it could be easily tweaked\n\nAll that said, I wouldn't mind some magic that changes the default\nbehavior of \"git cherry-pick\" as long as (1), (2), and (3) are\nresolved somehow.  E.g.\n\n (i)   a working --no-record-origin option that overrides this config\n\n (ii)  a --porcelain or similar option or just better documentation\n       about how scripts can protect themselves from further changes\n       to 'git cherry-pick' behavior\n\n (iii) config applying per destination branch instead of globally\n\nHope that helps,\nJonathan\n"},{"id":"235020","messageId":"cover.1392758057.git.agx@sigxcpu.org","threadId":"35902","inReplyTo":"20140218192039.GC7855@google.com","subject":"[PATCH v2 0/3] Allow to configure cherry-pick's record origin","fromName":"Guido Günther","fromEmail":"agx@sigxcpu.org","sentAt":"2014-02-18T21:27:39Z","receivedAt":"2014-02-18T21:27:39Z","isPatch":true,"sender":{"key":"agx@sigxcpu.org","avatar":"https://gravatar.com/avatar/2db348f1d0d0888423e5699c53ef899d81fc16e81d0aeddda0a1971ff1b2f7ec?d=mp&s=160"},"body":"The main motivation is to be able to configure repos that are used for\nmaintaining backports/stable branches and not having to remember to use a\nspecial invocation of git cherry-pick.\n\nChanges from last version:\n\n* add --no-record-origin so scripts can make sure they'll never record\n  a commit id\n* add --record-origin for symmetry with config file option and\n  --no-record-origin\n* Add docs to git-config as well\n\nGuido Günther (3):\n  revert.c: Allow to specify -x via git-config\n  revert.c: Add --record-origin\n  revert.c Allow to override cherrypick.recordOrigin\n\n Documentation/config.txt          |  4 ++++\n Documentation/git-cherry-pick.txt | 13 +++++++++++++\n builtin/revert.c                  | 22 ++++++++++++++++++++--\n 3 files changed, 37 insertions(+), 2 deletions(-)\n\n-- \n1.9.0.rc3\n"},{"id":"235021","messageId":"85b9fa68b1a5542817489ddbe186cbb7600599b0.1392758057.git.agx@sigxcpu.org","threadId":"35902","inReplyTo":"cover.1392758057.git.agx@sigxcpu.org","subject":"[PATCH v2 1/3] revert.c: Allow to specify -x via git-config","fromName":"Guido Günther","fromEmail":"agx@sigxcpu.org","sentAt":"2014-02-18T21:27:40Z","receivedAt":"2014-02-18T21:27:40Z","isPatch":true,"sender":{"key":"agx@sigxcpu.org","avatar":"https://gravatar.com/avatar/2db348f1d0d0888423e5699c53ef899d81fc16e81d0aeddda0a1971ff1b2f7ec?d=mp&s=160"},"body":"Without this when maintaining stable branches it's easy to forget to use\n-x to track where a patch was cherry-picked from.\n---\n Documentation/config.txt          |  4 ++++\n Documentation/git-cherry-pick.txt |  8 ++++++++\n builtin/revert.c                  | 14 +++++++++++++-\n 3 files changed, 25 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 5f4d793..a47d045 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -794,6 +794,10 @@ browser.<tool>.path::\n \tbrowse HTML help (see '-w' option in linkgit:git-help[1]) or a\n \tworking repository in gitweb (see linkgit:git-instaweb[1]).\n \n+cherrypick.recordOrigin::\n+\tWhen cherry picking patches record the sha1 of the original\n+\tcommit in the commit message. Defaults to `false`.\n+\n clean.requireForce::\n \tA boolean to make git-clean do nothing unless given -f,\n \t-i or -n.   Defaults to true.\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex c205d23..c0274bd 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -215,6 +215,14 @@ the working tree.\n spending extra time to avoid mistakes based on incorrectly matching\n context lines.\n \n+CONFIGURATION\n+-------------\n+\n+See linkgit:git-config[1] for core variables.\n+\n+cherrypick.recordOrigin::\n+\tDefault for the `-x` option. Defaults to `false`.\n+\n SEE ALSO\n --------\n linkgit:git-revert[1]\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 87659c9..0c14af4 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -196,6 +196,18 @@ int cmd_revert(int argc, const char **argv, const char *prefix)\n \treturn res;\n }\n \n+static int git_cherry_pick_config(const char *var, const char *value, void *cb)\n+{\n+\tstruct replay_opts *opts = cb;\n+\n+\tif (!strcmp(var, \"cherrypick.recordorigin\")) {\n+\t\topts->record_origin = git_config_bool (var, value);\n+\t\treturn 0;\n+\t} else {\n+\t\treturn git_config(git_default_config, NULL);\n+\t}\n+}\n+\n int cmd_cherry_pick(int argc, const char **argv, const char *prefix)\n {\n \tstruct replay_opts opts;\n@@ -203,7 +215,7 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)\n \n \tmemset(&opts, 0, sizeof(opts));\n \topts.action = REPLAY_PICK;\n-\tgit_config(git_default_config, NULL);\n+\tgit_config(git_cherry_pick_config, &opts);\n \tparse_args(argc, argv, &opts);\n \tres = sequencer_pick_revisions(&opts);\n \tif (res < 0)\n-- \n1.9.0.rc3\n"},{"id":"235019","messageId":"a6a124ba7e8a4a4582da28687f5a2aa43c78c31d.1392758057.git.agx@sigxcpu.org","threadId":"35902","inReplyTo":"cover.1392758057.git.agx@sigxcpu.org","subject":"[PATCH v2 2/3] revert.c: Add --record-origin","fromName":"Guido Günther","fromEmail":"agx@sigxcpu.org","sentAt":"2014-02-18T21:27:41Z","receivedAt":"2014-02-18T21:27:41Z","isPatch":true,"sender":{"key":"agx@sigxcpu.org","avatar":"https://gravatar.com/avatar/2db348f1d0d0888423e5699c53ef899d81fc16e81d0aeddda0a1971ff1b2f7ec?d=mp&s=160"},"body":"This makes sure we have a command line option that corresponds with the\nconfig file option.\n---\n Documentation/git-cherry-pick.txt | 1 +\n builtin/revert.c                  | 2 +-\n 2 files changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex c0274bd..63db07d 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -57,6 +57,7 @@ OPTIONS\n \tmessage prior to committing.\n \n -x::\n+--record-origin::\n \tWhen recording the commit, append a line that says\n \t\"(cherry picked from commit ...)\" to the original commit\n \tmessage in order to indicate which commit this change was\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 0c14af4..899f3e4 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -99,7 +99,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \n \tif (opts->action == REPLAY_PICK) {\n \t\tstruct option cp_extra[] = {\n-\t\t\tOPT_BOOL('x', NULL, &opts->record_origin, N_(\"append commit name\")),\n+\t\t\tOPT_BOOL('x', \"record-origin\", &opts->record_origin, N_(\"append commit name\")),\n \t\t\tOPT_BOOL(0, \"ff\", &opts->allow_ff, N_(\"allow fast-forward\")),\n \t\t\tOPT_BOOL(0, \"allow-empty\", &opts->allow_empty, N_(\"preserve initially empty commits\")),\n \t\t\tOPT_BOOL(0, \"allow-empty-message\", &opts->allow_empty_message, N_(\"allow commits with empty messages\")),\n-- \n1.9.0.rc3\n"},{"id":"235022","messageId":"9f4f6718ac3a4feadafc2c9a95173ee5c308b70e.1392758057.git.agx@sigxcpu.org","threadId":"35902","inReplyTo":"cover.1392758057.git.agx@sigxcpu.org","subject":"[PATCH v2 3/3] revert.c Allow to override cherrypick.recordOrigin","fromName":"Guido Günther","fromEmail":"agx@sigxcpu.org","sentAt":"2014-02-18T21:27:42Z","receivedAt":"2014-02-18T21:27:42Z","isPatch":true,"sender":{"key":"agx@sigxcpu.org","avatar":"https://gravatar.com/avatar/2db348f1d0d0888423e5699c53ef899d81fc16e81d0aeddda0a1971ff1b2f7ec?d=mp&s=160"},"body":"--no-record-origin can be used by scripts to be sure to not record\norigin information when cherry-picking.\n---\n Documentation/git-cherry-pick.txt | 4 ++++\n builtin/revert.c                  | 6 ++++++\n 2 files changed, 10 insertions(+)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex 63db07d..b063b76 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -58,6 +58,7 @@ OPTIONS\n \n -x::\n --record-origin::\n+--no-record-origin::\n \tWhen recording the commit, append a line that says\n \t\"(cherry picked from commit ...)\" to the original commit\n \tmessage in order to indicate which commit this change was\n@@ -70,6 +71,9 @@ OPTIONS\n \tmaintenance branch for an older release from a\n \tdevelopment branch), adding this information can be\n \tuseful.\n++\n+Use `--no-record-origin` if you want to avoid recording the commit id\n+even when the `cherrypick.recordOrigin` option is in effect.\n \n -r::\n \tIt used to be that the command defaulted to do `-x`\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 899f3e4..14d90ba 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -76,6 +76,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \tconst char * const * usage_str = revert_or_cherry_pick_usage(opts);\n \tconst char *me = action_name(opts);\n \tint cmd = 0;\n+\tint no_record_origin = 0;\n \tstruct option options[] = {\n \t\tOPT_CMDMODE(0, \"quit\", &cmd, N_(\"end revert or cherry-pick sequence\"), 'q'),\n \t\tOPT_CMDMODE(0, \"continue\", &cmd, N_(\"resume revert or cherry-pick sequence\"), 'c'),\n@@ -95,11 +96,13 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\tOPT_END(),\n \t\tOPT_END(),\n \t\tOPT_END(),\n+\t\tOPT_END(),\n \t};\n \n \tif (opts->action == REPLAY_PICK) {\n \t\tstruct option cp_extra[] = {\n \t\t\tOPT_BOOL('x', \"record-origin\", &opts->record_origin, N_(\"append commit name\")),\n+\t\t\tOPT_BOOL(0, \"no-record-origin\", &no_record_origin, N_(\"don't append commit name\")),\n \t\t\tOPT_BOOL(0, \"ff\", &opts->allow_ff, N_(\"allow fast-forward\")),\n \t\t\tOPT_BOOL(0, \"allow-empty\", &opts->allow_empty, N_(\"preserve initially empty commits\")),\n \t\t\tOPT_BOOL(0, \"allow-empty-message\", &opts->allow_empty_message, N_(\"allow commits with empty messages\")),\n@@ -118,6 +121,9 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \tif (opts->keep_redundant_commits)\n \t\topts->allow_empty = 1;\n \n+\tif (no_record_origin)\n+\t\topts->record_origin = 0;\n+\n \t/* Set the subcommand */\n \tif (cmd == 'q')\n \t\topts->subcommand = REPLAY_REMOVE_STATE;\n-- \n1.9.0.rc3\n"},{"id":"235063","messageId":"xmqqy51698pa.fsf@gitster.dls.corp.google.com","threadId":"35902","inReplyTo":"85b9fa68b1a5542817489ddbe186cbb7600599b0.1392758057.git.agx@sigxcpu.org","subject":"Re: [PATCH v2 1/3] revert.c: Allow to specify -x via git-config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-02-19T19:57:37Z","receivedAt":"2014-02-19T19:57:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Guido Günther <agx@sigxcpu.org> writes:\n\n> Without this when maintaining stable branches it's easy to forget to use\n> -x to track where a patch was cherry-picked from.\n> ---\n>  Documentation/config.txt          |  4 ++++\n>  Documentation/git-cherry-pick.txt |  8 ++++++++\n>  builtin/revert.c                  | 14 +++++++++++++-\n>  3 files changed, 25 insertions(+), 1 deletion(-)\n\nHmph.  Does this round address the issues raised in the previous\ndiscussion in any way?\n\nHow does it affect people's existing scripts that use cherry-pick\nand rely on it not doing the unwanted -x thing if such a\nconfiguration variable is introduced as the first step in the\nseries, without even giving them to override the configured default\nfrom the command line?\n\nFor that matter, I do not think a new override option from the\ncommand line is a great solution, as that approach forces people's\nexisting script to be adjusted.\n\nI personally found the way Jonathan explained why \"git backport\"\nalias is the best solution (not just a usable workaround) very\ncompelling, especially his point (3):\n\n (3) The caller explicitly specifies their intent by running \"git\n     backport\".  It doesn't affect unrelated uses of cherry-pick on\n     other branches.\n\nI do not even mind throwing something like this:\n\n\t#!/bin/sh\n\t# \"git backport\" - cherry-pick with -x always on.\n        exec git cherry-pick -x \"$@\"\n\nin contrib/ somewhere, which feels like a far more appropriate\nsolution to your \"easy to forget\" problem, at least to me.\n"}]}