{"thread":{"id":"588","subject":"[PATCH Cogito] Use cg-commit -E to invoke editor and always commit","startedAt":"2005-05-12T20:43:23Z","lastAt":"2005-05-12T20:43:23Z","messageCount":1,"participants":["Marcel Holtmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"3192","messageId":"1115930603.18499.61.camel@pegasus","threadId":"588","inReplyTo":null,"subject":"[PATCH Cogito] Use cg-commit -E to invoke editor and always commit","fromName":"Marcel Holtmann","fromEmail":"marcel@holtmann.org","sentAt":"2005-05-12T20:43:23Z","receivedAt":"2005-05-12T20:43:23Z","isPatch":true,"sender":{"key":"marcel@holtmann.org","avatar":null},"body":"Hi Petr,\n\nthe attached patch introduces the -E parameter to cg-commit and then\nuses it in cg-init. If you use -E instead of -e the editor is invoked\nand it will do the commit even it the default commit messages has not\nbeen changed.\n\nRegards\n\nMarcel\n\n\nSigned-off-by: Marcel Holtmann <marcel@holtmann.org>\n\n\n\nIndex: cg-commit\n===================================================================\n--- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-commit  (mode:100755)\n+++ uncommitted/cg-commit  (mode:100755)\n@@ -13,6 +13,8 @@\n # appended to a single commit message, each as separate paragraph.\n # -e forces the editor to be brought up even when -m parameters were\n # passed to cg-commit.\n+# -E forces the editor to be brought up and it will do the commit\n+# even if the default commit message is not changed.\n \n . ${COGITO_LIB}cg-Xlib\n \n@@ -21,6 +23,7 @@\n \n forceeditor=\n ignorecache=\n+commitalways=\n msgs=()\n while [ \"$1\" ]; do\n \tcase \"$1\" in\n@@ -32,6 +35,11 @@\n \t\tforceeditor=1\n \t\tshift\n \t\t;;\n+\t-E)\n+\t\tforceeditor=1\n+\t\tcommitalways=1\n+\t\tshift\n+\t\t;;\n \t-m*)\n \t\tmsgs=(\"${msgs[@]}\" \"${1#-m}\")\n \t\tshift\n@@ -126,10 +134,10 @@\n if tty -s; then\n \tif ! [ \"$msgs\" ] || [ \"$forceeditor\" ]; then\n \t\t${EDITOR:-vi} $LOGMSG2\n-\tfi\n-\tif ! [ \"$msgs\" ] && ! [ $LOGMSG2 -nt $LOGMSG ]; then\n-\t\trm $LOGMSG $LOGMSG2\n-\t\tdie 'Commit message not modified, commit aborted'\n+\t\tif ! [ \"$commitalways\" ] && ! [ $LOGMSG2 -nt $LOGMSG ]; then\n+\t\t\trm $LOGMSG $LOGMSG2\n+\t\t\tdie 'Commit message not modified, commit aborted'\n+\t\tfi\n \tfi\n else\n \tcat >>$LOGMSG2\nIndex: cg-init\n===================================================================\n--- 00b94eea5b99d5dd1d1bbe9c9ca3502d11aec581/cg-init  (mode:100755)\n+++ uncommitted/cg-init  (mode:100755)\n@@ -32,6 +32,6 @@\n else\n \tgit-read-tree # Seed the dircache\n \tfind * | xargs cg-add\n-\tcg-commit -C -m\"Initial commit\" -e\n+\tcg-commit -C -m\"Initial commit\" -E\n fi\n exit 0\n"}]}