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

[PATCH] cg-add checks to see if file exists

From
RHRhys Hardwick <rhys@rhyshardwick.co.uk>
Date
Apr 26, 2005, 22:17 UTC
Message-ID
<200504262317.49739.rhys@rhyshardwick.co.uk>
Hi,

This is a patch to check if the file being added exists, and if not, issues a warning and dies.

Rhys
Signed-off-by: Rhys Hardwick <rhys@rhyshardwick.co.uk
Index: cg-add
===================================================================
--- 6159f313b10f0cfcdfedd63d6fb044029fe46aaa/cg-add  (mode:100755 
sha1:8ba5351a4c7e28a577ea1aa4afa1078c54e9bccc)
+++ uncommitted/cg-add  (mode:100755)
@@ -10,4 +10,10 @@

 [ "$1" ] || die "usage: cg-add FILE..."

+if [ -f "$1" ]; then
+       echo "Adding file $1"
+else
+       die "$1 does not exist"
+fi
+
 update-cache --add -- "$@"
Message 1 of 1 in “cg-add checks to see if file exists”
  1. cg-add checks to see if file existsRhys Hardwick, Apr 26, 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.