From 6dee39aa66dc6dbed901009c954708a89dc8da5b Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 1 Oct 2020 19:14:58 -0700 Subject: [PATCH] shlib.sh: pretty up some of the bang log output Clean up some of the ugly command names that can be fed into "bang" in order to make the log output more readable. Strip off any leading "eval " and transform the various flavors of "git... fetch --progress" into just "git fetch". Signed-off-by: Kyle J. McKay --- shlib.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/shlib.sh b/shlib.sh index 0d07397..0ab1ff2 100644 --- a/shlib.sh +++ b/shlib.sh @@ -467,6 +467,14 @@ bang() { bang_catch() { bang_active=1 bang_cmd="$*" + # clean up bang_cmd for log + bang_cmd="${bang_cmd#eval }" + [ "${bang_cmd#git_ulimit }" = "$bang_cmd" ] || + bang_cmd="git ${bang_cmd#git_ulimit }" + [ "${bang_cmd#git_fetch_q_progress }" = "$bang_cmd" ] || + bang_cmd="git fetch ${bang_cmd#git_fetch_q_progress }" + [ "${bang_cmd#git fetch --progress }" = "$bang_cmd" ] || + bang_cmd="git fetch ${bang_cmd#git fetch --progress }" bang_errcode=0 if [ "${show_progress:-0}" != "0" ]; then exec 3>&1 -- 2.11.4.GIT