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

[PATCH] fix cg-commit new file handling

From
ESEugene Surovegin <ebs@ebshome.net>
Date
Jun 8, 2005, 05:59 UTC
Message-ID
<20050608055942.GA7151@gate.ebshome.net>
Hi!

There is a problem with committing new files with the current cogito version.

I got an error like this: 
  fatal: Unable to add arch/ppc/kernel/dcr.S to database

I think this is caused by the incorrect file list parsing in cg-commit precommit_update(): it expects new files prefixed with "A", while they are prefixed with "N".

The following trivial patch fixes this.
Signed-off-by: Eugene Surovegin <ebs@ebshome.net>
diff --git a/cg-commit b/cg-commit
--- a/cg-commit
+++ b/cg-commit
@@ -227,7 +227,7 @@ precommit_update () {
 	for file in "$@"; do
 		op=${file%% *}
 		fname=${file#* }
-		[ "$op" = "A" ] || [ "$op" = "D" ] || [ "$op" = "M" ] || op=M
+		[ "$op" = "N" ] || [ "$op" = "D" ] || [ "$op" = "M" ] || op=M
 		eval "queue$op[\${#queue$op[@]}]=\"\$fname\""
 	done
 	# XXX: Do we even need to do the --add and --remove update-caches?
Message 1 of 1 in “fix cg-commit new file handling”
  1. fix cg-commit new file handlingEugene Surovegin, Jun 8, 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.