From bbbcc0f0f21846eded068ee4484e25b7caa21b3a Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Mon, 27 Apr 2026 10:28:04 -0700 Subject: [PATCH] cli: prioritize github detection and avoid false gerrit positives --- git-recent | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-recent b/git-recent index d2d145d..f6516a2 100755 --- a/git-recent +++ b/git-recent @@ -122,10 +122,10 @@ if [[ "$show_links" = true ]]; then GERRIT_SERVER=$(echo "$GERRIT_SERVER" | sed -E 's|https?://||') # 2. Try bulk fetchers - if command -v git-cl >/dev/null 2>&1 && git cl status --fast --no-branch-color >/dev/null 2>&1; then - CL_TYPE="gerrit" - elif command -v gh >/dev/null 2>&1 && git remote -v | grep -q "github.com"; then + if command -v gh >/dev/null 2>&1 && git remote -v | grep -q "github.com"; then CL_TYPE="github" + elif command -v git-cl >/dev/null 2>&1 && [[ "$remote_url" == *.googlesource.com* || -n "$GERRIT_SERVER" ]]; then + CL_TYPE="gerrit" fi fi