Re: [PATCH 1/2] t7508: demonstrate status's failure to use --porcelain format with -z
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 26, 2011, 21:45 UTC
- Message-ID
- <7v4o4hw2zm.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <vdMu20HxiNaWL_IogfamtfZCd6xRyKanIqTSw0k4f2SrbLfUYHDzKT2EGkwdFRlaLzX-5vGGtDCZRGu84HrJzw@cipher.nrlssc.navy.mil>
Brandon Casey <casey@nrlssc.navy.mil> writes:
Show 8 quoted lines
> From: Brandon Casey <drafnel@gmail.com> > > When 'git status' is supplied the -z switch, and no output format has been > selected, it is supposed to use the --porcelain format. This does not > happen. Instead, the standard long format is used. Add a test to > demonstrate this failure. > > Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
I didn't even know we attempted to default to porcelain when -z is given, even though it is a logical thing to do in the sense that nobody sane would want to read a NUL-terminated human readable format.
I'll rewrite the test to avoid hardcoded and context dependent test vector, like this:
test_expect_failure 'status -z implies porcelain' '
git status --porcelain |
perl -pe "s/\012/\000/g" >expect
git status -z >output &&
test_cmp expect output
'as the only thing you are interested in is the two output to match identically modulo the record termination.
By the way, don't we however also want to make sure -z does not kick in automatically when other options like "short" or "normal" is given?