{"thread":{"id":"4335","subject":"[PATCH] Allow multiple -m options to git-commit.","startedAt":"2006-05-29T08:45:49Z","lastAt":"2006-05-29T08:45:49Z","messageCount":1,"participants":["Shawn Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"20877","messageId":"20060529084549.GA29500@spearce.org","threadId":"4335","inReplyTo":null,"subject":"[PATCH] Allow multiple -m options to git-commit.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-05-29T08:45:49Z","receivedAt":"2006-05-29T08:45:49Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"I find it very convenient to be able to supply multiple paragraphs\nof text on the command line with a single git-commit call.  This\nchange permits multiple -m/--message type options to be supplied\nto git-commit with each message being added as its own paragraph\nof text in the commit message.\n\nThe -m option is still not permitted with -c/-C/-F nor are multiple\noccurrences of these options permitted.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n git-commit.sh |   37 ++++++++++++++++++++++++++++++-------\n 1 files changed, 30 insertions(+), 7 deletions(-)\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex 0a01a0b..a092b72 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -260,20 +260,41 @@ do\n   -m|--m|--me|--mes|--mess|--messa|--messag|--message)\n       case \"$#\" in 1) usage ;; esac\n       shift\n-      log_given=t$log_given\n-      log_message=\"$1\"\n+      log_given=m$log_given\n+      if test \"$log_message\" = ''\n+      then\n+          log_message=\"$1\"\n+      else\n+          log_message=\"$log_message\n+\n+$1\"\n+      fi\n       no_edit=t\n       shift\n       ;;\n   -m*)\n-      log_given=t$log_given\n-      log_message=`expr \"$1\" : '-m\\(.*\\)'`\n+      log_given=m$log_given\n+      if test \"$log_message\" = ''\n+      then\n+          log_message=`expr \"$1\" : '-m\\(.*\\)'`\n+      else\n+          log_message=\"$log_message\n+\n+`expr \"$1\" : '-m\\(.*\\)'`\"\n+      fi\n       no_edit=t\n       shift\n       ;;\n   --m=*|--me=*|--mes=*|--mess=*|--messa=*|--messag=*|--message=*)\n-      log_given=t$log_given\n-      log_message=`expr \"$1\" : '-[^=]*=\\(.*\\)'`\n+      log_given=m$log_given\n+      if test \"$log_message\" = ''\n+      then\n+          log_message=`expr \"$1\" : '-[^=]*=\\(.*\\)'`\n+      else\n+          log_message=\"$log_message\n+\n+`expr \"$1\" : '-[^=]*=\\(.*\\)'`\"\n+      fi\n       no_edit=t\n       shift\n       ;;\n@@ -378,7 +399,9 @@ esac\n \n case \"$log_given\" in\n tt*)\n-  die \"Only one of -c/-C/-F/-m can be used.\" ;;\n+  die \"Only one of -c/-C/-F can be used.\" ;;\n+*tm*|*mt*)\n+  die \"Option -m cannot be combined with -c/-C/-F.\" ;;\n esac\n \n case \"$#,$also,$only,$amend\" in\n-- \n1.3.3.g45d8\n"}]}