{"thread":{"id":"829","subject":"[PATCH Cogito] Add -f parameter also to cg-update","startedAt":"2005-06-04T06:25:08Z","lastAt":"2005-06-04T06:25:08Z","messageCount":1,"participants":["Marcel Holtmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4529","messageId":"1117866308.3656.120.camel@pegasus","threadId":"829","inReplyTo":null,"subject":"[PATCH Cogito] Add -f parameter also to cg-update","fromName":"Marcel Holtmann","fromEmail":"marcel@holtmann.org","sentAt":"2005-06-04T06:25:08Z","receivedAt":"2005-06-04T06:25:08Z","isPatch":true,"sender":{"key":"marcel@holtmann.org","avatar":null},"body":"Hi Petr,\n\nthe attached patch adds the -f parameter to force a full pull also to\ncg-update.\n\nRegards\n\nMarcel\n\n\nSigned-off-by: Marcel Holtmann <marcel@holtmann.org>\n\n\n\ndiff --git a/cg-update b/cg-update\n--- a/cg-update\n+++ b/cg-update\n@@ -7,16 +7,27 @@\n #\n # If local changes conflict with those of the branch updated from the\n # merge will be blocked.\n+#\n+# OPTIONS\n+# -------\n+# -f::\n+#\tForce the complete pull even if the heads are the same.\n \n-USAGE=\"cg-update [BRANCH_NAME]\"\n+USAGE=\"cg-update [-f] [BRANCH_NAME]\"\n \n . ${COGITO_LIB}cg-Xlib\n \n+force=\n+if [ \"$1\" = \"-f\" ]; then\n+\tforce=$1\n+\tshift\n+fi\n+\n name=$1\n [ \"$name\" ] || { [ -s $_git/refs/heads/origin ] && name=origin; }\n [ \"$name\" ] || die \"where to update from?\"\n \n-cg-pull $name || exit 1\n+cg-pull $force $name || exit 1\n echo\n echo \"Applying changes...\"\n cg-merge $name\n"}]}