From: Jochen Roemling <jochen@roemling.net>
To: Petr Baudis <pasky@ucw.cz>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [COGITO PATCH] Allow file list for cg-add through stdin
Date: Sun, 29 May 2005 22:22:57 +0200 [thread overview]
Message-ID: <429A24A1.1010402@roemling.net> (raw)
In-Reply-To: <20050529184642.GL1036@pasky.ji.cz>
Petr Baudis wrote:
>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
prev parent reply other threads:[~2005-05-29 20:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-29 17:40 [COGITO PATCH] Allow file list for cg-add through stdin Jochen Roemling
2005-05-29 18:04 ` Petr Baudis
[not found] ` <429A0818.6080807@roemling.net>
2005-05-29 18:46 ` Petr Baudis
2005-05-29 20:22 ` Jochen Roemling [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=429A24A1.1010402@roemling.net \
--to=jochen@roemling.net \
--cc=git@vger.kernel.org \
--cc=pasky@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).