Last active
May 2, 2020 07:51
-
-
Save yoichi/056fbf49eb0a9c2cbc743a1642c62c42 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# usage: | |
# git-list-conflicts.sh | |
# git-list-conflicts.sh branch-name | |
# git-list-conflicts.sh revison-begin..revision-end | |
git log --merges --pretty=tformat:%H $@ | while read COMMIT ; do | |
PARENTS=$(git log -1 --pretty=tformat:%P ${COMMIT}) | |
git checkout ${COMMIT}~1 2>/dev/null | |
git merge --no-commit $(echo ${PARENTS} | cut -f 2- -d" ") >/dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
echo ${COMMIT} | |
fi | |
git reset --hard >/dev/null | |
git checkout - >/dev/null 2>&1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment