Re: git status --porcelain is a mess that needs fixing
- From
Jon Seymour <jon.seymour@gmail.com>
- Date
- Apr 10, 2010, 23:33 UTC
- Message-ID
- <s2l2cfc40321004101633y2857f592q2a62c5c90ea7a9de@mail.gmail.com>
- In-Reply-To
- <8871c8959d3ea4cd71452400e4c60dd0@212.159.54.234>
On Sun, Apr 11, 2010 at 1:50 AM, Julian Phillips <julian@quantumfyre.co.uk> wrote:
Show 25 quoted lines
> On Sun, 11 Apr 2010 00:56:47 +1000, Jon Seymour <jon.seymour@gmail.com> > wrote: >> On Sat, Apr 10, 2010 at 11:35 PM, Julian Phillips >> <julian@quantumfyre.co.uk> wrote: >>> ... >>> tokens depending on the status flags. So it would make the parsing >>> simpler. But to make it even easier, how about adding a -Z that makes >>> the >>> output format "XY\0file1\0[file2]\0" (i.e. always three tokens per >>> record, >>> with the third token being empty if there is no second filename)? >>> Though >>> if future expandability was wanted you could end each record with \0\0 >>> and >>> then parsing would be a two stages of split on \0\0 for records and > then >>> split on \0 for entries? >> >> Surely that won't work - if file2 can be empty, \0[file2]\0 reduces to >> \0\0 which would be confused with the \0\0 proposed as a record >> separator. > > Yes. But they were alternative suggestions, so if using \0\0 as the > record marker you would omit the second filename when empty as is currently > done.
Ah, apologies. I appear to have failed to parse a necessary disjunctive :-)
jon.