git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/3] add -N option to cg-add (resent)
@ 2005-07-09 10:40   ` Bryan Larsen
  2005-07-09 10:40     ` [PATCH 2/3] add -N option to cg-commit (resent) Bryan Larsen
                       ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bryan Larsen @ 2005-07-09 10:40 UTC (permalink / raw
  To: bryan.larsen; +Cc: Bryan Larsen, git

(resending cogito patches)

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] add -N option to cg-commit (resent)
  2005-07-09 10:40   ` [PATCH 1/3] add -N option to cg-add (resent) Bryan Larsen
@ 2005-07-09 10:40     ` Bryan Larsen
  2005-07-09 10:40     ` [PATCH 3/3] add -N option to cg-init (resent) Bryan Larsen
  2005-07-10 15:17     ` [PATCH 1/3] add -N option to cg-add (resent) Petr Baudis
  2 siblings, 0 replies; 6+ messages in thread
From: Bryan Larsen @ 2005-07-09 10:40 UTC (permalink / raw
  To: bryan.larsen; +Cc: Bryan Larsen, git

(resending cogito patches)

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] add -N option to cg-init (resent)
  2005-07-09 10:40   ` [PATCH 1/3] add -N option to cg-add (resent) Bryan Larsen
  2005-07-09 10:40     ` [PATCH 2/3] add -N option to cg-commit (resent) Bryan Larsen
@ 2005-07-09 10:40     ` Bryan Larsen
  2005-07-10 15:17     ` [PATCH 1/3] add -N option to cg-add (resent) Petr Baudis
  2 siblings, 0 replies; 6+ messages in thread
