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

Re: How to `git status' without scrambling modified with new, etc

From
Samuel Lijin <sxlijin@gmail.com>
Date
May 5, 2017, 21:06 UTC
Message-ID
<CAJZjrdVSX_HB0O_eiQk6bg_UF0=71PNVa1rBwSbpHFCbOrpAOQ@mail.gmail.com>
In-Reply-To
<CACBZZX7Q36rFiO9SwBCzM2M3ae=vOPJ2dfaVQ6=geZLgkLAuWA@mail.gmail.com>

On Fri, May 5, 2017 at 9:24 AM, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 7 quoted lines
> On Fri, May 5, 2017 at 4:02 PM, Harry Putnam <reader@newsguy.com> wrote:
>> This is probably what everyone sees:
>>
>> When I run `git status'; I see  modified and newfiles scrambled together
>>
>> Is there a trick or technique to make that output show each category
>> separately?

You can use `git status -s` and match on the modification type (M corresponds to modified, A to new files). See the man page for more details on the interface.

Show 12 quoted lines
>> Or do folks just a throw a `sort' in there (git status|sort) and lose
>> the color ouput?
>
> If you set color.ui=auto it'll disable coloring when it detects that
> the output isn't to a terminal, i.e. being piped.
>
> It sounds like you want:
>
>     git -c color.ui=always status --short|sort
>
> But there's no native option to sort the status output, but that'll do
> it for you.
Previous: Ævar Arnfjörð BjarmasonNext: Harry Putnam
Message 3 of 4 in “How to `git status' without scrambling modified with new, etc”
  1. Harry PutnamMay 5, 2017
  2. Ævar Arnfjörð BjarmasonMay 5, 2017
  3. Samuel LijinMay 5, 2017
  4. Harry PutnamMay 9, 2017

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.