git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add git-branches-script
@ 2005-08-15 20:44 Amos Waterland
  2005-08-16 17:53 ` Kalle Valo
  2005-08-17 20:37 ` [PATCH] Add git-branches-script Miguel Bazdresch
  0 siblings, 2 replies; 7+ messages in thread
From: Amos Waterland @ 2005-08-15 20:44 UTC (permalink / raw)
  To: junkio; +Cc: git

For people whose workflow involves switching back and forth between a
lot of branches, it can be really helpful to be able to quickly tell
which branch you are on and which ones are available.  This patch
introduces a small script that when invoked as `git branches' prints a
list of available branches with a star in front of the one you are on:

 $ cd linux-2.6/
 $ git checkout -b ppc64-cleanups
 $ git checkout -b ppc64-new-devel
 $ git checkout -b ppc64-all-merge
 $ git branches
   master
 * ppc64-all-merge
   ppc64-cleanups
   ppc64-new-devel

Signed-off-by: Amos Waterland <apw@rossby.metr.ou.edu>

---

 git-branches-script |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
 create mode 100755 git-branches-script

12ab86f36137c4ffd1fb9b878479b9befe4cf2d4
diff --git a/git-branches-script b/git-branches-script
new file mode 100755
--- /dev/null
+++ b/git-branches-script
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+. git-sh-setup-script || die "Not a git archive"
+
+current=$(basename $(readlink $GIT_DIR/HEAD))
+
+cd $GIT_DIR/refs/heads &&
+ls | sed -e "s/^/  /" -e "s/  $current/* $current/"

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-17 20:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-15 20:44 [PATCH] Add git-branches-script Amos Waterland
2005-08-16 17:53 ` Kalle Valo
2005-08-16 17:58   ` [PATCH] Change git-branch to list branches Kalle Valo
2005-08-16 21:08     ` Junio C Hamano
2005-08-17 19:48       ` Kalle Valo
2005-08-17 20:15         ` Kalle Valo
2005-08-17 20:37 ` [PATCH] Add git-branches-script Miguel Bazdresch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).