From 6a5f7e7979525597767b906dcf01432e1e8fab4f Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Fri, 11 Oct 2019 12:09:45 -0700 Subject: [PATCH] dont collect upstream details from big repos --- git-recent | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/git-recent b/git-recent index cb1fad7..495970c 100755 --- a/git-recent +++ b/git-recent @@ -32,13 +32,21 @@ while getopts "n:" opt; do done shift $((OPTIND-1)) +## dont collect upstream details ([ahead 2, behind 54]) for big-ass git repos, it adds >5s. +# TODO, use `git count-objects -v` and consider `in-pack` and `size-pack` instead of special casing chromium +if git config --get remote.origin.url | grep -q chromium.googlesource.com; then + upstream_deets="" +else + upstream_deets="%(color:yellow)%(upstream:track)%(color:reset)" +fi + format="\ %(HEAD) \ $branch|\ %(color:bold red)%(objectname:short)%(color:reset) \ %(color:bold green)(%(committerdate:relative))%(color:reset) \ %(color:bold blue)%(authorname)%(color:reset) \ -%(color:yellow)%(upstream:track)%(color:reset) +$upstream_deets $spacer|\ %(contents:subject) $spacer|"