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

Re: jc/shortstatus

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 15, 2009, 21:23 UTC
Message-ID
<7v7hx4bwl0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v8whltrqj.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> A few points I haven't managed to think about, decide, nor test, are:
>
>  - What should its exit code be?  Should it be consistent with the
>    traditional "git status" at least when no paths are given, signallying
>    failure when nothing is staged for committing, so that ancient out of
>    tree scripts people may have written would not break too badly when we
>    make the switch?
>
>  - What should its default mode of output be?  Do people prefer "svn st"
>    style short-format output, or should we stay verbose and explanatory?
>
>  - Is it handling corner cases correctly?  e.g. Does it operate correctly
>    when run from a subdirectory?  How should it handle submodules?  Before
>    the initial commit?  Use of colors?

Just a quick status update, lest others waste too much time staring at the series I posted last night.

 - Leading and trailing comments (e.g. "On branch foo", "Initial commit",
   "# No changes", ...) were missing.
 - Did not honor -v to show "diff --cached".
 - Subdirectory behaviour (status.relativepath configuration) was broken.

I have a version that fixes the above, and exits 0 when there is no error (i.e. does not exit non-zero on clean index). There are existing tests that expect "git status" erroring out on clean index and there are some that depends on "git status paths..." to show preview of a partial commit, which needed to be replaced with "git commit --dry-run", but as far as I can tell, I've took care of them all.

I am still feeling uneasy about the exit status change (the test scripts are sources of how people who script around git take their inspirations after all), but I'll send the result out for a review later without changing that back to "exit failure when there is nothing to commit".

Previous: Jeff King
Message 7 of 7 in “What's cooking in git.git (Aug 2009, #02; Wed, 12)”
  1. Junio C HamanoAug 13, 2009
  2. Jakub NarebskiAug 14, 2009
  3. Junio C HamanoAug 15, 2009
  4. jc/shortstatus (was: What's cooking in git.git (Aug 2009, #02; Wed, 12))Jeff King, Aug 15, 2009
  5. Junio C HamanoAug 15, 2009
  6. Jeff KingAug 15, 2009
  7. Junio C HamanoAug 15, 2009

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.