From 70403862d434683730cd59796c7e91c97977809f Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 26 Jun 2026 18:21:07 -0300 Subject: bin/vcs: Add origin detection for git_ps1() --- bin/vcs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/vcs b/bin/vcs index f633f5a9..a57c9f2f 100755 --- a/bin/vcs +++ b/bin/vcs @@ -88,6 +88,16 @@ git_ps1() { IS_BEHIND=true fi + HAS_UPSTREAM=false + if printf '%s\n' "$BRANCH_LINE" | grep -qF '...'; then + HAS_UPSTREAM=true + fi + + HAS_ORIGIN=false + if [ -n "$(git config --local --get remote.origin.url 2>/dev/null)" ]; then + HAS_ORIGIN=true + fi + LINE='' if [ "$IS_AHEAD" = true ] && [ "$IS_BEHIND" = true ]; then @@ -118,6 +128,13 @@ git_ps1() { elif [ "$HAS_UNTRACKED" = true ]; then COLOR_FN=lightblue LINE="{$LINE}" + elif [ "$HAS_UPSTREAM" = false ]; then + if [ "$HAS_ORIGIN" = true ]; then + COLOR_FN=yellow + else + COLOR_FN=yellowb + fi + LINE="($LINE)" else COLOR_FN=green LINE="($LINE)" -- cgit v1.3