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

5 messages from 2018-01-01 to 2018-01-04. Participants: Matwey V. Kornilov, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/47519

## Matwey V. Kornilov, 2018-01-01 11:28

Subject: Fwd: Unknown option for merge-recursive: -X'diff-algorithm=patience'
Message-ID: <CAJs94Eakp6kaD=+imH2cZdB-=2NCBJNu0Rt=MmRtWiM60QGBSA@mail.gmail.com>
URL: https://gitlist.dev/e/CAJs94Eakp6kaD%3D%2BimH2cZdB-%3D2NCBJNu0Rt%3DMmRtWiM60QGBSA%40mail.gmail.com
In-Reply-To: <9e4ffb63-59de-a020-fee8-6cefae3b3dda@gmail.com>

```
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.

-- 
With best regards,
Matwey V. Kornilov

```

## Matwey V. Kornilov, 2018-01-04 12:34

Subject: Re: Fwd: Unknown option for merge-recursive: -X'diff-algorithm=patience'
Message-ID: <p2l6s0$eot$1@blaine.gmane.org>
URL: https://gitlist.dev/e/p2l6s0%24eot%241%40blaine.gmane.org
In-Reply-To: <CAJs94Eakp6kaD=+imH2cZdB-=2NCBJNu0Rt=MmRtWiM60QGBSA@mail.gmail.com>

```

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 пишет:
> 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.
> 



```

## Junio C Hamano, 2018-01-04 18:57

Subject: Re: Fwd: Unknown option for merge-recursive: -X'diff-algorithm=patience'
Message-ID: <xmqqefn5fo5d.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqefn5fo5d.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <p2l6s0$eot$1@blaine.gmane.org>

```
"Matwey V. Kornilov" <matwey.kornilov@gmail.com> writes:

> It seems there is some issue with double escaping:
> ...
>> # 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?


```

## Matwey V. Kornilov, 2018-01-04 19:25

Subject: Re: Fwd: Unknown option for merge-recursive: -X'diff-algorithm=patience'
Message-ID: <CAJs94EbtnCcKiYO9sSqhOwtkSCsApRJoSzVEA7_N23wXGhwoww@mail.gmail.com>
URL: https://gitlist.dev/e/CAJs94EbtnCcKiYO9sSqhOwtkSCsApRJoSzVEA7_N23wXGhwoww%40mail.gmail.com
In-Reply-To: <xmqqefn5fo5d.fsf@gitster.mtv.corp.google.com>

```
2018-01-04 21:57 GMT+03:00 Junio C Hamano <gitster@pobox.com>:
> "Matwey V. Kornilov" <matwey.kornilov@gmail.com> writes:
>
>> It seems there is some issue with double escaping:
>> ...
>>> # 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?
>

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

-- 
With best regards,
Matwey V. Kornilov

```

## Johannes Schindelin, 2018-01-04 21:02

Subject: Re: Fwd: Unknown option for merge-recursive: -X'diff-algorithm=patience'
Message-ID: <alpine.DEB.2.21.1.1801042201390.32@MININT-6BKU6QN.europe.corp.microsoft.com>
URL: https://gitlist.dev/e/alpine.DEB.2.21.1.1801042201390.32%40MININT-6BKU6QN.europe.corp.microsoft.com
In-Reply-To: <CAJs94Eakp6kaD=+imH2cZdB-=2NCBJNu0Rt=MmRtWiM60QGBSA@mail.gmail.com>

```
Hi Matwey,

On Mon, 1 Jan 2018, Matwey V. Kornilov wrote:

> 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.

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

```
