git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: prouleau72@gmail.com
To: git@vger.kernel.org
Cc: Patryck Rouleau <PRouleau72@gmail.com>
Subject: [PATCH] Colorize the branch's name in the status' output
Date: Wed, 25 Aug 2010 20:09:09 -0400	[thread overview]
Message-ID: <1282781349-1899-1-git-send-email-prouleau72@gmail.com> (raw)

From: Patryck Rouleau <PRouleau72@gmail.com>

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

                 reply	other threads:[~2010-08-26  0:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282781349-1899-1-git-send-email-prouleau72@gmail.com \
    --to=prouleau72@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).