#!/bin/bash # # git-diff-subj - side-by-side diff of subject lines between two branches # # # Copyright (C) 2007 Karel Zak # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This file is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # BRANCH_A="$1" BRANCH_B="$2" if [ -z "$BRANCH_A" -o -z "$BRANCH_B" ]; then echo "Usage: $0 " exit 1 fi TMP_A=$(mktemp) TMP_B=$(mktemp) echo "$BRANCH_A $BRANCH_B"; \ echo "--------------------------------------------------------------------------------------------"; \ git log --pretty=format:"%s" "$BRANCH_A" ^"$BRANCH_B" | sort > "$TMP_A" git log --pretty=format:"%s" "$BRANCH_B" ^"$BRANCH_A" | sort > "$TMP_B" diff --side-by-side --width=115 "$TMP_A" "$TMP_B" rm -f "$TMP_A" "$TMP_B"