{"thread":{"id":"39230","subject":"[PATCH] contrib/subtree: fix linefeeds trimming for cmd_split()","startedAt":"2015-05-04T06:13:56Z","lastAt":"2015-05-04T21:14:08Z","messageCount":2,"participants":["Danny Lin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"260503","messageId":"CAMbsUu4aCntGYW4iy+awx2WA89rUcPHZQYQFK0+FRyp9DQB6Fw@mail.gmail.com","threadId":"39230","inReplyTo":null,"subject":"[PATCH] contrib/subtree: fix linefeeds trimming for cmd_split()","fromName":"Danny Lin","fromEmail":"danny0838@gmail.com","sentAt":"2015-05-04T06:13:56Z","receivedAt":"2015-05-04T06:13:56Z","isPatch":true,"sender":{"key":"danny0838@gmail.com","avatar":"https://avatars.githubusercontent.com/u/531417?v=4"},"body":"\n\n\nFrom dc549b6b4ec36f8faf9c6f7bb1e343ef7babd14f Mon Sep 17 00:00:00 2001\nFrom: Danny Lin <danny0838@gmail.com>\nDate: Mon, 4 May 2015 14:09:38 +0800\nSubject: [PATCH] contrib/subtree: fix linefeeds trimming for cmd_split()\n\ncmd_split() prints the info message using \"say -n\", which\nmakes no sense and could cause the linefeed be trimmed in\nsome cases. This patch fixes the issue.\n---\n contrib/subtree/git-subtree.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\nindex fa1a583..28a1377 100755\n--- a/contrib/subtree/git-subtree.sh\n+++ b/contrib/subtree/git-subtree.sh\n@@ -599,7 +599,7 @@ cmd_split()\n \teval \"$grl\" |\n \twhile read rev parents; do\n \t\trevcount=$(($revcount + 1))\n-\t\tsay -n \"$revcount/$revmax ($createcount)\r\"\n+\t\tsay \"$revcount/$revmax ($createcount)\"\n \t\tdebug \"Processing commit: $rev\"\n \t\texists=$(cache_get $rev)\n \t\tif [ -n \"$exists\" ]; then\n-- \n2.3.7.windows.1\n\n"},{"id":"260552","messageId":"xmqqpp6goxjz.fsf@gitster.dls.corp.google.com","threadId":"39230","inReplyTo":"CAMbsUu4aCntGYW4iy+awx2WA89rUcPHZQYQFK0+FRyp9DQB6Fw@mail.gmail.com","subject":"Re: [PATCH] contrib/subtree: fix linefeeds trimming for cmd_split()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-05-04T21:14:08Z","receivedAt":"2015-05-04T21:14:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Danny Lin <danny0838@gmail.com> writes:\n\n> From dc549b6b4ec36f8faf9c6f7bb1e343ef7babd14f Mon Sep 17 00:00:00 2001\n> From: Danny Lin <danny0838@gmail.com>\n> Date: Mon, 4 May 2015 14:09:38 +0800\n> Subject: [PATCH] contrib/subtree: fix linefeeds trimming for cmd_split()\n\nPlease do not use multipart/mixed attachments, but instead inline\nyour patch.  When doing so, please drop all these four lines above.\n\n>\n> cmd_split() prints the info message using \"say -n\", which\n> makes no sense and could cause the linefeed be trimmed in\n> some cases. This patch fixes the issue.\n\nI think this was written knowing that \"say\" is merely a thin wrapper\nof \"echo\" (which is a bad manner but happens to be correct) and\nassuming that everybody's \"echo\" understands \"-n\" (which is not a\ngood assumption) to implement \"progress display\" that shows the \"N\nout of M done\" output over and over on the same physical line.\n\nSo,... contrary to your \"makes no sense\" claim, what it tries to do\nmakes perfect sense to me, even though its execution seems somewhat\npoor.\n\n> ---\n>  contrib/subtree/git-subtree.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh\n> index fa1a583..28a1377 100755\n> --- a/contrib/subtree/git-subtree.sh\n> +++ b/contrib/subtree/git-subtree.sh\n> @@ -599,7 +599,7 @@ cmd_split()\n>  \teval \"$grl\" |\n>  \twhile read rev parents; do\n>  \t\trevcount=$(($revcount + 1))\n> -\t\tsay -n \"$revcount/$revmax ($createcount)\"\n> +\t\tsay \"$revcount/$revmax ($createcount)\"\n>  \t\tdebug \"Processing commit: $rev\"\n>  \t\texists=$(cache_get $rev)\n>  \t\tif [ -n \"$exists\" ]; then\n"}]}