git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@myrealbox.com>
To: Petr Baudis <pasky@ucw.cz>
Cc: git@vger.kernel.org
Subject: [PATCH] cg-add only checks if the first file exists
Date: Sat, 30 Apr 2005 09:39:02 -0700	[thread overview]
Message-ID: <4273B4A6.10103@myrealbox.com> (raw)

[apologies for possible dupe -- my mailer freaked out]

Doing:
cg-add foo bar
fails if foo doesn't exist but doesn't check for bar.  It also gives 
misleading reports to stdout.

I've fixed it at rsync://www.luto.us/cogito.git

Patch attached below as well.

--
Changed cg-add to check each added file for existence.

---
commit 9eb8efee632b6270a436d8088315856712bb5b32
tree cba76f974b1840640ccfa14b0118e1dc4a704876
parent 49612c471eebd26efe926a71752e254c1cdc382d
author Andy Lutomirski <luto@myrealbox.com> 1114878247 -0700
committer Andy Lutomirski <luto@myrealbox.com> 1114878247 -0700

Index: cg-add
===================================================================
--- c3aa1e6b53cc59d5fbe261f3f859584904ae3a63/cg-add  (mode:100755 
sha1:83f0b13f41599104d741ac91c7aa81497cd37d5f)
+++ cba76f974b1840640ccfa14b0118e1dc4a704876/cg-add  (mode:100755 
sha1:c84792450cec279f7b3eb1dec03b69ac07dbe9d9)
@@ -10,10 +10,12 @@

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

-if [ -f "$1" ]; then
-       echo "Adding file $1"
-else
-       die "$1 does not exist"
-fi
+for i in "$@"; do
+       if [ -f "$i" ]; then
+              echo "Adding file $i"
+       else
+              die "$i does not exist"
+       fi
+done

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

                 reply	other threads:[~2005-04-30 16:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4273B4A6.10103@myrealbox.com \
    --to=luto@myrealbox.com \
    --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).