{"thread":{"id":"1187","subject":"[PATCH 2/3] add -N option to cg-commit (resent again)","startedAt":"2005-07-09T10:43:30Z","lastAt":"2005-07-10T15:17:18Z","messageCount":3,"participants":["Bryan Larsen","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"5859","messageId":"20050709104316.26765.86980.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1187","inReplyTo":null,"subject":"[PATCH 2/3] add -N option to cg-commit (resent again)","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-09T10:43:30Z","receivedAt":"2005-07-09T10:43:30Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"(resending cogito patches)\n\nAdd the -N option to cg-commit.\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\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} -- \"${queueN[@]}\" || return 1; }\n \t[ \"$queueD\" ] && { git-update-cache --force-remove -- \"${queueD[@]}\" || return 1; }\n-\t[ \"$queueM\" ] && { git-update-cache -- \"${queueM[@]}\" || return 1; }\n+\t[ \"$queueM\" ] && { git-update-cache ${infoonly} -- \"${queueM[@]}\" || return 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"},{"id":"5860","messageId":"20050709104331.26765.35929.sendpatchset@bryan-larsens-ibook-g4.local","threadId":"1187","inReplyTo":"20050709104316.26765.86980.sendpatchset@bryan-larsens-ibook-g4.local","subject":"[PATCH 3/3] add -N option to cg-init (resent again)","fromName":"Bryan Larsen","fromEmail":"bryanlarsen@yahoo.com","sentAt":"2005-07-09T10:43:42Z","receivedAt":"2005-07-09T10:43:42Z","isPatch":true,"sender":{"key":"bryan@larsen.st","avatar":"https://avatars.githubusercontent.com/u/32073?v=4"},"body":"(resending cogito patches)\n\nadd the -N option to cg-init\n\nSigned-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n---\n\n cg-init |   22 +++++++++++++++++++---\n 1 files changed, 19 insertions(+), 3 deletions(-)\n\ndiff --git a/cg-init b/cg-init\n--- a/cg-init\n+++ b/cg-init\n@@ -10,13 +10,29 @@\n #\n # If `cg-init` is run in a non-empty directory files in the top and\n # sub directory will automatically be added.\n+#\n+# OPTIONS\n+# -------\n+# -N::\n+#   Only update the cache: do not copy the data into the object database.\n+#\n \n-USAGE=\"cg-init\"\n+USAGE=\"cg-init [-N]\"\n _git_repo_unneeded=1\n \n . ${COGITO_LIB}cg-Xlib\n \n-uri=$1\n+\n+infoonly=\n+while optparse; do\n+\tif optparse -N; then\n+\t\tinfoonly=-N\n+\telse\n+\t\toptfail\n+\tfi\n+done\n+\n+uri=$ARGV\n \n [ -e $_git ] && die \"$_git already exists\"\n \n@@ -38,7 +54,7 @@ if [ \"$uri\" ]; then\n \techo \"Cloned (origin $uri available as branch \\\"origin\\\")\"\n else\n \tgit-read-tree # Seed the dircache\n-\tfind * \\( -type f -o -type l \\) -print0 | xargs -0r cg-add\n+\tfind * \\( -type f -o -type l \\) -print0 | xargs -0r cg-add ${infoonly}\n \tcg-commit -C -m\"Initial commit\" -E\n fi\n \n"},{"id":"5894","messageId":"20050710151718.GD24249@pasky.ji.cz","threadId":"1187","inReplyTo":"20050709104331.26765.35929.sendpatchset@bryan-larsens-ibook-g4.local","subject":"Re: [PATCH 1/3] add -N option to cg-add (resent)","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-07-10T15:17:18Z","receivedAt":"2005-07-10T15:17:18Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sat, Jul 09, 2005 at 12:40:22PM CEST, I got a letter\nwhere Bryan Larsen <bryanlarsen@yahoo.com> told me that...\n> (resending cogito patches)\n> \n> Add the -N option to cg-add.\n> \n> Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>\n\nApplied all three patches. Note that I'm a bit happier when they are a\nlittle more maintainer-friendly - it helps to describe why are you\nresending them, and be a little more verbose in the accompanying\nmessage. :-)\n\nThanks,\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n<Espy> be careful, some twit might quote you out of context..\n"}]}