Skip to contentSkip to conversation

git-status always says what branch it's on

PATCH In review Andy Parkins 2 participants 2 messages Aug 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-status always says what branch it's on

If the current branch was "master" then git-status wouldn't say

# On branch XXXX

In its output. This patch makes it so that this message is always output; regardless of branch name.

---
 wt-status.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
wt-status.c +1 -1
index de1be5b..9a78dac 100644
@@ -271,7 +271,7 @@ static void wt_status_print_verbose(struct wt_status *s)
 
 void wt_status_print(struct wt_status *s)
 {
-	if (s->branch && strcmp(s->branch, "refs/heads/master"))
+	if (s->branch)
 		color_printf_ln(color(WT_STATUS_HEADER),
 			"# On branch %s", s->branch);
 
Signature · 1 line
1.4.4.1.g3ece-dirty
#1 lore raw
Quoted 7 lines · Andy Parkins

If the current branch was "master" then git-status wouldn't say

# On branch XXXX

In its output. This patch makes it so that this message is always output; regardless of branch name.

I like it. I know that it's quiet when I'm on 'master', but I still need to spend an extra cycle to remember that fact. Uniformity is a good thing in program behaviour.

Signature · 2 lines
Andreas Ericsson                   [email protected]
OP5 AB                             www.op5.se