{"thread":{"id":"1170","subject":"[PATCH] 6/7 Add the -N option to cg-commit.","startedAt":"2005-07-08T10:54:51Z","lastAt":"2005-07-08T10:54:51Z","messageCount":1,"participants":["Bryan Larsen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"5820","messageId":"42CE5B7B.7000503@gmail.com","threadId":"1170","inReplyTo":null,"subject":"[PATCH] 6/7 Add the -N option to cg-commit.","fromName":"Bryan Larsen","fromEmail":"bryan.larsen@gmail.com","sentAt":"2005-07-08T10:54:51Z","receivedAt":"2005-07-08T10:54:51Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"\n\nAdd the -N option to cg-commit.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n\n  cg-commit |   15 ++++++++++++---\n  1 files changed, 12 insertions(+), 3 deletions(-)\n\ndiff --git a/cg-commit b/cg-commit\n--- a/cg-commit\n+++ b/cg-commit\n@@ -39,6 +39,10 @@\n  #\tthe tree is the same as the last time you committed, no changes\n  #\thappenned.\n  #\n+# -N::\n+#   Don't add the files to the object database, just update the caches\n+#   and the commit information.\n+#\n  # FILES\n  # -----\n  # $GIT_DIR/author::\n@@ -103,11 +107,16 @@ fi\n  force=\n  forceeditor=\n  ignorecache=\n+infoonly=\n  commitalways=\n+nocheck=\n  msgs=()\n  while optparse; do\n  \tif optparse -C; then\n  \t\tignorecache=1\n+\telif optparse -N; then\n+\t\tnocheck=--no-check\n+\t\tinfoonly=--info-only\n  \telif optparse -e; then\n  \t\tforceeditor=1\n  \telif optparse -E; then\n@@ -278,9 +287,9 @@ precommit_update () {\n  \t\teval \"queue$op[\\${#queue$op[@]}]=\\\"\\$fname\\\"\"\n  \tdone\n  \t# XXX: Do we even need to do the --add and --remove update-caches?\n-\t[ \"$queueN\" ] && { git-update-cache --add -- \"${queueN[@]}\" || return 1; }\n+\t[ \"$queueN\" ] && { git-update-cache --add ${infoonly} -- \n\"${queueN[@]}\" || return 1; }\n  \t[ \"$queueD\" ] && { git-update-cache --force-remove -- \"${queueD[@]}\" \n|| return 1; }\n-\t[ \"$queueM\" ] && { git-update-cache -- \"${queueM[@]}\" || return 1; }\n+\t[ \"$queueM\" ] && { git-update-cache ${infoonly} -- \"${queueM[@]}\" || \nreturn 1; }\n  \treturn 0\n  }\n\n@@ -300,7 +309,7 @@ if [ -s \"$_git/HEAD\" ]; then\n  \toldheadstr=\"-p $oldhead\"\n  fi\n\n-treeid=$(git-write-tree)\n+treeid=$(git-write-tree ${nocheck})\n  [ \"$treeid\" ] || die \"git-write-tree failed\"\n  if [ ! \"$force\" ] && [ ! \"$merging\" ] && [ \"$oldhead\" ] &&\n     [ \"$treeid\" = \"$(tree-id)\" ]; then\n\n\n\f\n"}]}