Skip to content

Instantly share code, notes, and snippets.

@a-suenami
Created November 8, 2012 04:56
Show Gist options
  • Save a-suenami/4036860 to your computer and use it in GitHub Desktop.
Save a-suenami/4036860 to your computer and use it in GitHub Desktop.
git-branch-log.sh

使い方

任意のディレクトリにダウンロードして、以下のコマンドを実行する。

./git-branch-log.sh <merge_commit>
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: git-branch-log <merge_commit>" 1>&2
exit 1
fi
merge_commit=$1
parents=`git show $merge_commit | grep "Merge:"`
mainline_head=`echo $parents | sed -e "s/^Merge: \(.\+\) \(.\+\)$/\1/"`
subline_head=`echo $parents | sed -e "s/^Merge: \(.\+\) \(.\+\)$/\2/"`
git log ${mainline_head}...${subline_head}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment