Re: [PATCH] Change git-branch to list branches

2005-08-17 Thread Kalle Valo
Junio C Hamano [EMAIL PROTECTED] writes:

 I do not think we have agreed to limit ourselves to a flat
 namespace under refs/heads without subdirectories.  Something
 like what git-show-branches-script does when $# == 0, perhaps?

I didn't realise this. I'll send a revised patch soon.

-- 
Kalle Valo

-
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Change git-branch to list branches

2005-08-16 Thread Kalle Valo
If no argument provided to `git branch`, show available branches and
mark current branch with star.

This is based on patch written by Amos Waterland [EMAIL PROTECTED].

Signed-off-by: Kalle Valo [EMAIL PROTECTED]
---

 git-branch-script |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

38aca3bb4ad4e6b0e10e295a87a9f5ce37ff5be4
diff --git a/git-branch-script b/git-branch-script
--- a/git-branch-script
+++ b/git-branch-script
@@ -11,7 +11,13 @@ case $2 in
 esac
 rev=$(git-rev-parse --revs-only --verify $head) || exit
 
-[ -z $branchname ]  die git branch: I want a branch name
+if [ -z $branchname ]; then
+current=$(basename $(readlink $GIT_DIR/HEAD))
+cd $GIT_DIR/refs/heads 
+ls | sed -e s/^/  / -e s/  $current/* $current/
+exit
+fi
+
 [ -e $GIT_DIR/refs/heads/$branchname ]  die $branchname already exists
 
 echo $rev  $GIT_DIR/refs/heads/$branchname

-
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Change git-branch to list branches

2005-08-16 Thread Junio C Hamano
Kalle Valo [EMAIL PROTECTED] writes:

 If no argument provided to `git branch`, show available branches and
 mark current branch with star.

I like the general direction, but this particular implementation
may be a bit troublesome.

 +if [ -z $branchname ]; then
 +current=$(basename $(readlink $GIT_DIR/HEAD))
 +cd $GIT_DIR/refs/heads 
 +ls | sed -e s/^/  / -e s/  $current/* $current/
 +exit
 +fi

I do not think we have agreed to limit ourselves to a flat
namespace under refs/heads without subdirectories.  Something
like what git-show-branches-script does when $# == 0, perhaps?


-
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html