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

Re: [COGITO PATCH] Allow file list for cg-add through stdin

From
Jochen Roemling <jochen@roemling.net>
Date
May 29, 2005, 20:22 UTC
Message-ID
<429A24A1.1010402@roemling.net>
In-Reply-To
<20050529184642.GL1036@pasky.ji.cz>
Petr Baudis wrote:
Show 5 quoted lines
>But a patch for cg-add processing directories recursively would be great
>anyway... ;-)
>
>  
>
Okay, okay, what about this one:
[Cogito PATCH] Add directories recursively  with cg-add
Signed-off-by: Jochen Roemling <jochen@roemling.net>
--- a/cg-add

+++ b/cg-add

@@ -10,12 +10,11 @@

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

-for file in "$@"; do

-	if [ -f "$file" ] || [ -h "$file" ]; then

-		echo "Adding file $file"

-	else

-		die "$file does not exist"

-	fi

-done

+TMPFILE="${TMP:-/tmp}/$(basename $0).$$.tmp"

-git-update-cache --add -- "$@"

+find $@ -type f > $TMPFILE || die "not all files do exist, nothing added"

+

+cat $TMPFILE | awk '{print "Adding file "  $0}' 

+cat $TMPFILE | xargs git-update-cache --add -- 

+

+rm -f $TMPFILE
Previous: Petr Baudis
Message 4 of 4 in “Allow file list for cg-add through stdin”
  1. Allow file list for cg-add through stdinJochen Roemling, May 29, 2005
  2. Petr BaudisMay 29, 2005
  3. Petr BaudisMay 29, 2005
  4. Jochen RoemlingMay 29, 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.