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

[PATCH] Fix cg-status with recent git versions

From
PRPavel Roskin <proski@gnu.org>
Date
Apr 27, 2006, 22:38 UTC
Message-ID
<20060427223826.10772.55883.stgit@dv.roinet.com>
From: Pavel Roskin <proski@gnu.org>

git-diff-index checks the arguments by lstat(), so an empty string would fail to be recognized as a file. Use "--" to separate files from revisions, and also use "." instead of the empty string.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 cg-status |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cg-status b/cg-status
index d11762e..0529ba2 100755
--- a/cg-status
+++ b/cg-status
@@ -233,7 +233,7 @@ if [ "$workstatus" ]; then
 		commitignore=
 		[ -s "$_git/commit-ignore" ] && commitignore=1
 
-		git-diff-index HEAD "$basepath" | cut -f5- -d' ' | 
+		git-diff-index HEAD -- "${basepath:-.}" | cut -f5- -d' ' | 
 		while IFS=$'\t' read -r mode file; do
 			if [ "$mode" = D ]; then
 				[ "$(git-diff-files "$file")" ] && mode=!
Next: Nicolas Vilz
Message 1 of 2 in “Fix cg-status with recent git versions”
  1. Fix cg-status with recent git versionsPavel Roskin, Apr 27, 2006
  2. Nicolas VilzApr 27, 2006

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.