git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-subtree: Avoid using echo -n even indirectly
@ 2013-10-09  3:57 Paolo G. Giarrusso
  2013-10-09 10:20 ` Tay Ray Chuan
  0 siblings, 1 reply; 10+ messages in thread
From: Paolo G. Giarrusso @ 2013-10-09  3:57 UTC (permalink / raw)
  To: git; +Cc: Paolo G. Giarrusso

Since say uses echo, this uses echo -n, which is not portable - see
19c3c5fdcb35b66b792534c5dc4e8d87a3952d2a.

Without this commit, the output looks like:

...
-n 1891/    1936 (1883)
-n 1892/    1936 (1884)
-n 1893/    1936 (1885)
...

Signed-off-by: Paolo G. Giarrusso <p.giarrusso@gmail.com>
---

Please CC me on replies, as I am not subscribed to this mailing list.
I am tracking this submission via https://github.com/git/git/pull/61, which I'll
duly close myself when the discussion is resolved.

 contrib/subtree/git-subtree.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
index 7d7af03..ebfb78f 100755
--- a/contrib/subtree/git-subtree.sh
+++ b/contrib/subtree/git-subtree.sh
@@ -592,7 +592,9 @@ cmd_split()
 	eval "$grl" |
 	while read rev parents; do
 		revcount=$(($revcount + 1))
-		say -n "$revcount/$revmax ($createcount)
"
+		if [ -z "$quiet" ]; then
+			printf "%s" "$revcount/$revmax ($createcount)
" >&2
+		fi
 		debug "Processing commit: $rev"
 		exists=$(cache_get $rev)
 		if [ -n "$exists" ]; then
-- 
1.8.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* Re: Fwd: [PATCH] git-subtree: Avoid using echo -n even indirectly
@ 2013-10-28 14:04 Paolo Giarrusso
  0 siblings, 0 replies; 10+ messages in thread
From: Paolo Giarrusso @ 2013-10-28 14:04 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Tay Ray Chuan, Git Mailing List, David A. Greene

(Resending without HTML, so that it reaches the ML).

On Fri, Oct 11, 2013 at 11:32 AM, Paolo Giarrusso <p.giarrusso@gmail.com> wrote:
>
> On Wed, Oct 9, 2013 at 11:11 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> > Paolo Giarrusso wrote:
> >
> >> Seeing the email, I wonder whether there's hope something like that
> >> can be preserved in an email, and whether the code should use some
> >> escape sequence instead.
> >
> > Yes, please.  Mind if I amend it to
> >
> >         printf "%s\r" "$revcount/$revmax ($createcount)" >&2
> >
> > ?
>
> Please do go ahead, by all means (arguably as a different commit, but
> those are minor details).

What happened? Did you go ahead, as you wrote? Is the patch somewhere?
Arguably it should go into the maint branch, but I think it didn't —
otherwise https://github.com/git/git/pull/61 should have stopped being
mergeable.

This also makes me wonder whether you use any tracker at all — but
unless there is one that I missed, that's a separate discussion.

> > [...]
> >>>         say()
> >>>         {
> >>>                 if [ -z "$quiet" ]; then
> >>>                         echo "$@" >&2
> >>>                fi
> >>>         }
> >
> > I agree with the other reviewers that this should be fixed to use
> > printf, too, but that's another topic.
> Seconded.

-- 
Paolo G. Giarrusso - Ph.D. Student, Philipps-University Marburg
http://www.informatik.uni-marburg.de/~pgiarrusso/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-10-28 14:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-09  3:57 [PATCH] git-subtree: Avoid using echo -n even indirectly Paolo G. Giarrusso
2013-10-09 10:20 ` Tay Ray Chuan
     [not found]   ` <CAAcnjCT1bdR+9kDW=q_326OhiSMm3_j-yOh0-ayTkObK3bZ3bQ@mail.gmail.com>
2013-10-09 10:32     ` Fwd: " Paolo Giarrusso
2013-10-09 10:46       ` Johannes Sixt
2013-10-09 11:26       ` Matthieu Moy
2013-10-09 12:03         ` Paolo Giarrusso
2013-10-09 19:48           ` Jeff King
2013-10-09 21:11       ` Jonathan Nieder
2013-10-11  9:32         ` Paolo Giarrusso
  -- strict thread matches above, loose matches on Subject: below --
2013-10-28 14:04 Paolo Giarrusso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).