From 185c2879d56637babc4aae2eba8a20ecb9977752 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Sun, 2 Dec 2018 10:47:37 -0600 Subject: [PATCH] Update to show the subject if the body is empty --- lib/helpers.bash | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/helpers.bash b/lib/helpers.bash index 5652a2b8..4cc2d574 100644 --- a/lib/helpers.bash +++ b/lib/helpers.bash @@ -181,7 +181,16 @@ _bash-it_update() { status="$(git rev-list master..${BASH_IT_REMOTE}/master 2> /dev/null)" if [[ -n "${status}" ]]; then - git log --merges --format="%h: %b (%an)" master..${BASH_IT_REMOTE}/master + + for i in $(git rev-list --merges master..${BASH_IT_REMOTE}); do + num_of_lines=$(git log -1 --format=%B $i | awk 'NF' | wc -l) + if [ $num_of_lines -eq 1 ]; then + description="%s" + else + description="%b" + fi + git log --format="%h: $description (%an)" -1 $i + done echo "" read -e -n 1 -p "Would you like to update to $(git log -1 --format=%h origin/master)? [Y/n] " RESP case $RESP in