{"thread":{"id":"858","subject":"[PATCH] fix cg-commit new file handling","startedAt":"2005-06-08T05:59:42Z","lastAt":"2005-06-08T05:59:42Z","messageCount":1,"participants":["Eugene Surovegin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4687","messageId":"20050608055942.GA7151@gate.ebshome.net","threadId":"858","inReplyTo":null,"subject":"[PATCH] fix cg-commit new file handling","fromName":"Eugene Surovegin","fromEmail":"ebs@ebshome.net","sentAt":"2005-06-08T05:59:42Z","receivedAt":"2005-06-08T05:59:42Z","isPatch":true,"sender":{"key":"ebs@ebshome.net","avatar":null},"body":"Hi!\n\nThere is a problem with committing new files with the current cogito \nversion.\n\nI got an error like this: \n  fatal: Unable to add arch/ppc/kernel/dcr.S to database\n\nI think this is caused by the incorrect file list parsing in \ncg-commit precommit_update(): it expects new files prefixed with \"A\", \nwhile they are prefixed with \"N\".\n\nThe following trivial patch fixes this.\n\nSigned-off-by: Eugene Surovegin <ebs@ebshome.net>\n\ndiff --git a/cg-commit b/cg-commit\n--- a/cg-commit\n+++ b/cg-commit\n@@ -227,7 +227,7 @@ precommit_update () {\n \tfor file in \"$@\"; do\n \t\top=${file%% *}\n \t\tfname=${file#* }\n-\t\t[ \"$op\" = \"A\" ] || [ \"$op\" = \"D\" ] || [ \"$op\" = \"M\" ] || op=M\n+\t\t[ \"$op\" = \"N\" ] || [ \"$op\" = \"D\" ] || [ \"$op\" = \"M\" ] || op=M\n \t\teval \"queue$op[\\${#queue$op[@]}]=\\\"\\$fname\\\"\"\n \tdone\n \t# XXX: Do we even need to do the --add and --remove update-caches?\n\n\n"}]}