{"thread":{"id":"39217","subject":"[BUG] git commit --allow-empty-message -m '' fails","startedAt":"2015-05-01T23:31:08Z","lastAt":"2015-05-02T02:44:56Z","messageCount":4,"participants":["Josh Hagins","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"260399","messageId":"CANuW5x0eKVAToG76rJr6+n-Fdg7E5c8mHb8NvnQUT2PBzxjjPQ@mail.gmail.com","threadId":"39217","inReplyTo":null,"subject":"[BUG] git commit --allow-empty-message -m '' fails","fromName":"Josh Hagins","fromEmail":"hagins.josh@gmail.com","sentAt":"2015-05-01T23:31:08Z","receivedAt":"2015-05-01T23:31:08Z","isPatch":false,"sender":{"key":"hagins.josh@gmail.com","avatar":null},"body":"When passed the `--allow-empty-message` flag with no `-m`, `git\ncommit` will open the editor and allow you to exit with an empty\nmessage, as expected.\n\nHowever, when passed `-m ''` in addition to `--allow-empty-message`,\nthe commit fails. Example below:\n\n    $ git commit -a --allow-empty-message -m ''\n    error: switch `m' requires a value\n    usage: git commit [<options>] [--] <pathspec>...\n    ...\n\nShouldn't the `-m` switch know whether the `--allow-empty-message`\nflag has been passed?\n\nThanks,\nJosh\n"},{"id":"260403","messageId":"20150502010605.GA5634@peff.net","threadId":"39217","inReplyTo":"CANuW5x0eKVAToG76rJr6+n-Fdg7E5c8mHb8NvnQUT2PBzxjjPQ@mail.gmail.com","subject":"Re: [BUG] git commit --allow-empty-message -m '' fails","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-02T01:06:06Z","receivedAt":"2015-05-02T01:06:06Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 01, 2015 at 07:31:08PM -0400, Josh Hagins wrote:\n\n> When passed the `--allow-empty-message` flag with no `-m`, `git\n> commit` will open the editor and allow you to exit with an empty\n> message, as expected.\n> \n> However, when passed `-m ''` in addition to `--allow-empty-message`,\n> the commit fails. Example below:\n> \n>     $ git commit -a --allow-empty-message -m ''\n>     error: switch `m' requires a value\n>     usage: git commit [<options>] [--] <pathspec>...\n>     ...\n> \n> Shouldn't the `-m` switch know whether the `--allow-empty-message`\n> flag has been passed?\n\nIt should. It works here for me:\n\n  $ git commit --allow-empty --allow-empty-message -m ''\n  [master 2957ea1]\n\nThe message you're seeing comes from the option-parser, which thinks\nthere isn't any argument to `-m` at all. I can get the same result like:\n\n  $ git commit --allow-empty --allow-empty-message -m\n  error: switch `m' requires a value\n  ...\n\nAre you running the command inside another bit of shell script that\nmight be eating the empty argument (e.g., eval-ing it inside of another\nset of single quotes or something like that)?\n\n-Peff\n"},{"id":"260407","messageId":"20150502022924.GA587@peff.net","threadId":"39217","inReplyTo":"CANuW5x1jeAY4KrOQez30mNp864abaYFyDDrdfM=NHCSosTSzkQ@mail.gmail.com","subject":"Re: [BUG] git commit --allow-empty-message -m '' fails","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-05-02T02:29:24Z","receivedAt":"2015-05-02T02:29:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 02, 2015 at 01:25:45AM +0000, Josh Hagins wrote:\n\n> I have git aliased to hub, which must do some preprocessing before handing\n> the command off to git.\n> \n> That's likely the culprit, but I'm using iTerm as my terminal emulator,\n> which might be doing something tricky, but I doubt it. I'll open an issue\n> on hub's GitHub repo and see what I can find out.\n\nAh, yeah, it's probably hub. Looks like it's fixed already there:\n\n  https://github.com/github/hub/pull/727\n\n-Peff\n"},{"id":"260410","messageId":"CANuW5x3oHmjAk=Ju6j+sxYnVp8mSs_V6t7YHm2S9=+0GgHnkDg@mail.gmail.com","threadId":"39217","inReplyTo":"20150502022924.GA587@peff.net","subject":"Re: [BUG] git commit --allow-empty-message -m '' fails","fromName":"Josh Hagins","fromEmail":"hagins.josh@gmail.com","sentAt":"2015-05-02T02:44:56Z","receivedAt":"2015-05-02T02:44:56Z","isPatch":false,"sender":{"key":"hagins.josh@gmail.com","avatar":null},"body":"Turns out it was actually scm_breeze. It defines a git() bash function\nand takes care of expanding arguments itself:\n\n  https://github.com/ndbroadbent/scm_breeze/blob/master/lib/git/aliases.sh#L26\n\nI'll open an issue there.\n\nOn Fri, May 1, 2015 at 10:29 PM, Jeff King <peff@peff.net> wrote:\n> On Sat, May 02, 2015 at 01:25:45AM +0000, Josh Hagins wrote:\n>\n>> I have git aliased to hub, which must do some preprocessing before handing\n>> the command off to git.\n>>\n>> That's likely the culprit, but I'm using iTerm as my terminal emulator,\n>> which might be doing something tricky, but I doubt it. I'll open an issue\n>> on hub's GitHub repo and see what I can find out.\n>\n> Ah, yeah, it's probably hub. Looks like it's fixed already there:\n>\n>   https://github.com/github/hub/pull/727\n>\n> -Peff\n\n\n\n-- \nJosh Hagins\nCollege of Engineering\nCornell University '14\n(843) 847-6008\n"}]}