File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1659,24 +1659,35 @@ do_diff() {
1659
1659
# ## command: distribute ###
1660
1660
1661
1661
apply_to_topic () {
1662
- local rev branch topic state
1662
+ local rev branch topic state base subject match
1663
1663
rev=" ${1} "
1664
1664
branch=$( cat " ${STATE} /distribute-branch" 2> /dev/null)
1665
1665
topic=$( cat " ${STATE} /distribute-topic" 2> /dev/null)
1666
1666
state=$( cat " ${STATE} /distribute-state" 2> /dev/null)
1667
+ base=" $( < " ${STATE} /base-name" ) "
1667
1668
1668
1669
echo
1669
1670
GIT_PAGER=" " ${GIT} log --oneline -1 " ${rev} "
1670
1671
1672
+ subject=" $( git log --pretty=" format:%s" -1 " ${rev} " ) "
1673
+ case " ${subject} " in
1674
+ " fixup!" * |" amend!" * |" squash!" * )
1675
+ match=" ${subject#* \! } "
1676
+ ;;
1677
+ esac
1678
+
1671
1679
while [ -z " ${topic} " ]; do
1672
- local i=0 ret
1680
+ local i=0 ret default
1673
1681
for branch in " ${branch_names[@]} " ; do
1674
1682
echo " ${i} ) ${branch} "
1683
+ if git log --pretty=" format:%s" " ${base} ..${branches[${i}]} " | grep -q " ^${match} $" ; then
1684
+ default=" ${i} "
1685
+ fi
1675
1686
i=$(( i+ 1 ))
1676
1687
done
1677
1688
echo " s) show patch"
1678
1689
echo " x) skip patch"
1679
- read -e -p " Branch: " ret
1690
+ read -e -p " Branch: " -i " ${default} " ret
1680
1691
case " ${ret} " in
1681
1692
s)
1682
1693
${GIT} show " ${rev} "
You can’t perform that action at this time.
0 commit comments