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

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

From
Bryan Larsen <bryanlarsen@yahoo.com>
Date
Jul 9, 2005, 10:43 UTC
Message-ID
<20050709104316.26765.86980.sendpatchset@bryan-larsens-ibook-g4.local>
(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



Next: Bryan Larsen
Message 1 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.