Skip to contentSkip to conversation

Unknown option for merge-recursive: -X'diff-algorithm=patience'

DISCUSSION Matwey V. Kornilov 3 participants 5 messages Jan 1, 2018 – Jan 4, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello,

I am running git 2.15.1 and facing the following issue with linux kernel tree.

# git checkout v3.8
# git branch abc-3.8
# git checkout v3.9
# git branch abc-3.9
# git checkout abc-3.8

Introduce new commit on top of abc-3.8. Here, I edit README.

# vim README
# git commit -a -v
[abc-3.8 4bf088b5d341] Hello world

Then I try to rebase abc-3.9 on top of abc-3.8 as the following:

# git rebase --preserve-merges -s recursive -Xdiff-algorithm=patience
--onto abc-3.8 v3.8 abc-3.9

And then I see:

fatal: Unknown option for merge-recursive: -X'diff-algorithm=patience' Error redoing merge e84cf5d0fd53badf3a93c790e280cc92a69ed999

Attached here is GIT_TRACE=1 output.

Signature · 2 lines
With best regards,
Matwey V. Kornilov
#2 lore raw

Hi,

It seems there is some issue with double escaping:

14:57:18.524010 git.c:344 trace: built-in: git 'merge'
'--no-log' '--no-ff' '--strategy=recursive' '-X' ''\''diff-algorithm=p atience'\''' '-m' 'Merge branch '\''core-rcu-for-linus'\'' of
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Where did additional quotes around diff-algorithm came from?

01.01.2018 14:28, Matwey V. Kornilov пишет:

Quoted 29 lines

Hello,

I am running git 2.15.1 and facing the following issue with linux kernel tree.

# git checkout v3.8
# git branch abc-3.8
# git checkout v3.9
# git branch abc-3.9
# git checkout abc-3.8

Introduce new commit on top of abc-3.8. Here, I edit README.

# vim README
# git commit -a -v
[abc-3.8 4bf088b5d341] Hello world

Then I try to rebase abc-3.9 on top of abc-3.8 as the following:

# git rebase --preserve-merges -s recursive -Xdiff-algorithm=patience
--onto abc-3.8 v3.8 abc-3.9

And then I see:

fatal: Unknown option for merge-recursive: -X'diff-algorithm=patience' Error redoing merge e84cf5d0fd53badf3a93c790e280cc92a69ed999

Attached here is GIT_TRACE=1 output.

#3 lore raw
Quoted 8 lines · Matwey V. Kornilov

It seems there is some issue with double escaping:
...

Quoted 6 lines
# git rebase --preserve-merges -s recursive -Xdiff-algorithm=patience
--onto abc-3.8 v3.8 abc-3.9

And then I see:

fatal: Unknown option for merge-recursive: -X'diff-algorithm=patience'

The string looks like a result of a shell script that quotes any end-user controlled string before incorporating into a string to be eval-ed, or something like that. Is this a recent regression? Does a bit older version of Git, like 2.12 or older, behave differently?

#4 lore raw

2018-01-04 21:57 GMT+03:00 Junio C Hamano <[email protected]>:

Quoted 7 lines
Quoted 5 lines · Matwey V. Kornilov

It seems there is some issue with double escaping:
...

Quoted 3 lines
# git rebase --preserve-merges -s recursive -Xdiff-algorithm=patience
--onto abc-3.8 v3.8 abc-3.9
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines

And then I see:

fatal: Unknown option for merge-recursive: -X'diff-algorithm=patience'

The string looks like a result of a shell script that quotes any end-user controlled string before incorporating into a string to be eval-ed, or something like that. Is this a recent regression? Does a bit older version of Git, like 2.12 or older, behave differently?

I've just checked, 2.12.4 has the same behaviour. By the way, can you reproduce this at all?

Signature · 2 lines
With best regards,
Matwey V. Kornilov
#5 lore raw
In reply to Matwey V. Kornilov

Hi Matwey,

Quoted 22 lines · Matwey V. Kornilov

Hello,

I am running git 2.15.1 and facing the following issue with linux kernel tree.

# git checkout v3.8
# git branch abc-3.8
# git checkout v3.9
# git branch abc-3.9
# git checkout abc-3.8

Introduce new commit on top of abc-3.8. Here, I edit README.

# vim README
# git commit -a -v
[abc-3.8 4bf088b5d341] Hello world

Then I try to rebase abc-3.9 on top of abc-3.8 as the following:

# git rebase --preserve-merges -s recursive -Xdiff-algorithm=patience
--onto abc-3.8 v3.8 abc-3.9
Quoted 6 lines

And then I see:

fatal: Unknown option for merge-recursive: -X'diff-algorithm=patience' Error redoing merge e84cf5d0fd53badf3a93c790e280cc92a69ed999

Attached here is GIT_TRACE=1 output.

Funnily enough, this had been reported on the Git for Windows bugtracker, and somebody even found the culprit:

https://github.com/git-for-windows/git/issues/1321#issuecomment-337279119

Sadly, I lost track of this. Will prepare a proper patch right now.

Ciao,
Johannes