citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

commit 2200b2e26f68ae2329cc30ece56c9dd9410c1d38
parent 65f14535fdf5ba2c96cc35c39d911ae74dadb660
Author: William Casarin <jb55@jb55.com>
Date:   Mon,  4 Jan 2021 08:24:23 -0800

improve general status

Diffstat:
Mbin/general-status | 22+++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/bin/general-status b/bin/general-status @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export LESS="--quit-if-one-screen" +export LESS="-R -S --quit-if-one-screen" (printf "sys: %s@%s\npwd: %s\n" \ "$USER" \ @@ -8,11 +8,19 @@ export LESS="--quit-if-one-screen" "$PWD" if git rev-parse --is-inside-work-tree >/dev/null 2>/dev/null; then - git status -s - git remote -v | grep \(fetch\) | column -t -s $'\t' "$@" - conf="-c branch.color=always -c pager.branch=false" + printf "\n" + conf="-c color.status=always -c color.branch=always" + eachreffmt='%(authordate:short) %(authorname) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))' + git $conf status -s + git $conf remote -v | grep \(fetch\) | column -t -s $'\t' "$@" brconf="--sort=-committerdate" COLUMNS=$(stty size | cut -d" " -f2) - git $conf branch $brconf -v - git $conf branch $brconf -rv - fi) | $PAGER + + timeout 1 git lg --color=always --simplify-by-decoration || ( + printf "\n" + git for-each-ref --color=always --sort=-committerdate refs/heads/ --format="$eachreffmt" + printf "\n" + git for-each-ref --color=always --sort=-committerdate refs/remotes/ --format="$eachreffmt" + ) + +fi) | less -RSF