Re: [PATCH 2/2] ls-files: add --sparse option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 13, 2021, 19:16 UTC
- Message-ID
- <xmqq7dc8co3d.fsf@gitster.g>
- In-Reply-To
- <745e79e3-521d-58bd-2ddf-1da4e0f6fe26@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 15 quoted lines
> You're talking about this hunk, right? > > if test -z "$GIT_TEST_CMP" > then > if test -n "$GIT_TEST_CMP_USE_COPIED_CONTEXT" > then > GIT_TEST_CMP="$DIFF -c" > else > GIT_TEST_CMP="$DIFF -u" > fi > fi > > This only switches from "diff -u" to "diff -c" if the > GIT_TEST_CMP_USE_COPIED_CONTEXT variable is set, but it is not set > by default. Thus, we are using "diff -u" by default throughout.
That it can be set merely means that somebody needed to work around the lack of "-u" format in their implementation of "diff". It came to POSIX only at the Issue 7 of the standard (cf. [*1*]).
Unconditional use of "diff -u" is a breaking change for them.
If these people still exist, that is ;-)
[Reference]
*1* https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html The Open Group Base Specifications Issue 7, 2018 edition