git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Larsen <bryan.larsen@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] 5/7 Add the -N option to cg-add.
Date: Fri, 08 Jul 2005 06:54:44 -0400	[thread overview]
Message-ID: <42CE5B74.8090409@gmail.com> (raw)



Add the -N option to cg-add.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

  cg-add |   21 ++++++++++++++++++---
  1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/cg-add b/cg-add
--- a/cg-add
+++ b/cg-add
@@ -13,20 +13,35 @@
  # is that 'Cogito' manages content and empty directories have no content.
  # Instead, directories are added automatically when adding files inside
  # them.
+#
+# OPTIONS
+# -------
+# -N::
+#   Only update the cache: do not copy the data into the object database.
+#

-USAGE="cg-add FILE..."
+USAGE="cg-add [-N] FILE..."

  . ${COGITO_LIB}cg-Xlib

  [ "$1" ] || usage

+infoonly=
+while optparse; do
+	if optparse -N; then
+		infoonly=--info-only
+	else
+		optfail
+	fi
+done
+
  TMPFILE=$(mktemp -t gitadd.XXXXXX) || exit 1
-find "$@" -type f -print0 > $TMPFILE || {
+find "${ARGS[@]}" -type f -print0 > $TMPFILE || {
  	die "not all files exist, nothing added"
  	rm $TMPFILE
  }

  cat $TMPFILE | tr '\0' '\n' | sed 's/^/Adding file /'
-cat $TMPFILE | xargs -0r git-update-cache --add --
+cat $TMPFILE | xargs -0r git-update-cache --add ${infoonly} --

  rm $TMPFILE


\f

                 reply	other threads:[~2005-07-08 11:11 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=42CE5B74.8090409@gmail.com \
    --to=bryan.larsen@gmail.com \
    --cc=git@vger.kernel.org \
    /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).