{"thread":{"id":"39500","subject":"[PATCH/RFC v3 1/4] git-am.sh: fix initialization of the threeway variable","startedAt":"2015-06-02T17:34:03Z","lastAt":"2015-06-04T13:26:09Z","messageCount":16,"participants":["Remi Lespinet","Junio C Hamano","Torsten Bögershausen","Matthieu Moy"],"isPatch":true,"patchVersion":3,"patchTotal":4},"messages":[{"id":"262749","messageId":"1433266446-2845-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":null,"subject":"[PATCH/RFC v3 1/4] git-am.sh: fix initialization of the threeway variable","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-02T17:34:03Z","receivedAt":"2015-06-02T17:34:03Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Initialization for the threeway variable was missing. This caused\na behavior change for command lines like:\n\n\tthreeway=t git am ...\n\nThis commit fixes the bug.\n\nSigned-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n---\n git-am.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex 761befb..c460dd0 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -378,6 +378,7 @@ committer_date_is_author_date=\n ignore_date=\n allow_rerere_autoupdate=\n gpg_sign_opt=\n+threeway=\n \n if test \"$(git config --bool --get am.messageid)\" = true\n then\n-- \n1.9.1\n"},{"id":"262750","messageId":"1433266446-2845-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":"1433266446-2845-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"[PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-02T17:34:04Z","receivedAt":"2015-06-02T17:34:04Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Prepare a configuration section for the git am documentation.\nRemove the part related to the am.keepcr configuration variable in the\ndescription of the --keepcr option and place the description of the\nam.keepcr configuration variable in the newly created configuration\nsection.\n\nThis section will be used in the next commit.\n\nSigned-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n---\n Documentation/git-am.txt | 16 +++++++++++++---\n 1 file changed, 13 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 0d8ba48..d412f6b 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -24,6 +24,16 @@ Splits mail messages in a mailbox into commit log message,\n authorship information and patches, and applies them to the\n current branch.\n \n+CONFIGURATION\n+-------------\n+\n+am.keepcr::\n+\tIf true, git-am will call git-mailsplit for patches in mbox format\n+\twith parameter '--keep-cr'. In this case git-mailsplit will\n+\tnot remove `\\r` from lines ending with `\\r\\n`. Can be overridden\n+\tby giving '--no-keep-cr' from the command line.\n+\tSee linkgit:git-am[1], linkgit:git-mailsplit[1].\n+\n OPTIONS\n -------\n (<mbox>|<Maildir>)...::\n@@ -43,11 +53,11 @@ OPTIONS\n --keep-non-patch::\n \tPass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).\n \n---[no-]keep-cr::\n+--keep-cr::\n+--no-keep-cr::\n \tWith `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])\n \twith the same option, to prevent it from stripping CR at the end of\n-\tlines. `am.keepcr` configuration variable can be used to specify the\n-\tdefault behaviour.  `--no-keep-cr` is useful to override `am.keepcr`.\n+\tlines.\n \n -c::\n --scissors::\n-- \n1.9.1\n"},{"id":"262751","messageId":"1433266446-2845-3-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":"1433266446-2845-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"[PATCH/RFC v3 3/4] t4150-am: refactor am -3 tests","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-02T17:34:05Z","receivedAt":"2015-06-02T17:34:05Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Create a setup for git am -3 in a separate test instead of creating\nthis setup each time.\n\nThis prepares for the next commit which will use this setup as well.\n\nSigned-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n---\n t/t4150-am.sh | 32 ++++++++++++++------------------\n 1 file changed, 14 insertions(+), 18 deletions(-)\n\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 306e6f3..6ced98c 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -274,15 +274,21 @@ test_expect_success 'am --keep-non-patch really keeps the non-patch part' '\n \tgrep \"^\\[foo\\] third\" actual\n '\n \n+test_expect_success 'setup am -3' '\n+\trm -fr .git/rebase-apply &&\n+\tgit reset --hard &&\n+\tgit checkout -b base3way master2 &&\n+\tsed -n -e \"3,\\$p\" msg >file &&\n+\thead -n 9 msg >>file &&\n+\tgit add file &&\n+\ttest_tick &&\n+\tgit commit -m \"copied stuff\"\n+'\n+\n test_expect_success 'am -3 falls back to 3-way merge' '\n \trm -fr .git/rebase-apply &&\n \tgit reset --hard &&\n-\tgit checkout -b lorem2 master2 &&\n-\tsed -n -e \"3,\\$p\" msg >file &&\n-\thead -n 9 msg >>file &&\n-\tgit add file &&\n-\ttest_tick &&\n-\tgit commit -m \"copied stuff\" &&\n+\tgit checkout -b lorem2 base3way &&\n \tgit am -3 lorem-move.patch &&\n \ttest_path_is_missing .git/rebase-apply &&\n \tgit diff --exit-code lorem\n@@ -291,12 +297,7 @@ test_expect_success 'am -3 falls back to 3-way merge' '\n test_expect_success 'am -3 -p0 can read --no-prefix patch' '\n \trm -fr .git/rebase-apply &&\n \tgit reset --hard &&\n-\tgit checkout -b lorem3 master2 &&\n-\tsed -n -e \"3,\\$p\" msg >file &&\n-\thead -n 9 msg >>file &&\n-\tgit add file &&\n-\ttest_tick &&\n-\tgit commit -m \"copied stuff\" &&\n+\tgit checkout -b lorem3 base3way &&\n \tgit am -3 -p0 lorem-zero.patch &&\n \ttest_path_is_missing .git/rebase-apply &&\n \tgit diff --exit-code lorem\n@@ -338,12 +339,7 @@ test_expect_success 'am -3 can rename a file after falling back to 3-way merge'\n test_expect_success 'am -3 -q is quiet' '\n \trm -fr .git/rebase-apply &&\n \tgit checkout -f lorem2 &&\n-\tgit reset master2 --hard &&\n-\tsed -n -e \"3,\\$p\" msg >file &&\n-\thead -n 9 msg >>file &&\n-\tgit add file &&\n-\ttest_tick &&\n-\tgit commit -m \"copied stuff\" &&\n+\tgit reset base3way --hard &&\n \tgit am -3 -q lorem-move.patch >output.out 2>&1 &&\n \t! test -s output.out\n '\n-- \n1.9.1\n"},{"id":"262752","messageId":"1433266446-2845-4-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":"1433266446-2845-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"[PATCH/RFC v3 4/4] git-am: add am.threeWay config variable","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-02T17:34:06Z","receivedAt":"2015-06-02T17:34:06Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Add the am.threeWay configuration variable to use the -3 or --3way\noption of git am by default. When am.threeway is set and not desired\nfor a specific git am command, the --no-3way option can be used to\noverride it.\n\nSigned-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n---\n Even if git am will be rewritten soon, the code that will have to be\n ported is not the most important part of the patch and the tests and\n documentation parts can be reused.\n\n Documentation/config.txt |  8 ++++++++\n Documentation/git-am.txt | 11 ++++++++++-\n git-am.sh                |  9 +++++++++\n t/t4150-am.sh            | 19 +++++++++++++++++++\n 4 files changed, 46 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex d44bc85..669f5fc 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -769,6 +769,14 @@ am.keepcr::\n \tby giving '--no-keep-cr' from the command line.\n \tSee linkgit:git-am[1], linkgit:git-mailsplit[1].\n \n+am.threeWay::\n+\tBy default, git-am will fail if the patch does not apply cleanly. When\n+\tset to true, this setting tells git-am to fall back on 3-way merge if\n+\tthe patch records the identity of blobs it is supposed to apply to and\n+\twe have those blobs available locally (equivalent to giving the --3way\n+\toption from the command line).\n+\tSee linkgit:git-am[1].\n+\n apply.ignoreWhitespace::\n \tWhen set to 'change', tells 'git apply' to ignore changes in\n \twhitespace, in the same way as the '--ignore-space-change'\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex d412f6b..0472182 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -10,7 +10,7 @@ SYNOPSIS\n --------\n [verse]\n 'git am' [--signoff] [--keep] [--[no-]keep-cr] [--[no-]utf8]\n-\t [--3way] [--interactive] [--committer-date-is-author-date]\n+\t [--[no-]3way] [--interactive] [--committer-date-is-author-date]\n \t [--ignore-date] [--ignore-space-change | --ignore-whitespace]\n \t [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]\n \t [--exclude=<path>] [--include=<path>] [--reject] [-q | --quiet]\n@@ -34,6 +34,14 @@ am.keepcr::\n \tby giving '--no-keep-cr' from the command line.\n \tSee linkgit:git-am[1], linkgit:git-mailsplit[1].\n \n+am.threeWay::\n+\tBy default, git-am will fail if the patch does not apply cleanly. When\n+\tset to true, this setting tells git-am to fall back on 3-way merge if\n+\tthe patch records the identity of blobs it is supposed to apply to and\n+\twe have those blobs available locally (equivalent to giving the --3way\n+\toption from the command line).\n+\tSee linkgit:git-am[1].\n+\n OPTIONS\n -------\n (<mbox>|<Maildir>)...::\n@@ -100,6 +108,7 @@ default.   You can use `--no-utf8` to override this.\n \n -3::\n --3way::\n+--no-3way::\n \tWhen the patch does not apply cleanly, fall back on\n \t3-way merge if the patch records the identity of blobs\n \tit is supposed to apply to and we have those blobs\ndiff --git a/git-am.sh b/git-am.sh\nindex c460dd0..75e701a 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -390,6 +390,11 @@ then\n     keepcr=t\n fi\n \n+if test \"$(git config --bool --get am.threeWay)\" = true\n+then\n+    threeway=t\n+fi\n+\n while test $# != 0\n do\n \tcase \"$1\" in\n@@ -401,6 +406,8 @@ it will be removed. Please do not use it anymore.\"\n \t\t;;\n \t-3|--3way)\n \t\tthreeway=t ;;\n+\t--no-3way)\n+\t\tthreeway=f ;;\n \t-s|--signoff)\n \t\tsign=t ;;\n \t-u|--utf8)\n@@ -658,6 +665,8 @@ fi\n if test \"$(cat \"$dotest/threeway\")\" = t\n then\n \tthreeway=t\n+else\n+\tthreeway=f\n fi\n git_apply_opt=$(cat \"$dotest/apply-opt\")\n if test \"$(cat \"$dotest/sign\")\" = t\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex 6ced98c..b822a39 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -303,6 +303,25 @@ test_expect_success 'am -3 -p0 can read --no-prefix patch' '\n \tgit diff --exit-code lorem\n '\n \n+test_expect_success 'am with config am.threeWay falls back to 3-way merge' '\n+\trm -fr .git/rebase-apply &&\n+\tgit reset --hard &&\n+\tgit checkout -b lorem4 base3way &&\n+\ttest_config am.threeWay 1 &&\n+\tgit am lorem-move.patch &&\n+\ttest_path_is_missing .git/rebase-apply &&\n+\tgit diff --exit-code lorem\n+'\n+\n+test_expect_success 'am with config am.threeWay overridden by --no-3way' '\n+\trm -fr .git/rebase-apply &&\n+\tgit reset --hard &&\n+\tgit checkout -b lorem5 base3way &&\n+\ttest_config am.threeWay 1 &&\n+\ttest_must_fail git am --no-3way lorem-move.patch &&\n+\ttest_path_is_dir .git/rebase-apply\n+'\n+\n test_expect_success 'am can rename a file' '\n \tgrep \"^rename from\" rename.patch &&\n \trm -fr .git/rebase-apply &&\n-- \n1.9.1\n"},{"id":"262773","messageId":"xmqq38293lyq.fsf@gitster.dls.corp.google.com","threadId":"39500","inReplyTo":"1433266446-2845-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-02T20:16:13Z","receivedAt":"2015-06-02T20:16:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> Prepare a configuration section for the git am documentation.\n> Remove the part related to the am.keepcr configuration variable in the\n> description of the --keepcr option and place the description of the\n> am.keepcr configuration variable in the newly created configuration\n> section.\n>\n> This section will be used in the next commit.\n>\n> Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n> ---\n>  Documentation/git-am.txt | 16 +++++++++++++---\n>  1 file changed, 13 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> index 0d8ba48..d412f6b 100644\n> --- a/Documentation/git-am.txt\n> +++ b/Documentation/git-am.txt\n> @@ -24,6 +24,16 @@ Splits mail messages in a mailbox into commit log message,\n>  authorship information and patches, and applies them to the\n>  current branch.\n>  \n> +CONFIGURATION\n> +-------------\n> +\n> +am.keepcr::\n> +\tIf true, git-am will call git-mailsplit for patches in mbox format\n> +\twith parameter '--keep-cr'. In this case git-mailsplit will\n> +\tnot remove `\\r` from lines ending with `\\r\\n`. Can be overridden\n> +\tby giving '--no-keep-cr' from the command line.\n> +\tSee linkgit:git-am[1], linkgit:git-mailsplit[1].\n\nAs this is git-am.txt, the first reference smells a bit odd.\n\nOther than that, looks OK to me.\n\nThanks.\n\n>  OPTIONS\n>  -------\n>  (<mbox>|<Maildir>)...::\n> @@ -43,11 +53,11 @@ OPTIONS\n>  --keep-non-patch::\n>  \tPass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).\n>  \n> ---[no-]keep-cr::\n> +--keep-cr::\n> +--no-keep-cr::\n>  \tWith `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])\n>  \twith the same option, to prevent it from stripping CR at the end of\n> -\tlines. `am.keepcr` configuration variable can be used to specify the\n> -\tdefault behaviour.  `--no-keep-cr` is useful to override `am.keepcr`.\n> +\tlines.\n>  \n>  -c::\n>  --scissors::\n"},{"id":"262775","messageId":"xmqqy4k12792.fsf@gitster.dls.corp.google.com","threadId":"39500","inReplyTo":"1433266446-2845-4-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 4/4] git-am: add am.threeWay config variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-02T20:19:21Z","receivedAt":"2015-06-02T20:19:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> index d412f6b..0472182 100644\n> --- a/Documentation/git-am.txt\n> +++ b/Documentation/git-am.txt\n> ...\n> +am.threeWay::\n> +\tBy default, git-am will fail if the patch does not apply cleanly. When\n> +\tset to true, this setting tells git-am to fall back on 3-way merge if\n> +\tthe patch records the identity of blobs it is supposed to apply to and\n> +\twe have those blobs available locally (equivalent to giving the --3way\n> +\toption from the command line).\n> +\tSee linkgit:git-am[1].\n\nSame comment as 2/4 applies here.\n"},{"id":"262776","messageId":"xmqqtwup278h.fsf@gitster.dls.corp.google.com","threadId":"39500","inReplyTo":"1433266446-2845-1-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 1/4] git-am.sh: fix initialization of the threeway variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-02T20:19:42Z","receivedAt":"2015-06-02T20:19:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Overall this round looks sensible, modulo minor nits.\n\nThanks.\n"},{"id":"262809","messageId":"556E95AC.7040305@web.de","threadId":"39500","inReplyTo":"1433266446-2845-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-06-03T05:50:36Z","receivedAt":"2015-06-03T05:50:36Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 06/02/2015 07:34 PM, Remi Lespinet wrote:\n> []\n> Signed-off-by: Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr>\n> ---\n>   Documentation/git-am.txt | 16 +++++++++++++---\n>   1 file changed, 13 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\n> index 0d8ba48..d412f6b 100644\n> --- a/Documentation/git-am.txt\n> +++ b/Documentation/git-am.txt\n> @@ -24,6 +24,16 @@ Splits mail messages in a mailbox into commit log message,\n>   authorship information and patches, and applies them to the\n>   current branch.\n>   \n> +CONFIGURATION\n> +-------------\n> +\n> +am.keepcr::\n> +\tIf true, git-am will call git-mailsplit for patches in mbox format\n> +\twith parameter '--keep-cr'. In this case git-mailsplit will\n> +\tnot remove `\\r` from lines ending with `\\r\\n`. Can be overridden\n> +\tby giving '--no-keep-cr' from the command line.\n(This documentation assumes that am.keepcr is true)\nWould it be clearer to put the \"overridden\" into one line and write like \nthis:\n\nCan be overridden by giving '--no-keep-cr' or '--keep-cr' from the command line.\n"},{"id":"262847","messageId":"217974219.58943.1433319994168.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":"556E95AC.7040305@web.de","subject":"[PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-03T08:26:34Z","receivedAt":"2015-06-03T08:26:34Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"> On 06/03/2015 07:50 AM Torsten Bögershausen <tboegi@web.de> wrote\n>\n> > +CONFIGURATION\n> > +-------------\n> > +\n> > +am.keepcr::\n> > +        If true, git-am will call git-mailsplit for patches in mbox format\n> > +        with parameter '--keep-cr'. In this case git-mailsplit will\n> > +        not remove `\\r` from lines ending with `\\r\\n`. Can be overridden\n> > +        by giving '--no-keep-cr' from the command line.\n> (This documentation assumes that am.keepcr is true)\n> Would it be clearer to put the \"overridden\" into one line and write like\n> this:\n> \n> Can be overridden by giving '--no-keep-cr' or '--keep-cr' from the command line.\n\nYes I agree, or maybe:\n\n'--keep-cr' and '--no-keep-cr' take precedence over this variable.\n\nActually, I don't know if we need to write it (as Paul Tan suggested\nin the previous version of this patch for the threeway option\nhttp://article.gmane.org/gmane.comp.version-control.git/270150)\n\nI checked the documentation of different commands. From what I've\nseen, such indications either does not appear or are right after the\ntext. I agree that it's a good idea, but for the sake of consistency,\nI'd rather use one of these two format as long as it's ok for you.\n"},{"id":"262874","messageId":"vpq4mmoep9y.fsf@anie.imag.fr","threadId":"39500","inReplyTo":"1433266446-2845-2-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-06-03T16:21:29Z","receivedAt":"2015-06-03T16:21:29Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> Prepare a configuration section for the git am documentation.\n\nMost git-*.txt do not have this CONFIGURATION section.\n\nIn an ideal world, we would have such section automatically generated\n(i.e. the description for each variable would exist in one place, and we\nwould make sure that both \"man git-config\" and \"man git-<command>\" show\nit). In a really ideal world, it would also be propagated to the code\nand we would have a \"git config --describe am.keepcr\" or so that would\nreturn the doc.\n\nI'm a bit worried to see documentation cut-and-pasted from config.txt to\ngit-*.txt for maintainability: if the text on one side is modified,\nwe're likely to forget the other and the text will diverge with time.\n\nNot a strong objection, but I have the feeling that the more we do this\nkind of patches, the harder it will be if ever we decide to do the above.\n\n> +CONFIGURATION\n> +-------------\n> +\n> +am.keepcr::\n> +\tIf true, git-am will call git-mailsplit for patches in mbox format\n\n`git am`\n`git mailsplit`\n\n> +\twith parameter '--keep-cr'. In this case git-mailsplit will\n\nLikewise\n\n> +\tnot remove `\\r` from lines ending with `\\r\\n`. Can be overridden\n> +\tby giving '--no-keep-cr' from the command line.\n\nThat should be backquote, not forward-quote, right?\n\nI know it's not your code since it's a cut-and-paste from config.txt,\nbut that illustrates my point above: we used to have one place with\nwrong quotes, and we'd have two after the patch.\n\n>  OPTIONS\n>  -------\n>  (<mbox>|<Maildir>)...::\n> @@ -43,11 +53,11 @@ OPTIONS\n>  --keep-non-patch::\n>  \tPass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).\n>  \n> ---[no-]keep-cr::\n> +--keep-cr::\n> +--no-keep-cr::\n>  \tWith `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])\n>  \twith the same option, to prevent it from stripping CR at the end of\n> -\tlines. `am.keepcr` configuration variable can be used to specify the\n> -\tdefault behaviour.\n\nI don't think it's a good idea to remove this part. If I look for a way\nto make --keep-cr the default, the first place I'd look would be the doc\nfor --keep-cr, and I'd appreciate a link to am.keepcr.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"262875","messageId":"vpqvbf4da95.fsf@anie.imag.fr","threadId":"39500","inReplyTo":"1433266446-2845-4-git-send-email-remi.lespinet@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 4/4] git-am: add am.threeWay config variable","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2015-06-03T16:31:18Z","receivedAt":"2015-06-03T16:31:18Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n\n> +am.threeWay::\n> +\tBy default, git-am will fail if the patch does not apply cleanly.\n\nhttp://article.gmane.org/gmane.comp.version-control.git/270538\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"262877","messageId":"xmqqwpzkyc8p.fsf@gitster.dls.corp.google.com","threadId":"39500","inReplyTo":"vpq4mmoep9y.fsf@anie.imag.fr","subject":"Re: [PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-06-03T16:42:46Z","receivedAt":"2015-06-03T16:42:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:\n\n>>  OPTIONS\n>>  -------\n>>  (<mbox>|<Maildir>)...::\n>> @@ -43,11 +53,11 @@ OPTIONS\n>>  --keep-non-patch::\n>>  \tPass `-b` flag to 'git mailinfo' (see linkgit:git-mailinfo[1]).\n>>  \n>> ---[no-]keep-cr::\n>> +--keep-cr::\n>> +--no-keep-cr::\n>>  \tWith `--keep-cr`, call 'git mailsplit' (see linkgit:git-mailsplit[1])\n>>  \twith the same option, to prevent it from stripping CR at the end of\n>> -\tlines. `am.keepcr` configuration variable can be used to specify the\n>> -\tdefault behaviour.\n>\n> I don't think it's a good idea to remove this part. If I look for a way\n> to make --keep-cr the default, the first place I'd look would be the doc\n> for --keep-cr, and I'd appreciate a link to am.keepcr.\n\nYup, very sensible suggestion.  Configuration gives default, command\nline options override the default.  People come two different ends;\nhaving to describe the same thing twice is wasteful, but will help\nthem one indirection to find relevant facts in the documentation.\n"},{"id":"262878","messageId":"1224076916.87652.1433349788756.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":"vpqvbf4da95.fsf@anie.imag.fr","subject":"[PATCH/RFC v3 4/4] git-am: add am.threeWay config variable","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-03T16:43:08Z","receivedAt":"2015-06-03T16:43:08Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes\n\n> Remi Lespinet <remi.lespinet@ensimag.grenoble-inp.fr> writes:\n> \n> > +am.threeWay::\n> > +        By default, git-am will fail if the patch does not apply cleanly.\n> \n> http://article.gmane.org/gmane.comp.version-control.git/270538\n\nOk sorry.\n\nThanks\n"},{"id":"262886","messageId":"840759634.89013.1433352813283.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":"vpq4mmoep9y.fsf@anie.imag.fr","subject":"Re: [PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-03T17:33:33Z","receivedAt":"2015-06-03T17:33:33Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"\nMatthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes\n\n> Most git-*.txt do not have this CONFIGURATION section.\n> \n> In an ideal world, we would have such section automatically generated\n> (i.e. the description for each variable would exist in one place, and we\n> would make sure that both \"man git-config\" and \"man git-<command>\" show\n> it). In a really ideal world, it would also be propagated to the code\n> and we would have a \"git config --describe am.keepcr\" or so that would\n> return the doc.\n> \n> I'm a bit worried to see documentation cut-and-pasted from config.txt to\n> git-*.txt for maintainability: if the text on one side is modified,\n> we're likely to forget the other and the text will diverge with time.\n> \n> Not a strong objection, but I have the feeling that the more we do this\n> kind of patches, the harder it will be if ever we decide to do the above.\n\nI've seen occurences of this (mainly git-rebase.txt and\ngit-grep), but I agree, I think I'll remove the configuration\nsection.\n\n> > +CONFIGURATION\n> > +-------------\n> > +\n> > +am.keepcr::\n> > +        If true, git-am will call git-mailsplit for patches in mbox format\n> \n> `git am`\n> `git mailsplit`\n> \n> > +        with parameter '--keep-cr'. In this case git-mailsplit will\n> \n> Likewise\n> \n> > +        not remove `\\r` from lines ending with `\\r\\n`. Can be overridden\n> > +        by giving '--no-keep-cr' from the command line.\n> \n> That should be backquote, not forward-quote, right?\n> \n> I know it's not your code since it's a cut-and-paste from config.txt,\n> but that illustrates my point above: we used to have one place with\n> wrong quotes, and we'd have two after the patch.\n\nOk I'll correct it in a minor patch\n"},{"id":"262929","messageId":"556FE8B2.9060903@web.de","threadId":"39500","inReplyTo":"217974219.58943.1433319994168.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2015-06-04T05:57:06Z","receivedAt":"2015-06-04T05:57:06Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"\nI checked the documentation of different commands. From what I've\nseen, such indications either does not appear or are right after the\ntext. I agree that it's a good idea, but for the sake of consistency,\nI'd rather use one of these two format as long as it's ok for you.\n\n\nAfter re-checking: OK for me, sorry for the noise\n"},{"id":"262955","messageId":"316411029.123320.1433424369822.JavaMail.zimbra@ensimag.grenoble-inp.fr","threadId":"39500","inReplyTo":"840759634.89013.1433352813283.JavaMail.zimbra@ensimag.grenoble-inp.fr","subject":"Re: [PATCH/RFC v3 2/4] git-am.txt: add configuration section in git am documentation","fromName":"Remi Lespinet","fromEmail":"remi.lespinet@ensimag.grenoble-inp.fr","sentAt":"2015-06-04T13:26:09Z","receivedAt":"2015-06-04T13:26:09Z","isPatch":true,"sender":{"key":"remi.lespinet@ensimag.grenoble-inp.fr","avatar":"https://avatars.githubusercontent.com/u/11941160?v=4"},"body":"> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes\n> > > +CONFIGURATION\n> > > +-------------\n> > > +\n> > > +am.keepcr::\n> > > +        If true, git-am will call git-mailsplit for patches in mbox format\n> >\n> > `git am`\n> > `git mailsplit`\n> >\n> > > +        with parameter '--keep-cr'. In this case git-mailsplit will\n> >\n> > Likewise\n> >\n> > > +        not remove `\\r` from lines ending with `\\r\\n`. Can be overridden\n> > > +        by giving '--no-keep-cr' from the command line.\n> >\n> > That should be backquote, not forward-quote, right?\n> >\n> > I know it's not your code since it's a cut-and-paste from config.txt,\n> > but that illustrates my point above: we used to have one place with\n> > wrong quotes, and we'd have two after the patch.\n> \n> Ok I'll correct it in a minor patch\n\nActually I don't think that this is a good idea to correct\nthat (since there's many occurences of forward-quoted options in\ngit-config.txt). I'll just remove the configuration part in\nthe git am documentation.\n"}]}