git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/1] .gitattributes: ensure t/oid-info/* has eol=lf
@ 2018-12-11 20:35 Derrick Stolee via GitGitGadget
  2018-12-11 20:35 ` [PATCH 1/1] " Derrick Stolee via GitGitGadget
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Derrick Stolee via GitGitGadget @ 2018-12-11 20:35 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano

I noticed that our CI builds (see [1] for an example) were returning success
much faster than they did before Git v2.20.0. Turns out that there was a
test script failure involving the new test hash logic.

error: bug in the test script: bad hash algorithm
make[1]: *** [Makefile:56: t0000-basic.sh] Error 1
make[1]: *** Waiting for unfinished jobs....

The reason this passed was because we were running this command in our
build:

make GIT_TEST_OPTS=--quiet -j 10 -C t ||
make GIT_TEST_OPTS=\"-i -v -x\" -k -C t failed 

The first make failed, but the test script did not record any failed tests
and hence the second command succeeded.

The test bug relates to this function added by 2c02b110d "t: add test
functions to translate hash-related values":

+# Load key-value pairs from stdin suitable for use with test_oid.  Blank lines
+# and lines starting with "#" are ignored.  Keys must be shell identifier
+# characters.
+#
+# Examples:
+# rawsz sha1:20
+# rawsz sha256:32
+test_oid_cache () {
+       local tag rest k v &&
+
+       { test -n "$test_hash_algo" || test_detect_hash; } &&
+       while read tag rest
+       do
+               case $tag in
+               \#*)
+                       continue;;
+               ?*)
+                       # non-empty
+                       ;;
+               *)
+                       # blank line
+                       continue;;
+               esac &&
+
+               k="${rest%:*}" &&
+               v="${rest#*:}" &&
+
+               if ! expr "$k" : '[a-z0-9][a-z0-9]*$' >/dev/null
+               then
+                       error 'bug in the test script: bad hash algorithm'
+               fi &&
+               eval "test_oid_${k}_$tag=\"\$v\""
+       done
+}

The verbose output included these values. Note how '\r' appears in the
variable values.

++ test_oid_init
++ test -n ''
++ test_detect_hash
++ test_hash_algo=sha1
++ test_oid_cache
++ local tag rest k v
++ test -n sha1
++ read tag rest
++ case $tag in
++ k=sha1
++ v=$'20\r'
++ expr sha1 : '[a-z0-9][a-z0-9]*$'
++ eval 'test_oid_sha1_rawsz="$v"'
+++ test_oid_sha1_rawsz=$'20\r'
++ read tag rest
++ case $tag in
++ k=sha256
++ v=$'32\r'
++ expr sha256 : '[a-z0-9][a-z0-9]*$'
++ eval 'test_oid_sha256_rawsz="$v"'
+++ test_oid_sha256_rawsz=$'32\r'
++ read tag rest
++ case $tag in
++ k=
++ v=
++ expr '' : '[a-z0-9][a-z0-9]*$'

[1] https://gvfs.visualstudio.com/ci/_build/results?buildId=4815

Derrick Stolee (1):
  .gitattributes: ensure t/oid-info/* has eol=lf

 .gitattributes | 1 +
 1 file changed, 1 insertion(+)


base-commit: 5d826e972970a784bd7a7bdf587512510097b8c7
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-98%2Fderrickstolee%2Ftest-oid-fix-windows-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-98/derrickstolee/test-oid-fix-windows-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/98
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2018-12-14 11:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 20:35 [PATCH 0/1] .gitattributes: ensure t/oid-info/* has eol=lf Derrick Stolee via GitGitGadget
2018-12-11 20:35 ` [PATCH 1/1] " Derrick Stolee via GitGitGadget
2018-12-12 13:39   ` SZEDER Gábor
2018-12-13 13:01     ` Johannes Schindelin
2018-12-13 13:22       ` SZEDER Gábor
2018-12-13 13:44         ` Johannes Schindelin
2018-12-12  8:38 ` [PATCH 0/1] " Junio C Hamano
2018-12-12 18:14 ` [PATCH v2 0/2] Add more eol=lf to .gitattributes Derrick Stolee via GitGitGadget
2018-12-12 18:14   ` [PATCH v2 1/2] .gitattributes: ensure t/oid-info/* has eol=lf Derrick Stolee via GitGitGadget
2018-12-13  2:38     ` Junio C Hamano
2018-12-13 16:22       ` Derrick Stolee
2018-12-14  2:23         ` Junio C Hamano
2018-12-14  0:51     ` brian m. carlson
2018-12-14 11:10       ` Johannes Schindelin
2018-12-12 18:14   ` [PATCH v2 2/2] t4256: mark support files as LF-only Johannes Schindelin via GitGitGadget
2018-12-13  2:40     ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).