Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15
DORMANTno replies

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

From: Eric Wong <hidden>
Date: 2016-06-15 22:42:20
Subsystem: the rest · Maintainer: Linus Torvalds

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

Signed-off-by: Eric Wong <redacted>

---

 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help