[PATCH] Colorize the branch's name in the status' output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Patryck Rouleau <PRouleau72@xxxxxxxxx>

When we are not on a branch, the message "Not currently on any branch." is
show in red. This patch makes the branch's name more visible by showing it
in green (the color of local branch).
---
 wt-status.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 54b6b03..5497ef3 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -629,7 +629,7 @@ static void wt_status_print_tracking(struct wt_status *s)
 
 void wt_status_print(struct wt_status *s)
 {
-	const char *branch_color = color(WT_STATUS_HEADER, s);
+	const char *status_color = color(WT_STATUS_HEADER, s);
 
 	if (s->branch) {
 		const char *on_what = "On branch ";
@@ -638,11 +638,12 @@ void wt_status_print(struct wt_status *s)
 			branch_name += 11;
 		else if (!strcmp(branch_name, "HEAD")) {
 			branch_name = "";
-			branch_color = color(WT_STATUS_NOBRANCH, s);
+			status_color = color(WT_STATUS_NOBRANCH, s);
 			on_what = "Not currently on any branch.";
 		}
 		color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "# ");
-		color_fprintf_ln(s->fp, branch_color, "%s%s", on_what, branch_name);
+		color_fprintf(s->fp, status_color, "%s", on_what);
+		color_fprintf_ln(s->fp, color(WT_STATUS_LOCAL_BRANCH, s), "%s", branch_name);
 		if (!s->is_initial)
 			wt_status_print_tracking(s);
 	}
-- 
1.7.1

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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]