Improve pull output, inspired by zimfw update
This commit is contained in:
parent
97b399681e
commit
51362d8c81
11
dup
11
dup
@ -48,10 +48,15 @@ function do_pull_maybe_quiet() {
|
||||
name="$1"
|
||||
dir="${2:-$name}"
|
||||
git_out="$(do_pull $dir)"
|
||||
if [[ "$quiet" != true || "$git_out" != "Already up to date." ]]
|
||||
first_line="${git_out%%$'\n'*}"
|
||||
if [[ "$quiet" != true || "$first_line" != "Already up to date." ]]
|
||||
then
|
||||
echo "Updating $name"
|
||||
echo "$git_out"
|
||||
echo "$(tput setaf 4)}$(tput sgr0) $(tput bold)$name$(tput sgr0): $first_line"
|
||||
fi
|
||||
if [[ $first_line == Updating* ]]
|
||||
then
|
||||
git -C "${dir}" log --graph --color --format='%C(yellow)%h%C(reset) %s %C(cyan)(%cr)%C(reset)' ${first_line##Updating } \
|
||||
| sed 's/^/ /'
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user