From: Eric Wong Date: Thu, 02 Mar 2006 20:23:17 GMT Subject: [PATCH] git-branch: add -r switch to list refs/remotes/* Message-ID: <20060302202317.GA6708@hand.yhbt.net> In-Reply-To: <20060302055831.GA16600@localdomain> If we decide to use refs/remotes/, having a convenient way to list them would be nice. Signed-off-by: Eric Wong --- git-branch.sh | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) 05fb74c2a8d4bf3692a7553c5225d25ab54f358a diff --git a/git-branch.sh b/git-branch.sh index 6ac961e..663a3a3 100755 --- a/git-branch.sh +++ b/git-branch.sh @@ -48,6 +48,12 @@ If you are sure you want to delete it, r exit 0 } +ls_remote_branches () { + git-rev-parse --symbolic --all | + sed -ne 's|^refs/\(remotes/\)|\1|p' | + sort +} + force= while case "$#,$1" in 0,*) break ;; *,-*) ;; *) break ;; esac do @@ -56,6 +62,10 @@ do delete_branch "$@" exit ;; + -r) + ls_remote_branches + exit + ;; -f) force="$1" ;; -- 1.2.3.gc55f