From 1f6b93c2d05fb4fd4e62a0b37a970c860badd204 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Tue, 16 Aug 2022 10:00:04 -0700 Subject: [PATCH] objcount --- git-recent | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git-recent b/git-recent index d206fbf..f9a4da4 100755 --- a/git-recent +++ b/git-recent @@ -33,10 +33,10 @@ while getopts "n:" opt; do done shift $((OPTIND-1)) -# Dont collect upstream details ([ahead 2, behind 54]) for big-ass git repos. It's slow. -# git count-objects -v | grep -- "in-pack" | cut -d " " -f 2 -# 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 +# Dont collect upstream details ("[ahead 2, behind 54]"") for big-ass git repos. It's slow. +# TODO: count-object -v is slow. Maybe store setting in repo config somehow +obj_count=$(git count-objects -v 2>/dev/null | grep -- "in-pack" | cut -d " " -f 2) +if [ "$obj_count" -gt "5000000" ]; then upstream_deets="" else upstream_deets="%(color:yellow)%(upstream:track)%(color:reset)"