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

Re: unmerged files listed in the beginning of git-status

From
Johannes Sixt <j6t@kdbg.org>
Date
Sep 1, 2009, 19:40 UTC
Message-ID
<200909012140.08953.j6t@kdbg.org>
In-Reply-To
<7vljkypqfi.fsf@alter.siamese.dyndns.org>
On Dienstag, 1. September 2009, Junio C Hamano wrote:
Show 24 quoted lines
> bill lam <cbill.lam@gmail.com> writes:
> > git-status show unmerged files
> > with a clause of explanation.  This is very helpful. However these
> > unmerged files are listed in the beginning and followed by modified
> > files,
>
> "git status" is preview of what git commit does.  The "Changes to be
> committed" section is given at the beginning of the output because it is
> the most important one.  But while reviewing the conflicts, you would want
> to notice conflicted paths more than what are already resolved and staged.
>
> It used to be that unmerged paths were mixed together with locally
> modified paths in the "Changed but not updated" list, after the "Changes
> to be committed" list.  This made the unmerged paths harder to spot than
> necessary.
>
> To remedy this, unmerged ones are now:
>
>  (1) placed in a new, separate section that appears only when there are
>      unmerged paths, to make the fact that there is something unusual
>      going on (i.e. conflicts) stand out; and
>
>  (2) the new section is given at the top of the status output to give
>      these unmerged paths more prominence.

But this is very inconvenient if you merge a branch that touched many files, of which only a few have conflicts. In this case, the unmerged entries are scrolled out of view. If you want to copy-paste them into a 'git add' command then (at least my) xterm (and Windows's CMD, BTW) keeps scrolling down to the command line, and since I cannot bulk-select all of them at once, I have to scroll up in order select any individual of them.

Note that I do not complain about the "out of view" part (because if a list is long there is inevitably something that becomes invisible), but about the "must scroll around" part.

> But unmerged entries are something you need to deal with _first_ before
> being able to go further, so in that sense it is more important than
> anything else in the traditional output.

This is actually an argument to place the unmerged entries *last* because this is what will be visible after 'git status' finished. Remember that we don't pass its output through the pager.

> In the output, "the most important part first" rule is unlikely to change,
> if only because this is what you are shown when committing in the editor,
> and even in 1.7.0 when "git status" stops being "git commit --dry-run"
> because we would still keep consistency of the two outputs,

Of course, this argument is irrelevant for the placement of the list of unmerged entries because by the time you enter the commit message editor, this list is empty.

-- Hannes
Previous: Junio C HamanoNext: Johannes Sixt
Message 3 of 34 in “unmerged files listed in the beginning of git-status”
  1. bill lamSep 1, 2009
  2. Junio C HamanoSep 1, 2009
  3. Johannes SixtSep 1, 2009
  4. status: list unmerged files after staged filesJohannes Sixt, Sep 1, 2009
  5. Junio C HamanoSep 1, 2009
  6. status: list unmerged files lastJohannes Sixt, Sep 1, 2009
  7. Junio C HamanoSep 2, 2009
  8. bill lamSep 2, 2009
  9. Jeff KingSep 2, 2009
  10. Junio C HamanoSep 2, 2009
  11. Jeff KingSep 2, 2009
  12. Junio C HamanoSep 2, 2009
  13. Jeff KingSep 2, 2009
  14. David AguilarSep 2, 2009
  15. Jeff KingSep 2, 2009
  16. David AguilarSep 3, 2009
  17. Jeff KingSep 5, 2009
  18. Jeff KingSep 5, 2009
  19. 1/6 status: typo fix in usageJeff King, Sep 5, 2009
  20. 2/6 docs: note that status configuration affects only long formatJeff King, Sep 5, 2009
  21. Junio C HamanoSep 6, 2009
  22. 3/6 status: refactor short-mode printing to its own functionJeff King, Sep 5, 2009
  23. Junio C HamanoSep 6, 2009
  24. 4/6 status: refactor format option parsingJeff King, Sep 5, 2009
  25. 5/6 status: add --porcelain output formatJeff King, Sep 5, 2009
  26. 6/6 commit: support alternate status formatsJeff King, Sep 5, 2009
  27. Jeff KingSep 5, 2009
  28. Johannes SixtSep 2, 2009
  29. Mark BrownSep 2, 2009
  30. Jeff KingSep 2, 2009
  31. Mark BrownSep 2, 2009
  32. Jeff KingSep 5, 2009
  33. Mark BrownSep 5, 2009
  34. bill lamSep 2, 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.