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

[PATCH 3/3] am: simplify "sq" function by using "git rev-parse --sq-quote"

From
Christian Couder <chriscool@tuxfamily.org>
Date
Apr 24, 2009, 06:29 UTC
Message-ID
<20090424062902.3705.34448.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-am.sh |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 6d1848b..578780b 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -44,11 +44,7 @@ else
 fi
 
 sq () {
-	for sqarg
-	do
-		printf "%s" "$sqarg" |
-		sed -e 's/'\''/'\''\\'\'''\''/g' -e 's/.*/ '\''&'\''/'
-	done
+	git rev-parse --sq-quote "$@"
 }
 
 stop_here () {
-- 
1.6.3.rc1.112.g17e25
Message 1 of 1 in “am: simplify "sq" function by using "git rev-parse --sq-quote"”
  1. 3/3 am: simplify "sq" function by using "git rev-parse --sq-quote"Christian Couder, Apr 24, 2009

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.