From: Bryan Larsen @ 2005-07-09 10:40 UTC (permalink / raw
  To: bryan.larsen; +Cc: Bryan Larsen, git

(resending cogito patches)

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] add -N option to cg-commit (resent again)
@ 2005-07-09 10:43 Bryan Larsen
  2005-07-09 10:43 ` [PATCH 3/3] add -N option to cg-init " Bryan Larsen
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan Larsen @ 2005-07-09 10:43 UTC (permalink / raw
  To: bryan.larsen; +Cc: Bryan Larsen, git

(resending cogito patches)

Add the -N option to cg-commit.

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

 cg-commit |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/cg-commit b/cg-commit
--- a/cg-commit
+++ b/cg-commit
@@ -39,6 +39,10 @@
 #	the tree is the same as the last time you committed, no changes
 #	happenned.
 #
+# -N::
+#   Don't add the files to the object database, just update the caches
+#   and the commit information.
+#
 # FILES
 # -----
 # $GIT_DIR/author::
@@ -103,11 +107,16 @@ fi
 force=
 forceeditor=
 ignorecache=
+infoonly=
 commitalways=
+nocheck=
 msgs=()
 while optparse; do
 	if optparse -C; then
 		ignorecache=1
+	elif optparse -N; then
+		nocheck=--no-check
+		infoonly=--info-only
 	elif optparse -e; then
 		forceeditor=1
 	elif optparse -E; then
@@ -278,9 +287,9 @@ precommit_update () {
 		eval "queue$op[\${#queue$op[@]}]=\"\$fname\""
 	done
 	# XXX: Do we even need to do the --add and --remove update-caches?
-	[ "$queueN" ] && { git-update-cache --add -- "${queueN[@]}" || return 1; }
+	[ "$queueN" ] && { git-update-cache --add ${infoonly} -- "${queueN[@]}" || return 1; }
 	[ "$queueD" ] && { git-update-cache --force-remove -- "${queueD[@]}" || return 1; }
-	[ "$queueM" ] && { git-update-cache -- "${queueM[@]}" || return 1; }
+	[ "$queueM" ] && { git-update-cache ${infoonly} -- "${queueM[@]}" || return 1; }
 	return 0
 }
 
@@ -300,7 +309,7 @@ if [ -s "$_git/HEAD" ]; then
 	oldheadstr="-p $oldhead"
 fi
 
-treeid=$(git-write-tree)
+treeid=$(git-write-tree ${nocheck})
 [ "$treeid" ] || die "git-write-tree failed"
 if [ ! "$force" ] && [ ! "$merging" ] && [ "$oldhead" ] &&
    [ "$treeid" = "$(tree-id)" ]; then


\f

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] add -N option to cg-init (resent again)
  2005-07-09 10:43 [PATCH 2/3] add -N option to cg-commit (resent again) Bryan Larsen
@ 2005-07-09 10:43 ` Bryan Larsen
  2005-07-09 10:40   ` [PATCH 1/3] add -N option to cg-add (resent) Bryan Larsen
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan Larsen @ 2005-07-09 10:43 UTC (permalink / raw
  To: bryan.larsen; +Cc: Bryan Larsen, git

(resending cogito patches)

add the -N option to cg-init

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

 cg-init |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/cg-init b/cg-init
--- a/cg-init
+++ b/cg-init
@@ -10,13 +10,29 @@
 #
 # If `cg-init` is run in a non-empty directory files in the top and
 # sub directory will automatically be added.
+#
+# OPTIONS
+# -------
+# -N::
+#   Only update the cache: do not copy the data into the object database.
+#
 
-USAGE="cg-init"
+USAGE="cg-init [-N]"
 _git_repo_unneeded=1
 
 . ${COGITO_LIB}cg-Xlib
 
-uri=$1
+
+infoonly=
+while optparse; do
+	if optparse -N; then
+		infoonly=-N
+	else
+		optfail
+	fi
+done
+
+uri=$ARGV
 
 [ -e $_git ] && die "$_git already exists"
 
@@ -38,7 +54,7 @@ if [ "$uri" ]; then
 	echo "Cloned (origin $uri available as branch \"origin\")"
 else
 	git-read-tree # Seed the dircache
-	find * \( -type f -o -type l \) -print0 | xargs -0r cg-add
+	find * \( -type f -o -type l \) -print0 | xargs -0r cg-add ${infoonly}
 	cg-commit -C -m"Initial commit" -E
 fi
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/3] add -N option to cg-add (resent)
  2005-07-09 10:40   ` [PATCH 1/3] add -N option to cg-add (resent) Bryan Larsen
  2005-07-09 10:40     ` [PATCH 2/3] add -N option to cg-commit (resent) Bryan Larsen
  2005-07-09 10:40     ` [PATCH 3/3] add -N option to cg-init (resent) Bryan Larsen
@ 2005-07-10 15:17     ` Petr Baudis
  2 siblings, 0 replies; 6+ messages in thread
From: Petr Baudis @ 2005-07-10 15:17 UTC (permalink / raw
  To: Bryan Larsen; +Cc: bryan.larsen, git

Dear diary, on Sat, Jul 09, 2005 at 12:40:22PM CEST, I got a letter
where Bryan Larsen <bryanlarsen@yahoo.com> told me that...
> (resending cogito patches)
> 
> Add the -N option to cg-add.
> 
> Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>

Applied all three patches. Note that I'm a bit happier when they are a
little more maintainer-friendly - it helps to describe why are you
resending them, and be a little more verbose in the accompanying
message. :-)

Thanks,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
<Espy> be careful, some twit might quote you out of context..

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-07-10 15:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-09 10:43 [PATCH 2/3] add -N option to cg-commit (resent again) Bryan Larsen
2005-07-09 10:43 ` [PATCH 3/3] add -N option to cg-init " Bryan Larsen
2005-07-09 10:40   ` [PATCH 1/3] add -N option to cg-add (resent) Bryan Larsen
2005-07-09 10:40     ` [PATCH 2/3] add -N option to cg-commit (resent) Bryan Larsen
2005-07-09 10:40     ` [PATCH 3/3] add -N option to cg-init (resent) Bryan Larsen
2005-07-10 15:17     ` [PATCH 1/3] add -N option to cg-add (resent) Petr Baudis

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).