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

[PATCH 3/3] add -N option to cg-init (resent again)

From
Bryan Larsen <bryanlarsen@yahoo.com>
Date
Jul 9, 2005, 10:43 UTC
Message-ID
<20050709104331.26765.35929.sendpatchset@bryan-larsens-ibook-g4.local>
In-Reply-To
<20050709104316.26765.86980.sendpatchset@bryan-larsens-ibook-g4.local>
(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
 
Previous: Bryan LarsenNext: Petr Baudis
Message 2 of 3 in “add -N option to cg-commit (resent again)”
  1. 2/3 add -N option to cg-commit (resent again)Bryan Larsen, Jul 9, 2005
  2. 3/3 add -N option to cg-init (resent again)Bryan Larsen, Jul 9, 2005
  3. Petr BaudisJul 10, 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.