All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Danny Lin <danny0838@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] contrib/subtree: fix linefeeds trimming for cmd_split()
Date: Mon, 04 May 2015 14:14:08 -0700	[thread overview]
Message-ID: <xmqqpp6goxjz.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAMbsUu4aCntGYW4iy+awx2WA89rUcPHZQYQFK0+FRyp9DQB6Fw@mail.gmail.com> (Danny Lin's message of "Mon, 4 May 2015 14:13:56 +0800")

Danny Lin <danny0838@gmail.com> writes:

> From dc549b6b4ec36f8faf9c6f7bb1e343ef7babd14f Mon Sep 17 00:00:00 2001
> From: Danny Lin <danny0838@gmail.com>
> Date: Mon, 4 May 2015 14:09:38 +0800
> Subject: [PATCH] contrib/subtree: fix linefeeds trimming for cmd_split()

Please do not use multipart/mixed attachments, but instead inline
your patch.  When doing so, please drop all these four lines above.

>
> cmd_split() prints the info message using "say -n", which
> makes no sense and could cause the linefeed be trimmed in
> some cases. This patch fixes the issue.

I think this was written knowing that "say" is merely a thin wrapper
of "echo" (which is a bad manner but happens to be correct) and
assuming that everybody's "echo" understands "-n" (which is not a
good assumption) to implement "progress display" that shows the "N
out of M done" output over and over on the same physical line.

So,... contrary to your "makes no sense" claim, what it tries to do
makes perfect sense to me, even though its execution seems somewhat
poor.

> ---
>  contrib/subtree/git-subtree.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index fa1a583..28a1377 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -599,7 +599,7 @@ cmd_split()
>  	eval "$grl" |
>  	while read rev parents; do
>  		revcount=$(($revcount + 1))
> -		say -n "$revcount/$revmax ($createcount)"
> +		say "$revcount/$revmax ($createcount)"
>  		debug "Processing commit: $rev"
>  		exists=$(cache_get $rev)
>  		if [ -n "$exists" ]; then

  reply	other threads:[~2015-05-04 21:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04  6:13 [PATCH] contrib/subtree: fix linefeeds trimming for cmd_split() Danny Lin
2015-05-04 21:14 ` Junio C Hamano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-05-05 17:20 Danny Lin
2015-05-05 19:11 ` Junio C Hamano
2015-05-06  9:57   ` Danny Lin
2015-05-06 17:16     ` Junio C Hamano
2015-05-06 18:58       ` Danny Lin
2015-05-06 19:49         ` Junio C Hamano
2015-05-06 19:58           ` Eric Sunshine
2015-05-07  3:39 Danny Lin
2015-05-07  3:43 ` Danny Lin
2015-05-07  5:10   ` Danny Lin
2015-05-07 18:33     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqpp6goxjz.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=danny0838@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.