Re: [PATCH] Change git-branch to list branches
- From
Junio C Hamano <junkio@cox.net>
- Date
- Aug 16, 2005, 21:08 UTC
- Message-ID
- <7vslx98ua0.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <87d5odlq6l.fsf_-_@litku.valo.iki.fi>
Kalle Valo <Kalle.Valo@iki.fi> 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.
Show 6 quoted lines
> +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?