opt1,opt2,opt3
逗号分隔的语法用于 git diff
D:\git\git\t>grep -E "\-X" *.sh|grep "\,"
t4047-diff-dirstat.sh: test_must_fail git show -X=20,cumulative
t4047-diff-dirstat.sh:test_expect_success 'explicit defaults: -Xchanges,noncumulative,3' '
t4047-diff-dirstat.sh: git diff -Xchanges,noncumulative,3 HEAD^..HEAD >actual_diff_dirstat &&
不适用于合并/变基中的策略选项。
对于这些选项,需要多个-Xopt1 -Xopt2
。
但我只能找到一个实例来测试这种语法,而且是失败的情况:t3418-rebase-continue.sh
test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic
实际上,我不确定这是否会被使用。
最初提交(2009年11月,Git v1.7.0-rc0)引入了-X
选项,但只测试了一个策略选项。
我看到一个例子,使用了git cherry-pick:
D:\git\git\t>grep -E“-X.*?-X”*.sh
t3418-rebase-continue.sh:test_must_fail git rebase -i -s funny -Xopt -Xfoo master topic
t3510-cherry-pick-sequence.sh:test_expect_code 128 git cherry-pick -s -m $mainline --strategy=recursive -X patience -X ours initial..anotherpick &&
请查看t3510-cherry-pick-sequence.sh
,它使用与git merge相同的策略/选项。
test_expect_code 128 git cherry-pick -s -m $mainline --strategy=recursive -X patience -X ours initial..anotherpick