Re: [PATCH] demonstrate git-commit --dry-run exit code behaviour
- From
Jeff King <peff@peff.net>
- Date
- Feb 22, 2014, 08:34 UTC
- Message-ID
- <20140222083423.GF1576@sigill.intra.peff.net>
- In-Reply-To
- <xmqqa9dk43pi.fsf@gitster.dls.corp.google.com>
On Fri, Feb 21, 2014 at 12:21:13PM -0800, Junio C Hamano wrote:
Show 16 quoted lines
> Tay Ray Chuan <rctay89@gmail.com> writes: > > > In particular, show that --short and --porcelain, while implying > > --dry-run, do not return the same exit code as --dry-run. This is due to > > the wt_status.commitable flag being set only when a long status is > > requested. > > I am not sure if --short/--porcelain should even be accepted by "git > commit" in the first place. It used to be that "git status" and > "git commit" were the same program in a different guise and "git > status <anything>" were merely a "git commit --dry-run <anything>", > but the recent push is in the direction of making them totally > separate in the end-user's minds. So if we want a proper fix, I > would actually think that these options should *error out* at the > command line parser level, way before checking if there is anything > to commit.
I do not think they are any less useful than "git commit --dry-run" in the first place. If you want to ask "what would happen if I ran commit with these arguments", you can get the answer in any of several formats (and --porcelain is the only machine-readable one).
I have never found "commit --dry-run" to be useful, but I assumed that somebody does.
-Peff