git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* syntax error in git-rebase while running t34* tests
@ 2016-05-10 17:29 Armin Kunaschik
  2016-05-10 19:11 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Armin Kunaschik @ 2016-05-10 17:29 UTC (permalink / raw)
  To: Git List

Hello,

I noticed in my environment (AIX, ksh) that all rebase tests don't work.
git-rebase terminates with
git-rebase[6]: Syntax error at line 3 : `newline or ;' is not expected.
Digging deeper I found the problem in git-rebase--interactive line 85

<snip>
strategy_args=${strategy:+--strategy=$strategy}
eval '
        for strategy_opt in '"$strategy_opts"'
        do
                strategy_args="$strategy_args -X$(git rev-parse
--sq-quote "${strategy_opt#--}")"
        done
'
<snip>

This snippet fails when $strategy_opts is empty or undefined... and my
eval seems not to like this.
The for loop runs fine, even with empty strategy_opts, but not inside eval.
I fail to see why eval is really necessary here. Things can probably
be done without eval, but I
don't feel to see the big picture around this code.

My quick and dirty hotfix is to place a
test -n "$strategy_opts" &&
in front of the eval.
The tests run fine after this change.

What do you think?

Armin

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

end of thread, other threads:[~2016-05-11 13:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-10 17:29 syntax error in git-rebase while running t34* tests Armin Kunaschik
2016-05-10 19:11 ` Junio C Hamano
2016-05-10 20:47   ` Jeff King
2016-05-10 20:53     ` Junio C Hamano
2016-05-10 21:07       ` Jeff King
2016-05-11 13:28         ` Johannes Schindelin
2016-05-11 13:36           ` Jeff King

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 NNTP newsgroup(s).