git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-subtree: Avoid using echo -n even indirectly

From
Paolo G. Giarrusso <p.giarrusso@gmail.com>
Date
Oct 9, 2013, 03:57 UTC
Message-ID
<1381291045-98372-1-git-send-email-p.giarrusso@gmail.com>

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
Next: Tay Ray Chuan
Message 1 of 9 in “git-subtree: Avoid using echo -n even indirectly”
  1. git-subtree: Avoid using echo -n even indirectlyPaolo G. Giarrusso, Oct 9, 2013
  2. Tay Ray ChuanOct 9, 2013
  3. Fwd: [PATCH] git-subtree: Avoid using echo -n even indirectlyPaolo Giarrusso, Oct 9, 2013
  4. Johannes SixtOct 9, 2013
  5. Matthieu MoyOct 9, 2013
  6. Paolo GiarrussoOct 9, 2013
  7. Jeff KingOct 9, 2013
  8. Jonathan NiederOct 9, 2013
  9. Paolo GiarrussoOct 11, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.