Commit graph

6 commits

Author SHA1 Message Date
Johannes Schindelin 2779f66505 t4051: mark supporting files as requiring LF-only line endings
The test t4051-diff-function-context.sh passes on Linux when
core.autocrlf=true even without marking its support files as LF-only,
but they fail when core.autocrlf=true in Git for Windows' SDK.

The reason is that `grep ... >file.c.new` will keep CR/LF line endings
on Linux (obviously treating CRs as if they were regular characters),
but will be converted to LF-only line endings with MSYS2's grep that is
used in Git for Windows.

As we do not want to validate the way the available `grep` works, let's
just mark the input as LF-only and move on.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-10 13:32:51 +09:00
Johannes Schindelin 614f4f0f35 Fix the remaining tests that failed with core.autocrlf=true
The test suite is mainly developed on Linux and MacOSX, which is the
reason that nobody thought to mark files as LF-only as needed.

The symptom is a test suite that fails left and right when being checked
out using Git for Windows (which defaults to core.autocrlf=true).

Mostly, the problems stem from Git's (LF-only) output being compared to
hard-coded files that are checked out with line endings according to
core.autocrlf (which is of course incorrect). This includes the two test
files in t/diff-lib/, README and COPYING.

This patch can be validated even on Linux by using this cadence:

	git config core.autocrlf true
	rm .git/index && git stash
	make -j15 DEVELOPER=1 test

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-10 13:32:51 +09:00
Kyle J. McKay 6a56993b2e config: parse http.<url>.<variable> using urlmatch
Use the urlmatch_config_entry() to wrap the underlying
http_options() two-level variable parser in order to set
http.<variable> to the value with the most specific URL in the
configuration.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-05 16:02:03 -07:00
Jeff King 9197240de8 enable whitespace checking of test scripts
Now that all of the policy violations have been cleaned up,
we can turn this on and start checking incoming patches.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-14 11:39:16 -07:00
Lea Wiemann 7b7b4516de t/.gitattributes: only ignore whitespace errors in test files
Only ignore whitespace errors in t/tNNNN-*.sh and the t/tNNNN
subdirectories.  Other files (like test libraries) should still be
checked.

Also fix a whitespace error in t/test-lib.sh.

Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-06-12 22:22:55 -07:00
Junio C Hamano 14f9e128d3 Define the project whitespace policy
This establishes what the "bad" whitespaces are for this
project.

The rules are:

 - Unless otherwise specified, indent with SP that could be
   replaced with HT are not "bad".  But SP before HT in the
   indent is "bad", and trailing whitespaces are "bad".

 - For C source files, initial indent by SP that can be replaced
   with HT is also "bad".

 - Test scripts in t/ and test vectors in its subdirectories can
   contain anything, so we make it unrestricted for now.

Anything "bad" will be shown in WHITESPACE error indicator in
diff output, and "apply --whitespace=warn" will warn about it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-11 13:23:15 -08:00