[PATCH] git-branch: add -r switch to list refs/remotes/*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If we decide to use refs/remotes/, having a convenient way to
list them would be nice.

Signed-off-by: Eric Wong <normalperson@xxxxxxxx>

---

 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

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]