Hi, On Thu, Jan 1, 2009 at 10:28 PM, Karl Chen <quarl@xxxxxxxxxxxxxxx> wrote: > > How about an option to git-branch that just prints the name of the > current branch for scripts' sake? To replace: > > git branch --no-color 2>/dev/null | perl -ne '/^[*] (.*)/ && print $1' FWIW, I had this in a stalled modification in a tree, it just add the '-c' (as "current") option to git branch. Patch is mostly for the record :/ The main trouble I have with pipe stuff is that it forks a process for something that can be done natively. Previously, I was using awk(1) to extract the current branch: $ git branch | awk '/^\*/ {print $2}' - Arnaud
Attachment:
show-current-branch.diff
Description: Binary data