> And this patch's diffstat looks just scary due to test suite's updates.

Here's a series on top that does two things:

1. make the current testsuite run again with GETTEXT_POISON enabled
2. try to ensure that next time someone wants to tweak --stat output,
fewer test updates will be needed.

Patch 1 consists only of good changes that seem maint-worthy to me,
but it is incomplete (see patch 7).

The rest seem to work but I haven't re-checked them carefully.

Patch 7 is a "miscellany" patch that even includes a few changes that
should be part of patch 1. I am sending it this way just to get early
feedback on the approach; a final series would move all the
s/test_cmp/test_i18ncmp/ changes to patch 1 and have the rest of the
changes split up by topic.

The series is based against 7f814632 (Use correct grammar in diffstat
summary line).

Signed-off-by: Jonathan Nieder <[hidden email]>
---
As mentioned in the cover letter, this is incomplete. More changes
of the same kind, especially in t4013-diff-various.sh, are needed for
the testsuite to pass with GETTEXT_POISON=t. Patch 7 has them.

[PATCH 2/7] test: use numstat instead of diffstat in funny-names test

This test script checks that git's plumbing commands quote filenames
with special characters like space, tab, and double-quote
appropriately in their input and output.

Since commit v1.7.9.2~13 (Use correct grammar in diffstat summary
line, 2012-02-01), the final "1 file changed, 1 insertion(+)" line
from diffstats is translatable, meaning tests that rely on exact "git
apply --stat" output have to be skipped when git is not configured to
produce output in the C locale (for example, when GETTEXT_POISON is
enabled). So:

--numstat output is more reliable, does not vary with locale, and
is itself easier to parse. These tests are mainly about how "git
apply" parses its input so this should not result in much loss of
coverage.

- Add a new "apply --stat" test to check the quoting in --stat output
format.

This wins back a little of the test coverage lost with the patch
"test: use test_i18ncmp to check --stat output" when GETTEXT_POISON is
enabled.

- making sure "git apply" can parse a patch that uses funny
filenames
- making sure that "git apply --stat" can produce a diffstat
that uses funny filenames

Only the latter requires using --stat instead of --numstat. The
former is intended for humans and varies by locale, while the
latter is a format meant to stay more stable between versions
and thus is more convenient to use in tests.

This patch makes all but one of these "apply --stat" tests use
--numstat instead, for the above reasons.

so someone (probably I) will need to consolidate the descriptions in
a spare moment.

Since v1.7.3-rc0~26^2~9 (revert: report success when using option
--strategy, 2010-07-14), the cherry-pick-many-commits test checks the
format of output written to the terminal during a cherry-pick sequence
in addition to the functionality. There is no reason those have to
be checked in the same test, though, and it has some downsides:

- when progress output is broken, the test result does not convey
whether the functionality was also broken or not

- it is not immediately obvious when reading that these checks are
meant to prevent regressions in details of the output format and
are not just a roundabout way to check functional details like the
number of commits produced

- there is a temptation to include the same kind of output checking
for every new cherry-pick test, which would make future changes
to the output unnecessarily difficult

Put the tests from v1.7.3-rc0~26^2~9 in separate assertions, following
the principle "test one feature at a time".

git's diff --stat output is intended for human consumption and
since v1.7.9.2~13 (2012-02-01) varies by locale. Add a test checking
that git stash show defaults to --stat and tweak the rest of the
"stash show" tests that showed a diffstat to use numstat.

This way, there are fewer tests to tweak if the diffstat format
changes again. This also improves test coverage when running tests
with git configured not to write its output in the C locale (e.g.,
via GETTEXT_POISON=Yes).

[PATCH 6/7] test: use numstat instead of diffstat in binary-diff test

git's --stat output is intended for humans and since v1.7.9.2~13
(2012-02-01) varies by locale. The tests in this script using "apply
--stat" are meant to check two things:

- how binary file changes are accounted for and printed in
git's diffstat format

- that "git apply" can parse the various forms of binary diff

Split these two kinds of check into separate tests, and use --numstat
instead of --stat in the latter. This way, we lose less test coverage
when git is being run without writing its output in the C locale (for
example because GETTEXT_POISON is enabled) and there are fewer tests
to change if the --stat output needs to be tweaked again.

While at it, use commands separated by && that read and write to
temporary files in place of pipelines so segfaults and other failures
in the upstream of the processing pipeline don't get hidden.

[PATCH 7/7] diffstat summary line varies by locale: miscellany

These changes are in the same spirit as the six patches that
precede them, but they haven't been split into individually
justifiable patches yet.

Signed-off-by: Jonathan Nieder <[hidden email]>
---
The t4013-diff-various.sh change is what I would be most interested in
feedback on.

Thanks for reading, and sorry for the rough state of these patches.
I am sending them out now mostly so others do not have to start from
scratch repeating the same work in order to keep using the
GETTEXT_POISON facility.

Honestly speaking, I am not sure if we should be making these
comparisons to cast the informational output from cherry-pick
that is meant for human concumption in stone to begin with.

I think "cherry-pick first..fourth works" test should be comparing
the output from something like "log --format=%s" over the range
before and after the replaying.

All the other changes in this patch I do agree with; in C locale
these are expected to exactly match what we specify in these tests
and I do not see any reason to update them, but it is OK that they
are translated and attempting to limit the matches to untranslatable
part is not worth it. test_i18ncmp is the tool for such comparison.

But I do not think the progress output from range cherry-pick needs
to be cast in stone even in C locale, hence the comments in the
first two paragraphs from me.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/7] test: use test_i18ncmp when checking --stat output

>> But I do not think the progress output from range cherry-pick needs
>> to be cast in stone even in C locale, hence the comments in the
>> first two paragraphs from me.
>
> Ahh, I spoke too early before reading them through. You do touch
> them later in the series.
>
> Sorry for the noise, and thanks.