From: Bryan Larsen <bryan.larsen@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] 6/7 Add the -N option to cg-commit.
Date: Fri, 08 Jul 2005 06:54:51 -0400 [thread overview]
Message-ID: <42CE5B7B.7000503@gmail.com> (raw)
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
reply other threads:[~2005-07-08 11:09 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=42CE5B7B.7000503@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).