From: Jeff King Date: Tue, 10 Mar 2015 05:41:47 GMT Subject: Re: Efficient parsing of `status -z` output Message-ID: <20150310054146.GA3216@peff.net> In-Reply-To: On Mon, Mar 09, 2015 at 07:40:43PM -0400, Matthew Rothenberg wrote: > On Mon, Mar 9, 2015 at 2:49 AM, Jeff King wrote: > > $ git init > > $ seq 1 1000 >file && git add file && git commit -m base > > $ mv file other > > $ echo foo >file > > $ git add . > > $ git status --short > > M file > > C file -> other > > Fantastic, I am able to replicate with these steps and will build > tests around this case. > > For future proofing, from the documentation for git status is appears > the other two codes I would want to check for in addition to 'C ' > (which this test cases generates) may be 'CM' and 'CD'? And all of > those should always have the additional PATH2 column present? Yes, you can trivially make CM and CD by changing or deleting "other" in the example above. I don't think you can ever have 'C' or 'R' in the second column; we don't do renames on working tree changes, since a "new" file there is simply untracked. -Peff