{"thread":{"id":"22619","subject":"[PATCH 1/4] git-mailsplit: Show parameter '--keep-cr' in usage and documentation","startedAt":"2010-02-11T21:26:15Z","lastAt":"2010-02-12T22:04:25Z","messageCount":13,"participants":["Stefan-W. Hahn","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"134265","messageId":"1265923579-24900-1-git-send-email-stefan.hahn@s-hahn.de","threadId":"22619","inReplyTo":null,"subject":"[PATCHv2 0/4] Using git-mailsplit in mixed line ending environment","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-11T21:26:15Z","receivedAt":"2010-02-11T21:26:15Z","isPatch":false,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"Hello,\n\nI'm using git in environments with files having dos or unix line\nending. I apply patches using 'git format-patch ... | git am ...'.\nA change in git-mailsplit in commit c2ca1d79 introduced a change in\nthe default behaviour of git-mailsplit when splitting mbox patches. It\nmakes dos line endings to unix line endings. With this behaviour it is\nimpossible to apply patches.\n\nThe following patches introduce the '--kepp-cr' parameter to git-am an\nan additional possibility to set '--keep-cr' via configuration for\ngit-mailsplit. Also I added missing description for '--keep-cr' of\ngit-mailsplit.\n\nSecond round:\nI changed 'mailsplit.keep-cr' to 'mailsplit.keepcr' as suggested by Jakub\nand a comment in the testcase.\n\nStefan-W. Hahn (4):\n  git-mailsplit: Show parameter '--keep-cr' in usage and documentation\n  git-mailsplit: add `mailsplit.keepcr` configuration variable.\n  git-am: Add command line parameter `--keep-cr` passing it to\n    git-mailsplit.\n  Adding test for `--keep-cr` for git-mailsplit and git-am.\n\n Documentation/config.txt        |    4 ++\n Documentation/git-mailsplit.txt |    5 ++-\n builtin-mailsplit.c             |   12 ++++++-\n git-am.sh                       |   18 +++++++--\n t/t5101-mailinfo-dos.sh         |   74 +++++++++++++++++++++++++++++++++++++++\n 5 files changed, 107 insertions(+), 6 deletions(-)\n create mode 100644 t/t5101-mailinfo-dos.sh\n"},{"id":"134263","messageId":"1265923579-24900-2-git-send-email-stefan.hahn@s-hahn.de","threadId":"22619","inReplyTo":"1265923579-24900-1-git-send-email-stefan.hahn@s-hahn.de","subject":"[PATCH 1/4] git-mailsplit: Show parameter '--keep-cr' in usage and documentation","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-11T21:26:16Z","receivedAt":"2010-02-11T21:26:16Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>\n---\n Documentation/git-mailsplit.txt |    5 ++++-\n builtin-mailsplit.c             |    2 +-\n 2 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-mailsplit.txt b/Documentation/git-mailsplit.txt\nindex 5cc94ec..a634485 100644\n--- a/Documentation/git-mailsplit.txt\n+++ b/Documentation/git-mailsplit.txt\n@@ -7,7 +7,7 @@ git-mailsplit - Simple UNIX mbox splitter program\n \n SYNOPSIS\n --------\n-'git mailsplit' [-b] [-f<nn>] [-d<prec>] -o<directory> [--] [<mbox>|<Maildir>...]\n+'git mailsplit' [-b] [-f<nn>] [-d<prec>] [--keep-cr] -o<directory> [--] [<mbox>|<Maildir>...]\n \n DESCRIPTION\n -----------\n@@ -43,6 +43,9 @@ OPTIONS\n \tSkip the first <nn> numbers, for example if -f3 is specified,\n \tstart the numbering with 0004.\n \n+--keep-cr::\n+\tDo not remove `\\r` from lines ending with `\\r\\n`.\n+\n Author\n ------\n Written by Linus Torvalds <torvalds@osdl.org>\ndiff --git a/builtin-mailsplit.c b/builtin-mailsplit.c\nindex 207e358..cdfc1b7 100644\n--- a/builtin-mailsplit.c\n+++ b/builtin-mailsplit.c\n@@ -10,7 +10,7 @@\n #include \"strbuf.h\"\n \n static const char git_mailsplit_usage[] =\n-\"git mailsplit [-d<prec>] [-f<n>] [-b] -o<directory> [<mbox>|<Maildir>...]\";\n+\"git mailsplit [-d<prec>] [-f<n>] [-b] [--keep-cr] -o<directory> [<mbox>|<Maildir>...]\";\n \n static int is_from_line(const char *line, int len)\n {\n-- \n1.7.0.rc2.17.g39385\n"},{"id":"134266","messageId":"1265923579-24900-3-git-send-email-stefan.hahn@s-hahn.de","threadId":"22619","inReplyTo":"1265923579-24900-1-git-send-email-stefan.hahn@s-hahn.de","subject":"[PATCH 2/4] git-mailsplit: add `mailsplit.keepcr` configuration variable.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-11T21:26:17Z","receivedAt":"2010-02-11T21:26:17Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"If using git-mailsplit in environments where files with dos and unix\nline ending stay in one repository mbox patches must be split with\nadditional parameter '--keep-cr', because the behaviour of\ngit-mailsplit have been changed in commit c2ca1d79.\n\nWith this patch the behaviour of git-mailsplit can be set via\nconfiguration file.\n\nSigned-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>\n---\n Documentation/config.txt |    4 ++++\n builtin-mailsplit.c      |   10 ++++++++++\n 2 files changed, 14 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 4c36aa9..37a4968 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1246,6 +1246,10 @@ mailmap.file::\n \tsubdirectory, or somewhere outside of the repository itself.\n \tSee linkgit:git-shortlog[1] and linkgit:git-blame[1].\n \n+mailsplit.keepcr::\n+\tIf true git-mailsplit will not remove `\\r` from lines ending\n+\twith `\\r\\n`. See linkgit:git-mailsplit[1].\n+\n man.viewer::\n \tSpecify the programs that may be used to display help in the\n \t'man' format. See linkgit:git-help[1].\ndiff --git a/builtin-mailsplit.c b/builtin-mailsplit.c\nindex cdfc1b7..e76974d 100644\n--- a/builtin-mailsplit.c\n+++ b/builtin-mailsplit.c\n@@ -210,6 +210,15 @@ out:\n \treturn ret;\n }\n \n+static int git_mailsplit_config(const char *var, const char *value, void *cb)\n+{\n+\tif (!strcmp(var, \"mailsplit.keepcr\")) {\n+\t\tkeep_cr = git_config_bool(var, value);\n+\t\treturn 0;\n+\t}\n+\treturn git_default_config(var, value, cb);\n+}\n+\n int cmd_mailsplit(int argc, const char **argv, const char *prefix)\n {\n \tint nr = 0, nr_prec = 4, num = 0;\n@@ -218,6 +227,7 @@ int cmd_mailsplit(int argc, const char **argv, const char *prefix)\n \tconst char **argp;\n \tstatic const char *stdin_only[] = { \"-\", NULL };\n \n+\tgit_config(git_mailsplit_config, NULL);\n \tfor (argp = argv+1; *argp; argp++) {\n \t\tconst char *arg = *argp;\n \n-- \n1.7.0.rc2.17.g39385\n"},{"id":"134264","messageId":"1265923579-24900-4-git-send-email-stefan.hahn@s-hahn.de","threadId":"22619","inReplyTo":"1265923579-24900-1-git-send-email-stefan.hahn@s-hahn.de","subject":"[PATCH 3/4] git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-11T21:26:18Z","receivedAt":"2010-02-11T21:26:18Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"If applying patches with the following command sequence\n\n   git format-patch --stdout ... | git am ...\n\nin repositories having files with dos and unix line endings\ngit-mailsplit, which is called from git-am must be called with\n`--keep-cr` parameter since commit c2ca1d79.\n\nThis patch adds the command line parameter `--keep-cr` for git-am.\n\nSigned-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>\n---\n git-am.sh |   18 ++++++++++++++----\n 1 files changed, 14 insertions(+), 4 deletions(-)\n\ndiff --git a/git-am.sh b/git-am.sh\nindex c8b9cbb..c3101ae 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -15,6 +15,7 @@ q,quiet         be quiet\n s,signoff       add a Signed-off-by line to the commit message\n u,utf8          recode into utf8 (default)\n k,keep          pass -k flag to git-mailinfo\n+e,keep-cr       pass --keep-cr flag to git-mailsplit for mbox format\n c,scissors      strip everything before a scissors line\n whitespace=     pass it through git-apply\n ignore-space-change pass it through git-apply\n@@ -216,10 +217,12 @@ check_patch_format () {\n split_patches () {\n \tcase \"$patch_format\" in\n \tmbox)\n-\t\tcase \"$rebasing\" in\n-\t\t'')\n+\t\tcase \"$rebasing,$keepcr\" in\n+\t\t'','')\n \t\t\tkeep_cr= ;;\n-\t\t?*)\n+\t\t'',t)\n+\t\t\tkeep_cr=--keep-cr ;;\n+\t\t?*,t)\n \t\t\tkeep_cr=--keep-cr ;;\n \t\tesac\n \t\tgit mailsplit -d\"$prec\" -o\"$dotest\" -b $keep_cr -- \"$@\" > \"$dotest/last\" ||\n@@ -290,7 +293,7 @@ split_patches () {\n \n prec=4\n dotest=\"$GIT_DIR/rebase-apply\"\n-sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=\n+sign= utf8=t keep= keepcr= skip= interactive= resolved= rebasing= abort=\n resolvemsg= resume= scissors= no_inbody_headers=\n git_apply_opt=\n committer_date_is_author_date=\n@@ -347,6 +350,8 @@ do\n \t\tallow_rerere_autoupdate=\"$1\" ;;\n \t-q|--quiet)\n \t\tGIT_QUIET=t ;;\n+        -e|--keep-cr)\n+                keepcr=t ;;\n \t--)\n \t\tshift; break ;;\n \t*)\n@@ -452,6 +457,7 @@ else\n \techo \"$sign\" >\"$dotest/sign\"\n \techo \"$utf8\" >\"$dotest/utf8\"\n \techo \"$keep\" >\"$dotest/keep\"\n+\techo \"$keepcr\" >\"$dotest/keepcr\"\n \techo \"$scissors\" >\"$dotest/scissors\"\n \techo \"$no_inbody_headers\" >\"$dotest/no_inbody_headers\"\n \techo \"$GIT_QUIET\" >\"$dotest/quiet\"\n@@ -495,6 +501,10 @@ if test \"$(cat \"$dotest/keep\")\" = t\n then\n \tkeep=-k\n fi\n+if test \"$(cat \"$dotest/keepcr\")\" = t\n+then\n+\tkeepcr=--keep-cr\n+fi\n case \"$(cat \"$dotest/scissors\")\" in\n t)\n \tscissors=--scissors ;;\n-- \n1.7.0.rc2.17.g39385\n"},{"id":"134267","messageId":"1265923579-24900-5-git-send-email-stefan.hahn@s-hahn.de","threadId":"22619","inReplyTo":"1265923579-24900-1-git-send-email-stefan.hahn@s-hahn.de","subject":"[PATCH 4/4] Adding test for `--keep-cr` for git-mailsplit and git-am.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-11T21:26:19Z","receivedAt":"2010-02-11T21:26:19Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"This test adds test for git-mailsplit using dos line endings, the\ncommand sequence 'git format-patch ... | git am ...' and the\nconfiguration variable `mailsplit.keepcr`.\n\nSigned-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>\n---\n t/t5101-mailinfo-dos.sh |   74 +++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 74 insertions(+), 0 deletions(-)\n create mode 100644 t/t5101-mailinfo-dos.sh\n\ndiff --git a/t/t5101-mailinfo-dos.sh b/t/t5101-mailinfo-dos.sh\nnew file mode 100644\nindex 0000000..c6acd55\n--- /dev/null\n+++ b/t/t5101-mailinfo-dos.sh\n@@ -0,0 +1,74 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Stefan-W. Hahn\n+#\n+\n+test_description='git-mailsplit mbox with dos line ending.\n+\n+'\n+. ./test-lib.sh\n+\n+# Three patches which will be added as files with dos line ending.\n+\n+cat > file1 <<\\EOF\n+line 1\n+EOF\n+\n+cat > file2 <<\\EOF\n+line 1\n+line 2\n+EOF\n+\n+cat > file3 <<\\EOF\n+line 1\n+line 2\n+line 3\n+EOF\n+\n+test_expect_success 'setup repository with dos files' '\n+        append_cr <file1 >file\n+        git add file &&\n+        git commit -m Initial &&\n+        git tag start &&\n+        append_cr <file2 >file\n+        git commit -a -m Second &&\n+        git tag start2 &&\n+        append_cr <file3 >file\n+        git commit -a -m Third &&\n+\tgit format-patch -k --stdout start.. > format-patch.diff\n+'\n+\n+test_expect_failure 'mailsplit format-patch of dos files' '\n+        mkdir split &&\n+        git mailsplit -osplit format-patch.diff &&\n+        cat split/0001 split/0002 > mailsplit.diff &&\n+        test_cmp format-patch.diff mailsplit.diff\n+'\n+\n+test_expect_success 'mailsplit --keep-cr format-patch of dos files' '\n+        mkdir split2 &&\n+        git mailsplit --keep-cr -osplit2 format-patch.diff &&\n+        cat split2/0001 split2/0002 > mailsplit2.diff &&\n+        test_cmp format-patch.diff mailsplit2.diff\n+'\n+\n+test_expect_success 'format-patch with dos files --keep-cr' '\n+        git checkout -b new start &&\n+\tgit format-patch -k --stdout start..master | git am --keep-cr -k -3 &&\n+        git diff master\n+'\n+\n+test_expect_success 'format-patch with dos files -e' '\n+        git checkout -b new2 start &&\n+\tgit format-patch -k --stdout start..master | git am -e -k -3 &&\n+        git diff master\n+'\n+\n+test_expect_success 'format-patch with dos files config.mailsplit' '\n+        git config mailsplit.keepcr 1 &&\n+        git checkout -b new3 start &&\n+\tgit format-patch -k --stdout start..master | git am -k -3 &&\n+        git diff master\n+'\n+\n+test_done\n-- \n1.7.0.rc2.17.g39385\n"},{"id":"134274","messageId":"7vocjvqryb.fsf@alter.siamese.dyndns.org","threadId":"22619","inReplyTo":"1265923579-24900-4-git-send-email-stefan.hahn@s-hahn.de","subject":"Re: [PATCH 3/4] git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-11T23:21:32Z","receivedAt":"2010-02-11T23:21:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n\n> If applying patches with the following command sequence\n>\n>    git format-patch --stdout ... | git am ...\n>\n> in repositories having files with dos and unix line endings\n> git-mailsplit, which is called from git-am must be called with\n> `--keep-cr` parameter since commit c2ca1d79.\n\nSorry, I cannot parse this.\n\nPerhaps you meant to have a comma between \"git-am\" and \"must be\"?\n\n> +e,keep-cr       pass --keep-cr flag to git-mailsplit for mbox format\n\nThis short form -e does not make much sense to me.  Why is it -e, and do\nwe even need a short form in the first place?\n\nI'd say we should drop it.  We may want to use short-and-sweet 'e' for\nsomething more important and common, and we would regret for letting this\noption squat on it later.\n\nAnother approach _might_ be to let the user to use --rebasing directly; it\ncurrently is documented as \"internal use\", but as long as we clearly\nspecify its semantics and give a synonym that is more sensible than the\ncurrent name, it might turn out to be a better option.  I dunno; it might\nbe doing more than what this new use case may want to do.\n\n> @@ -216,10 +217,12 @@ check_patch_format () {\n>  split_patches () {\n>  \tcase \"$patch_format\" in\n>  \tmbox)\n> -\t\tcase \"$rebasing\" in\n> -\t\t'')\n> +\t\tcase \"$rebasing,$keepcr\" in\n> +\t\t'','')\n>  \t\t\tkeep_cr= ;;\n> -\t\t?*)\n> +\t\t'',t)\n> +\t\t\tkeep_cr=--keep-cr ;;\n> +\t\t?*,t)\n>  \t\t\tkeep_cr=--keep-cr ;;\n\nDid you mean to say:\n\n\tcase \"$r$k\" in\n        '') keep_cr= ;;\n        ?*) keep_cr=--keep-cr ;;\n        esac\n\nor even:\n\n\tif test -n \"$r$k\"\n        then\n        \tkeep_cr=--keep-cr\n\telse\n        \tkeep_cr=\n\tfi\n"},{"id":"134275","messageId":"7vhbpnqrxr.fsf@alter.siamese.dyndns.org","threadId":"22619","inReplyTo":"1265923579-24900-3-git-send-email-stefan.hahn@s-hahn.de","subject":"Re: [PATCH 2/4] git-mailsplit: add `mailsplit.keepcr` configuration variable.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-11T23:21:52Z","receivedAt":"2010-02-11T23:21:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n\n> If using git-mailsplit in environments where files with dos and unix\n> line ending stay in one repository mbox patches must be split with\n> additional parameter '--keep-cr', because the behaviour of\n> git-mailsplit have been changed in commit c2ca1d79.\n>\n> With this patch the behaviour of git-mailsplit can be set via\n> configuration file.\n\nThis probably is a bad change.  mailsplit is designed to be usable without\nbeing inside any git repository.  With this change, doesn't the command\nstart failing to run when run outside a git repository?\n"},{"id":"134378","messageId":"20100212210336.GB32018@pille.home","threadId":"22619","inReplyTo":"7vhbpnqrxr.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/4] git-mailsplit: add `mailsplit.keepcr` configuration variable.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-12T21:03:36Z","receivedAt":"2010-02-12T21:03:36Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"Also sprach Junio C Hamano am Thu, 11 Feb 2010 at 15:21:52 -0800:\n\n> > With this patch the behaviour of git-mailsplit can be set via\n> > configuration file.\n> \n> This probably is a bad change.  mailsplit is designed to be usable without\n> being inside any git repository.  With this change, doesn't the command\n> start failing to run when run outside a git repository?\n\nOuch, I didn't mind this.\n\nBut perhaps it will be a better aproach to make such a configuration\navailable for git-am. I will make a patch for this soon.\n\nStefan\n\n-- \nStefan-W. Hahn                          It is easy to make things.\n/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.\t\t\t\n\nPlease note that according to the German law on data retention,\ninformation on every electronic information exchange with me is\nretained for a period of six months.\nBundesgesetzblatt:\nhttp://www.bgblportal.de/BGBL/bgbl1f/bgbl107s3198.pdf\n"},{"id":"134380","messageId":"20100212210546.GC32018@pille.home","threadId":"22619","inReplyTo":"7vocjvqryb.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/4] git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-12T21:05:46Z","receivedAt":"2010-02-12T21:05:46Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"Also sprach Junio C Hamano am Thu, 11 Feb 2010 at 15:21:32 -0800:\n> \"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n> \n> > If applying patches with the following command sequence\n> >\n> >    git format-patch --stdout ... | git am ...\n> >\n> > in repositories having files with dos and unix line endings\n> > git-mailsplit, which is called from git-am must be called with\n> > `--keep-cr` parameter since commit c2ca1d79.\n> \n> Sorry, I cannot parse this.\n\nWhat?\n\n> Perhaps you meant to have a comma between \"git-am\" and \"must be\"?\n> \n> > +e,keep-cr       pass --keep-cr flag to git-mailsplit for mbox format\n> \n> This short form -e does not make much sense to me.  Why is it -e, and do\n> we even need a short form in the first place?\n\nJust for shortening the commandline.\n\n> or even:\n> \n> \tif test -n \"$r$k\"\n>         then\n>         \tkeep_cr=--keep-cr\n> \telse\n>         \tkeep_cr=\n> \tfi\n\nThis one. I will make a patch soon.\n\nStefan\n-- \nStefan-W. Hahn                          It is easy to make things.\n/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.\t\t\t\n\nPlease note that according to the German law on data retention,\ninformation on every electronic information exchange with me is\nretained for a period of six months.\nBundesgesetzblatt:\nhttp://www.bgblportal.de/BGBL/bgbl1f/bgbl107s3198.pdf\n"},{"id":"134384","messageId":"7vr5oqnmzr.fsf@alter.siamese.dyndns.org","threadId":"22619","inReplyTo":"20100212210336.GB32018@pille.home","subject":"Re: [PATCH 2/4] git-mailsplit: add `mailsplit.keepcr` configuration variable.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-12T21:49:12Z","receivedAt":"2010-02-12T21:49:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n\n> But perhaps it will be a better aproach to make such a configuration\n> available for git-am. I will make a patch for this soon.\n\nIf a configuration is desired, I think that is probably a saner place to\nput it.\n\nRegardless of where the configuration goes between am and mailsplit, you\nneed to think about the interaction between rebase and am.  You might set\nthe configuration for am---should that automatically and always kick in\nwhen you run rebase?  Do we need some way to override it per invocation\nwhen running rebase?\n"},{"id":"134385","messageId":"7vmxzenmrb.fsf@alter.siamese.dyndns.org","threadId":"22619","inReplyTo":"20100212210546.GC32018@pille.home","subject":"Re: [PATCH 3/4] git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-12T21:54:16Z","receivedAt":"2010-02-12T21:54:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n\n> Also sprach Junio C Hamano am Thu, 11 Feb 2010 at 15:21:32 -0800:\n>> \"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n>> \n>> > If applying patches with the following command sequence\n>> >\n>> >    git format-patch --stdout ... | git am ...\n>> >\n>> > in repositories having files with dos and unix line endings\n>> > git-mailsplit, which is called from git-am must be called with\n>> > `--keep-cr` parameter since commit c2ca1d79.\n>> \n>> Sorry, I cannot parse this.\n>\n> What?\n\nWhat I said.  I wasn't able to parse it.  If it were:\n\n    If applying patches with the following command sequence\n\n       git format-patch --stdout ... | git am ...\n\n    in repositories having files with dos and unix line endings,\n    git-mailsplit, which is called from git-am, must be called with\n    `--keep-cr` parameter since commit c2ca1d79.\n\niow, two additional commas, I would have been able to, but I was not\ncertain that is what you meant.\n\n>> > +e,keep-cr       pass --keep-cr flag to git-mailsplit for mbox format\n>> \n>> This short form -e does not make much sense to me.  Why is it -e, and do\n>> we even need a short form in the first place?\n>\n> Just for shortening the commandline.\n\nThat much I know already ;-) and you probably know that I knew when I\nwrote this, which you somehow omitted from your quote:\n\n    ... We may want to use short-and-sweet 'e' for something more\n    important and common, and we would regret for letting this option\n    squat on it later.\n\nThe shorter one can come later after people find --keep-cr is something\nthey often need to use and deserve a shorter form, but not until then.\n"},{"id":"134387","messageId":"7vocjum7wp.fsf@alter.siamese.dyndns.org","threadId":"22619","inReplyTo":"7vr5oqnmzr.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/4] git-mailsplit: add `mailsplit.keepcr` configuration variable.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-12T22:00:22Z","receivedAt":"2010-02-12T22:00:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Stefan-W. Hahn\" <stefan.hahn@s-hahn.de> writes:\n>\n>> But perhaps it will be a better aproach to make such a configuration\n>> available for git-am. I will make a patch for this soon.\n>\n> If a configuration is desired, I think that is probably a saner place to\n> put it.\n>\n> Regardless of where the configuration goes between am and mailsplit, you\n> need to think about the interaction between rebase and am.  You might set\n> the configuration for am---should that automatically and always kick in\n> when you run rebase?  Do we need some way to override it per invocation\n> when running rebase?\n\nNah, I wasn't thinking straight.  There is no reason to turn it off while\nrebase is running.  That means under --rebasing mode, am should ignore the\nconfiguration and always do keep-cr, even when am.keepcr is set to false.\n\nSorry about the noise.\n"},{"id":"134388","messageId":"20100212220425.GE32018@pille.home","threadId":"22619","inReplyTo":"7vr5oqnmzr.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/4] git-mailsplit: add `mailsplit.keepcr` configuration variable.","fromName":"Stefan-W. Hahn","fromEmail":"stefan.hahn@s-hahn.de","sentAt":"2010-02-12T22:04:25Z","receivedAt":"2010-02-12T22:04:25Z","isPatch":true,"sender":{"key":"stefan.hahn@s-hahn.de","avatar":null},"body":"Also sprach Junio C Hamano am Fri, 12 Feb 2010 at 13:49:12 -0800:\n> Regardless of where the configuration goes between am and mailsplit, you\n> need to think about the interaction between rebase and am.  You might set\n> the configuration for am---should that automatically and always kick in\n> when you run rebase?  Do we need some way to override it per invocation\n> when running rebase?\n\nI did not have had any problem with git-rebase in mixed line ending\nenvironment. If used via git-rebase, git-mailsplit should called\nwith --keep-cr set, independent from configuration for this.\n\nStefan\n\n-- \nStefan-W. Hahn                          It is easy to make things.\n/ mailto:stefan.hahn@s-hahn.de /        It is hard to make things simple.\t\t\t\n\nPlease note that according to the German law on data retention,\ninformation on every electronic information exchange with me is\nretained for a period of six months.\nBundesgesetzblatt:\nhttp://www.bgblportal.de/BGBL/bgbl1f/bgbl107s3198.pdf\n"}]}