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

[PATCH] cg-status: quote head name

From
PRPavel Roskin <proski@gnu.org>
Date
Nov 14, 2005, 22:57 UTC
Message-ID
<1132009061.24084.26.camel@dv>

cg-status should quote head name to deal with branches that have active characters (e.g. spaces) in the name.

Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/cg-status b/cg-status
index b67f505..2cb86be 100755
--- a/cg-status
+++ b/cg-status
@@ -124,8 +124,8 @@ if [ "$gitstatus" ]; then
 
 	echo "Heads:"
 	for head in $_git/refs/heads/*; do
-		headsha1=$(cat $head)
-		headname=$(basename $head)
+		headsha1=$(cat "$head")
+		headname=$(basename "$head")
 		[ "$headname" = "cg-seek-point" ] && continue
 		cf=" "; rf=" "
 		[ "$headname" = "$_git_head" ] && cf=">"
-- 
Regards,
Pavel Roskin
Message 1 of 1 in “cg-status: quote head name”
  1. cg-status: quote head namePavel Roskin, Nov 14, 2005

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.