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

Re: [PATCH] docs: add description of status output table

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2021, 01:41 UTC
Message-ID
<xmqqim85d0vw.fsf@gitster.c.googlers.com>
In-Reply-To
<20210109220614.759779-1-sandals@crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> The table describing the porcelain format in git-status(1) is helpful,
> but it's not completely clear what the three sections mean, even to
> some contributors.  As a result, users are unable to find how to detect
> common cases like merge conflicts programmatically.

I agree that the addition clarifies, but it is a bit sad that we already have a beginning of the explanation; I wonder if we should improve the existing description in addition, even if it may not be sufficient to eliminate the need for this new paragraph. Here is what we already have:

    For paths with merge conflicts, `X` and `Y` show the modification
    states of each side of the merge. For paths that do not have merge
    conflicts, `X` shows the status of the index, and `Y` shows the status
    of the work tree.  For untracked paths, `XY` are `??`.  Other status
    codes can be interpreted as follows:

This introductory text does sort-of hint that there are three classes (merged paths, unmerged paths and untracked paths), but (1) the order the three classes are described do not match that of the table, and (2) the explanation of the untracked paths predates the addition of ignored ones to the untracked class, so the description is added after the legends as if an afterthought.

I am actually tempted to suggest rewriting the whole section, starting from the paragraph above and ending at the table, with something like this:

    Three different classes of paths are shown in the same format,
    but the meaning of `XY` are different:
    * For merged paths, `X` shows the status of the index, and `Y`
      shows the status of the working tree.
    * For unmerged paths, `X` and `Y` show the modification states
      of each side of the merge, relative to the common ancestor.
    * For untracked paths, `X` and `Y` do not convey different
      meaning (as, by definition, they are not known to the index);
      `??` is shown for untracked paths, and when `--ignored` option
      is in effect, ignored paths are shown with `!!`.
    In the following table, these three classes are shown in
    separate sections, and these characters are used for `X` and `Y`
    fields for the first two sections that show tracked paths:
    * ' ' = unmodified
    * 'M' = modified
       ...
    ....
    X        Y       Meaning
    ------------------------------------------------------------
            [AMD]    not updated
       ...
Hmm?
Previous: brian m. carlsonNext: brian m. carlson
Message 4 of 10 in “Difficulties of scripting git”
  1. Alan MackenzieJan 9, 2021
  2. brian m. carlsonJan 9, 2021
  3. docs: add description of status output tablebrian m. carlson, Jan 9, 2021
  4. Junio C HamanoJan 10, 2021
  5. brian m. carlsonJan 10, 2021
  6. Alan MackenzieJan 10, 2021
  7. brian m. carlsonJan 10, 2021
  8. docs: rephrase and clarify the git status --short formatbrian m. carlson, Jan 10, 2021
  9. Junio C HamanoJan 11, 2021
  10. brian m. carlsonJan 16, 2021

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.