git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “demonstrate git-commit --dry-run exit code behaviour”
  1. demonstrate git-commit --dry-run exit code behaviourTay Ray Chuan, Feb 21, 2014
  2. Junio C HamanoFeb 21, 2014
  3. Jeff KingFeb 22, 2014
  4. Junio C HamanoFeb 24, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.