Re: [PATCH 2/2] ls-files: add --sparse option

2 messages, 2 authors, 2021-12-16 · open the first message on its own page

Re: [PATCH 2/2] ls-files: add --sparse option

From: Junio C Hamano <hidden>
Date: 2021-12-13 19:16:30

Derrick Stolee [off-list ref] writes:
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

Re: [PATCH 2/2] ls-files: add --sparse option

From: Derrick Stolee <hidden>
Date: 2021-12-16 14:11:53

On 12/13/2021 2:16 PM, Junio C Hamano wrote:
Derrick Stolee [off-list ref] writes:
quoted
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.
Yes, noted. I'm currently waiting for ld/sparse-diff-blame to
merge to 'master' before sending a new version, since there are
unrelated build failures without taking newer changes in 'master'.

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help