{"thread":{"id":"53421","subject":"[PATCH] t/test_lib: avoid naked bash arrays in file_lineno","startedAt":"2020-05-07T05:51:55Z","lastAt":"2020-05-08T23:54:02Z","messageCount":8,"participants":["Carlo Marcelo Arenas Belón","Junio C Hamano","Carlo Arenas","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"397261","messageId":"20200507055118.69971-1-carenas@gmail.com","threadId":"53421","inReplyTo":null,"subject":"[PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2020-05-07T05:51:18Z","receivedAt":"2020-05-07T05:51:55Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"662f9cf154 (tests: when run in Bash, annotate test failures with file\nname/line number, 2020-04-11), introduces a way to report the location\n(file:lineno) of a failed test case by traversing the bash callstack.\n\nThe implementation requires bash and is therefore protected by a guard\nbut NetBSD sh will still have to parse the function and therefore will\nresult in:\n\n  ** t0000-basic.sh ***\n  ./test-lib.sh: 681: Syntax error: Bad substitution\n\nEnclose the bash specific code inside an eval to avoid parsing errors\nand while at it, simplify the logic so that instead of traversing the\ncallstack just pop the two topmost entries that are required.\n\nHelped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n t/test-lib.sh | 15 +++++++--------\n 1 file changed, 7 insertions(+), 8 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 1b221951a8..60b8e70678 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -677,14 +677,13 @@ die () {\n \n file_lineno () {\n \ttest -z \"$GIT_TEST_FRAMEWORK_SELFTEST\" && test -n \"$BASH\" || return 0\n-\tlocal i\n-\tfor i in ${!BASH_SOURCE[*]}\n-\tdo\n-\t\tcase $i,\"${BASH_SOURCE[$i]##*/}\" in\n-\t\t0,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }\"; return;;\n-\t\t*,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }\"; return;;\n-\t\tesac\n-\tdone\n+\teval '\n+\t\tlocal n=$(echo ${#BASH_SOURCE[*]})\n+\t\tif test $n -ge 2\n+\t\tthen\n+\t\t\techo \"${BASH_SOURCE[$n - 1]}:${BASH_LINENO[$n - 2]}: $1: \"\n+\t\tfi\n+\t'\n }\n \n GIT_EXIT_OK=\n-- \n2.26.2.686.gfaf46a9ccd\n\n"},{"id":"397312","messageId":"xmqqr1vv4wzo.fsf@gitster.c.googlers.com","threadId":"53421","inReplyTo":"20200507055118.69971-1-carenas@gmail.com","subject":"Re: [PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-05-07T14:53:47Z","receivedAt":"2020-05-07T14:53:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:\n\n> 662f9cf154 (tests: when run in Bash, annotate test failures with file\n> name/line number, 2020-04-11), introduces a way to report the location\n> (file:lineno) of a failed test case by traversing the bash callstack.\n>\n> The implementation requires bash and is therefore protected by a guard\n> but NetBSD sh will still have to parse the function and therefore will\n> result in:\n>\n>   ** t0000-basic.sh ***\n>   ./test-lib.sh: 681: Syntax error: Bad substitution\n>\n> Enclose the bash specific code inside an eval to avoid parsing errors\n> and while at it, simplify the logic so that instead of traversing the\n> callstack just pop the two topmost entries that are required.\n>\n> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n\nIs the rewritten bash-snippet in the evaled text what Dscho\nsuggested us to use, or is it totally yours?  I know Dscho helped to\nshoot down some \"simpler\" reimplementations you came up with,\npointing out how they were broken, but it is unclear how we ended up\nwith this version.\n\nI wish you didn't do the \"while at it\" rewrite in the same patch.\nIf it were only \"put bash-only stuff in an evaled string\", it would\nhave been a lot more comfortable applying it and merging quickly\ndown, as it would be clear that we won't be breaking bash codepath\nand we'd be helping other shells.  With the \"while at it\", you made\nit quite unclear.\n\n> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n> ---\n>  t/test-lib.sh | 15 +++++++--------\n>  1 file changed, 7 insertions(+), 8 deletions(-)\n>\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 1b221951a8..60b8e70678 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -677,14 +677,13 @@ die () {\n>  \n>  file_lineno () {\n>  \ttest -z \"$GIT_TEST_FRAMEWORK_SELFTEST\" && test -n \"$BASH\" || return 0\n> -\tlocal i\n> -\tfor i in ${!BASH_SOURCE[*]}\n> -\tdo\n> -\t\tcase $i,\"${BASH_SOURCE[$i]##*/}\" in\n> -\t\t0,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }\"; return;;\n> -\t\t*,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }\"; return;;\n> -\t\tesac\n> -\tdone\n> +\teval '\n> +\t\tlocal n=$(echo ${#BASH_SOURCE[*]})\n> +\t\tif test $n -ge 2\n> +\t\tthen\n> +\t\t\techo \"${BASH_SOURCE[$n - 1]}:${BASH_LINENO[$n - 2]}: $1: \"\n> +\t\tfi\n> +\t'\n>  }\n>  \n>  GIT_EXIT_OK=\n"},{"id":"397328","messageId":"CAPUEspiPduAoxL4L-p97A-DR46EBp1HcpFMLgd4YfJbNv653xQ@mail.gmail.com","threadId":"53421","inReplyTo":"xmqqr1vv4wzo.fsf@gitster.c.googlers.com","subject":"Re: [PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2020-05-07T17:33:15Z","receivedAt":"2020-05-07T17:33:29Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Thu, May 7, 2020 at 7:53 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:\n>\n> > 662f9cf154 (tests: when run in Bash, annotate test failures with file\n> > name/line number, 2020-04-11), introduces a way to report the location\n> > (file:lineno) of a failed test case by traversing the bash callstack.\n> >\n> > The implementation requires bash and is therefore protected by a guard\n> > but NetBSD sh will still have to parse the function and therefore will\n> > result in:\n> >\n> >   ** t0000-basic.sh ***\n> >   ./test-lib.sh: 681: Syntax error: Bad substitution\n> >\n> > Enclose the bash specific code inside an eval to avoid parsing errors\n> > and while at it, simplify the logic so that instead of traversing the\n> > callstack just pop the two topmost entries that are required.\n> >\n> > Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n>\n> Is the rewritten bash-snippet in the evaled text what Dscho\n> suggested us to use, or is it totally yours?\n\nIt is all mine, but Dscho's detailed description of the implementation it\nis replacing allowed me to validate its correctness (under the documented\nuse cases)\n\nmy hope was that Dscho's and Danh would quickly agree as it is simpler\nand faster, as well as providing some more description of its operation in\nthe commit message for future reviewers.\n\n> I know Dscho helped to\n> shoot down some \"simpler\" reimplementations you came up with,\n> pointing out how they were broken, but it is unclear how we ended up\n> with this version.\n\nI made the wrong assumptions while focusing on translating the code\nto posix sh and ended up with a broken version.\n\nAnother reason why I did the \"while at it\" was to avoid someone else\nhaving the same problem by simplifying it and making sure that uncommon\nsyntax (like ${1+$1..}, or the use of $LINENO which would never apply\nto our code)\nweren't needed.\n\n> I wish you didn't do the \"while at it\" rewrite in the same patch.\n> If it were only \"put bash-only stuff in an evaled string\", it would\n> have been a lot more comfortable applying it and merging quickly\n> down, as it would be clear that we won't be breaking bash codepath\n> and we'd be helping other shells.  With the \"while at it\", you made\n> it quite unclear.\n\nfair enough, and considering that \"fixing other shell\" has higher priority\nwill send a v2 to do so.\n\nwill do any \"simplification\" on a follow up and try to monitor these issues\nearly\n\nCarlo\n"},{"id":"397329","messageId":"20200507175706.19986-1-carenas@gmail.com","threadId":"53421","inReplyTo":"20200507055118.69971-1-carenas@gmail.com","subject":"[PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2020-05-07T17:57:06Z","receivedAt":"2020-05-07T17:57:30Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"662f9cf154 (tests: when run in Bash, annotate test failures with file\nname/line number, 2020-04-11), introduces a way to report the location\n(file:lineno) of a failed test case by traversing the bash callstack.\n\nThe implementation requires bash and uses shell arrays and is therefore\nprotected by a guard but NetBSD sh will still have to parse the function\nand therefore will result in:\n\n  ** t0000-basic.sh ***\n  ./test-lib.sh: 681: Syntax error: Bad substitution\n\nEnclose the bash specific code inside an eval to avoid parsing errors in\nthe same way than 5826b7b595 (test-lib: check Bash version for '-x'\nwithout using shell arrays, 2019-01-03)\n\nSigned-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n---\n t/test-lib.sh | 18 ++++++++++--------\n 1 file changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 1b221951a8..baf94546da 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -677,14 +677,16 @@ die () {\n \n file_lineno () {\n \ttest -z \"$GIT_TEST_FRAMEWORK_SELFTEST\" && test -n \"$BASH\" || return 0\n-\tlocal i\n-\tfor i in ${!BASH_SOURCE[*]}\n-\tdo\n-\t\tcase $i,\"${BASH_SOURCE[$i]##*/}\" in\n-\t\t0,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }\"; return;;\n-\t\t*,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }\"; return;;\n-\t\tesac\n-\tdone\n+\teval '\n+\t\tlocal i\n+\t\tfor i in ${!BASH_SOURCE[*]}\n+\t\tdo\n+\t\t\tcase $i,\"${BASH_SOURCE[$i]##*/}\" in\n+\t\t\t0,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }\"; return;;\n+\t\t\t*,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }\"; return;;\n+\t\t\tesac\n+\t\tdone\n+\t'\n }\n \n GIT_EXIT_OK=\n-- \n2.26.2.717.g5cccb0e1a8\n\n"},{"id":"397343","messageId":"nycvar.QRO.7.76.6.2005072139300.56@tvgsbejvaqbjf.bet","threadId":"53421","inReplyTo":"20200507055118.69971-1-carenas@gmail.com","subject":"Re: [PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-05-07T19:52:12Z","receivedAt":"2020-05-07T19:52:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Carlo,\n\nOn Wed, 6 May 2020, Carlo Marcelo Arenas Belón wrote:\n\n> 662f9cf154 (tests: when run in Bash, annotate test failures with file\n> name/line number, 2020-04-11), introduces a way to report the location\n> (file:lineno) of a failed test case by traversing the bash callstack.\n>\n> The implementation requires bash and is therefore protected by a guard\n> but NetBSD sh will still have to parse the function and therefore will\n> result in:\n>\n>   ** t0000-basic.sh ***\n>   ./test-lib.sh: 681: Syntax error: Bad substitution\n>\n> Enclose the bash specific code inside an eval to avoid parsing errors\n> and while at it, simplify the logic so that instead of traversing the\n> callstack just pop the two topmost entries that are required.\n\nI would be okay with that, but that's not what the patch does:\n\n> Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n> ---\n>  t/test-lib.sh | 15 +++++++--------\n>  1 file changed, 7 insertions(+), 8 deletions(-)\n>\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 1b221951a8..60b8e70678 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -677,14 +677,13 @@ die () {\n>\n>  file_lineno () {\n>  \ttest -z \"$GIT_TEST_FRAMEWORK_SELFTEST\" && test -n \"$BASH\" || return 0\n> -\tlocal i\n> -\tfor i in ${!BASH_SOURCE[*]}\n> -\tdo\n> -\t\tcase $i,\"${BASH_SOURCE[$i]##*/}\" in\n> -\t\t0,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }\"; return;;\n> -\t\t*,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }\"; return;;\n> -\t\tesac\n> -\tdone\n\nNote how this `for` loop stops as soon as it finds a `t/[0-9]*.sh` in the\nbacktrace?\n\n> +\teval '\n> +\t\tlocal n=$(echo ${#BASH_SOURCE[*]})\n> +\t\tif test $n -ge 2\n> +\t\tthen\n> +\t\t\techo \"${BASH_SOURCE[$n - 1]}:${BASH_LINENO[$n - 2]}: $1: \"\n> +\t\tfi\n\nThis loop is completely lost here.\n\nNow, you could argue that your version is better because it avoids the\nloop and always shows the ultimate caller in the backtrace.\n\nHowever, I would then immediately point you to `t/t0027-auto-crlf.sh` and\nask whether it is all that useful to the `commit_chk_wrnNNO` call rather\nthan one of the five `test_expect_success` calls contained in that\nfunction.\n\nBesides, you simply replaces `${1+$1: }` by `$1: `.\n\nAgain, you could argue that your version is better because there is now\nonly one caller, and it always passes `error` as first parameter.\n\nI would not be _too_ happy about losing the logic that allows calling\n`file_lineno` in other circumstances (I found it valuable for debugging),\nbut _in the least_ you need to talk about this change in the commit\nmessage. Just changing the behavior without even describing, let alone\njustifying, it in the commit message is a bad idea.\n\nCiao,\nDscho\n\n> +\t'\n>  }\n>\n>  GIT_EXIT_OK=\n> --\n> 2.26.2.686.gfaf46a9ccd\n>\n>\n"},{"id":"397384","messageId":"20200508005817.GA24664@Carlos-MBP","threadId":"53421","inReplyTo":"nycvar.QRO.7.76.6.2005072139300.56@tvgsbejvaqbjf.bet","subject":"Re: [PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Carlo Marcelo Arenas Belón","fromEmail":"carenas@gmail.com","sentAt":"2020-05-08T00:58:17Z","receivedAt":"2020-05-08T00:58:22Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Thu, May 07, 2020 at 09:52:12PM +0200, Johannes Schindelin wrote:\n> On Wed, 6 May 2020, Carlo Marcelo Arenas Belón wrote:\n> >\n> > Enclose the bash specific code inside an eval to avoid parsing errors\n> > and while at it, simplify the logic so that instead of traversing the\n> > callstack just pop the two topmost entries that are required.\n> \n> I would be okay with that, but that's not what the patch does:\n\nFWIW that was the intention, but luckily Junio quickly predicted it was\nmost likely buggy and so has been since made obsolete by:\n\n  https://lore.kernel.org/git/20200507175706.19986-1-carenas@gmail.com/\n\n> > +\teval '\n> > +\t\tlocal n=$(echo ${#BASH_SOURCE[*]})\n> > +\t\tif test $n -ge 2\n> > +\t\tthen\n> > +\t\t\techo \"${BASH_SOURCE[$n - 1]}:${BASH_LINENO[$n - 2]}: $1: \"\n> > +\t\tfi\n> \n> This loop is completely lost here.\n> \n> Now, you could argue that your version is better because it avoids the\n> loop and always shows the ultimate caller in the backtrace.\n> \n> However, I would then immediately point you to `t/t0027-auto-crlf.sh` and\n> ask whether it is all that useful to the `commit_chk_wrnNNO` call rather\n> than one of the five `test_expect_success` calls contained in that\n> function.\n\nas I said originally, I thought it would had been even better to be specific\nup to the line number of the instruction that failed, after all we already\nhave the whole function code for context in the message.\n\n> Besides, you simply replaces `${1+$1: }` by `$1: `.\n\nI couldn't figure out why that was needed, but while I am just slow, this\none is actually genius!; you are using a shell parameter expansion (which\nis even POSIX sh compatible) to do string concatenation!\n\nconditionally, noneless and not even using a silly if (like I would have\ndone) or a bash += concatenation operator.\n\n> Again, you could argue that your version is better because there is now\n> only one caller, and it always passes `error` as first parameter.\n> \n> I would not be _too_ happy about losing the logic that allows calling\n> `file_lineno` in other circumstances (I found it valuable for debugging),\n> but _in the least_ you need to talk about this change in the commit\n> message. Just changing the behavior without even describing, let alone\n> justifying, it in the commit message is a bad idea.\n\nfair enough; but in my defense, I couldn't had been made aware this was\nbeing used also for debugging, or called without the parameter or even\ncalled in a way where it will report its own LINENO (which you clearly\nexplained before as being the wrong value to report and that lead to\nmy confused first attempt at porting it)\n\nthanks again, for your insightful feedback, and guess then there is no\nmore point on trying to simplify it further, and if you could ACK my\nother proposal, hopefully neither a need to find workarounds to running\ntests on NetBSD for the current master.\n\nif we decide later into improving the accuracy of the report, might be\nworth documenting some of what I learned in the commit message, for the\nfuture reviewers, who hopefully will be less thick headed.\n\nCarlo\n\nPS. I know I botched the v2 git send-email, so you didn't get a CC, or even\n    have the v2 in the subject, hope it would be still good enough but let\n    me know otherwise.\n"},{"id":"397386","messageId":"xmqqpnbf1aze.fsf@gitster.c.googlers.com","threadId":"53421","inReplyTo":"20200508005817.GA24664@Carlos-MBP","subject":"Re: [PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-05-08T01:17:25Z","receivedAt":"2020-05-08T01:17:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Marcelo Arenas Belón <carenas@gmail.com> writes:\n\n> On Thu, May 07, 2020 at 09:52:12PM +0200, Johannes Schindelin wrote:\n>> On Wed, 6 May 2020, Carlo Marcelo Arenas Belón wrote:\n>> >\n>> > Enclose the bash specific code inside an eval to avoid parsing errors\n>> > and while at it, simplify the logic so that instead of traversing the\n>> > callstack just pop the two topmost entries that are required.\n>> \n>> I would be okay with that, but that's not what the patch does:\n>\n> FWIW that was the intention, but luckily Junio quickly predicted it was\n> most likely buggy and so has been since made obsolete by:\n>\n>   https://lore.kernel.org/git/20200507175706.19986-1-carenas@gmail.com/\n\nHeh, don't give me too much credit.  I just noticed that they cannot\nbe implementing the same thing, but I couldn't tell if the new\nbehaviour was something you two agreed to be better, and asked for a\nclarification.\n\nIn any case, the \"just protect with eval '' block to avoid hurting\nother shells\" version should be the first step.  Improving it\nfurther is a separate topic.\n\nThanks.\n"},{"id":"397444","messageId":"nycvar.QRO.7.76.6.2005090151350.56@tvgsbejvaqbjf.bet","threadId":"53421","inReplyTo":"20200507175706.19986-1-carenas@gmail.com","subject":"Re: [PATCH] t/test_lib: avoid naked bash arrays in file_lineno","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-05-08T23:53:51Z","receivedAt":"2020-05-08T23:54:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Carlo,\n\nthis is v2, right? The subject says `[PATCH]`, not `[PATCH v2]`, so I am\njust trying to make sure.\n\nIt's things like this why I never use `git send-email` manually anymore.\nYes, sure, GitGitGadget helps others, too, but its initial primary goal\nwas to help me not botch my patch submissions.\n\nOn Thu, 7 May 2020, Carlo Marcelo Arenas Belón wrote:\n\n> 662f9cf154 (tests: when run in Bash, annotate test failures with file\n> name/line number, 2020-04-11), introduces a way to report the location\n> (file:lineno) of a failed test case by traversing the bash callstack.\n>\n> The implementation requires bash and uses shell arrays and is therefore\n> protected by a guard but NetBSD sh will still have to parse the function\n> and therefore will result in:\n>\n>   ** t0000-basic.sh ***\n>   ./test-lib.sh: 681: Syntax error: Bad substitution\n>\n> Enclose the bash specific code inside an eval to avoid parsing errors in\n> the same way than 5826b7b595 (test-lib: check Bash version for '-x'\n> without using shell arrays, 2019-01-03)\n>\n> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>\n\nI still provided help, I hope?\n\n> ---\n>  t/test-lib.sh | 18 ++++++++++--------\n>  1 file changed, 10 insertions(+), 8 deletions(-)\n>\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index 1b221951a8..baf94546da 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -677,14 +677,16 @@ die () {\n>\n>  file_lineno () {\n>  \ttest -z \"$GIT_TEST_FRAMEWORK_SELFTEST\" && test -n \"$BASH\" || return 0\n> -\tlocal i\n> -\tfor i in ${!BASH_SOURCE[*]}\n> -\tdo\n> -\t\tcase $i,\"${BASH_SOURCE[$i]##*/}\" in\n> -\t\t0,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }\"; return;;\n> -\t\t*,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }\"; return;;\n> -\t\tesac\n> -\tdone\n> +\teval '\n> +\t\tlocal i\n> +\t\tfor i in ${!BASH_SOURCE[*]}\n> +\t\tdo\n> +\t\t\tcase $i,\"${BASH_SOURCE[$i]##*/}\" in\n> +\t\t\t0,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }\"; return;;\n> +\t\t\t*,t[0-9]*.sh) echo \"t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }\"; return;;\n> +\t\t\tesac\n> +\t\tdone\n> +\t'\n\nThis one looks correct to me.\n\nCiao,\nDscho\n\n>  }\n>\n>  GIT_EXIT_OK=\n> --\n> 2.26.2.717.g5cccb0e1a8\n>\n>\n"}]}