From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 0/1] .gitattributes: ensure t/oid-info/* has eol=lf
Date: Tue, 11 Dec 2018 12:35:45 -0800 (PST) [thread overview]
Message-ID: <pull.98.git.gitgitgadget@gmail.com> (raw)
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
next reply other threads:[~2018-12-11 20:35 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-11 20:35 Derrick Stolee via GitGitGadget [this message]
2018-12-11 20:35 ` [PATCH 1/1] .gitattributes: ensure t/oid-info/* has eol=lf 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pull.98.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).