From: Eric Wong Date: Thu, 2 Mar 2006 20:23:17 +0000 (-0800) Subject: git-branch: add -r switch to list refs/remotes/* X-Git-Tag: v1.3.0-rc1~83 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fd8fc4ade5c8973b3dca264cc0c26b091982870b;p=git.git git-branch: add -r switch to list refs/remotes/* If we decide to use refs/remotes/, having a convenient way to list them would be nice. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- diff --git a/git-branch.sh b/git-branch.sh index 6ac961e6d..663a3a370 100755 --- a/git-branch.sh +++ b/git-branch.sh @@ -48,6 +48,12 @@ If you are sure you want to delete it, run 'git branch -D $branch_name'." 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" ;;