Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>(late edit: diff-tree's <code>-c</code> lists only the files that differ from all parents i.e. is exactly what was asked for:</p> <pre><code>git diff-tree -r -c $commit # content that doesn't match any parent version </code></pre> <p>)<br> ( later edit: the above is actually not quite true: what was requested and what the script below prints is all files having multiple parents with changes since the merge base. All such files by definition require merge resolution. The diff ignores files whose merge resolution was to take one parent as the result. )</p> <hr> <p>Okay, from the edit it appears you want to generate a list of files to check for possible mis-merges by the merge driver, the files combining actual changes from at least two parents. This'll do ya:</p> <p>(edit: correctly handle merges that include no changes from a changed parent; also incorporate @torek's simplification.)</p> <pre><code>substantive-merges-in () { set -- `git rev-list $1^! --parents`; child=$1; shift; base=$(git merge-base "$@") for parent; do git diff-tree $base $parent -r --name-only --diff-filter=M done \ | sort \ | uniq -d } substantive-merges-in master </code></pre> <hr> <p>Testing:</p> <pre><code>git init t;cd t git checkout -b first # msysgit doesn't install `seq`? for i in 1 2 3 4 5 6 7 8 9 10; do echo $i &gt;&gt;both; done cp both justfirst git add *; git commit -minitial git branch second sed -i s/3/3onfirst/ both sed -i s/3/3onfirst/ justfirst git commit -amtwochanges git checkout second sed -i s/7/7onsecond/ both git commit -amonechange git merge first substantive-merges-in HEAD # should list 'both' git checkout -B second second@{1} git merge --no-commit first git checkout --ours both git commit -amstomp substantive-merges-in HEAD # should still list 'both' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload