From: Arjen Laarhoven <arjen@yaph.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH 2/2] builtin-branch.c: Rename branch category color names
Date: Fri, 13 Feb 2009 22:53:41 +0100 [thread overview]
Message-ID: <1234562021-2397-2-git-send-email-arjen@yaph.org> (raw)
In-Reply-To: <1234562021-2397-1-git-send-email-arjen@yaph.org>
The branch color constants have the form COLOR_BRANCH_$category. Rename
them to BRANCH_COLOR_$category as this conveys their meaning better.
Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
---
builtin-branch.c | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index fe139e1..6d241c8 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -39,11 +39,11 @@ static char branch_colors[][COLOR_MAXLEN] = {
GIT_COLOR_GREEN, /* CURRENT */
};
enum color_branch {
- COLOR_BRANCH_RESET = 0,
- COLOR_BRANCH_PLAIN = 1,
- COLOR_BRANCH_REMOTE = 2,
- COLOR_BRANCH_LOCAL = 3,
- COLOR_BRANCH_CURRENT = 4,
+ BRANCH_COLOR_RESET = 0,
+ BRANCH_COLOR_PLAIN = 1,
+ BRANCH_COLOR_REMOTE = 2,
+ BRANCH_COLOR_LOCAL = 3,
+ BRANCH_COLOR_CURRENT = 4,
};
static enum merge_filter {
@@ -56,15 +56,15 @@ static unsigned char merge_filter_ref[20];
static int parse_branch_color_slot(const char *var, int ofs)
{
if (!strcasecmp(var+ofs, "plain"))
- return COLOR_BRANCH_PLAIN;
+ return BRANCH_COLOR_PLAIN;
if (!strcasecmp(var+ofs, "reset"))
- return COLOR_BRANCH_RESET;
+ return BRANCH_COLOR_RESET;
if (!strcasecmp(var+ofs, "remote"))
- return COLOR_BRANCH_REMOTE;
+ return BRANCH_COLOR_REMOTE;
if (!strcasecmp(var+ofs, "local"))
- return COLOR_BRANCH_LOCAL;
+ return BRANCH_COLOR_LOCAL;
if (!strcasecmp(var+ofs, "current"))
- return COLOR_BRANCH_CURRENT;
+ return BRANCH_COLOR_CURRENT;
die("bad config variable '%s'", var);
}
@@ -303,20 +303,20 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
switch (item->kind) {
case REF_LOCAL_BRANCH:
- color = COLOR_BRANCH_LOCAL;
+ color = BRANCH_COLOR_LOCAL;
break;
case REF_REMOTE_BRANCH:
- color = COLOR_BRANCH_REMOTE;
+ color = BRANCH_COLOR_REMOTE;
break;
default:
- color = COLOR_BRANCH_PLAIN;
+ color = BRANCH_COLOR_PLAIN;
break;
}
c = ' ';
if (current) {
c = '*';
- color = COLOR_BRANCH_CURRENT;
+ color = BRANCH_COLOR_CURRENT;
}
if (verbose) {
@@ -335,14 +335,14 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
printf("%c %s%-*s%s %s %s%s\n", c, branch_get_color(color),
maxwidth, item->name,
- branch_get_color(COLOR_BRANCH_RESET),
+ branch_get_color(BRANCH_COLOR_RESET),
find_unique_abbrev(item->commit->object.sha1, abbrev),
stat.buf, sub);
strbuf_release(&stat);
strbuf_release(&subject);
} else {
printf("%c %s%s%s\n", c, branch_get_color(color), item->name,
- branch_get_color(COLOR_BRANCH_RESET));
+ branch_get_color(BRANCH_COLOR_RESET));
}
}
--
1.6.2.rc0.186.g417c
next prev parent reply other threads:[~2009-02-13 21:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-12 20:37 [PATCH] Clean up use of ANSI color sequences Arjen Laarhoven
2009-02-12 23:03 ` Junio C Hamano
2009-02-13 21:53 ` [PATCH 1/2] " Arjen Laarhoven
2009-02-13 21:53 ` Arjen Laarhoven [this message]
2009-02-14 2:02 ` Junio C Hamano
2009-02-14 7:41 ` Arjen Laarhoven
2009-02-14 7:53 ` Junio C Hamano
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=1234562021-2397-2-git-send-email-arjen@yaph.org \
--to=arjen@yaph.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).