path: root/graph.c
diff options
authorJeff King <>2020-07-28 20:24:53 (GMT)
committerJunio C Hamano <>2020-07-28 22:02:18 (GMT)
commitef8d7ac42a6a62d678166fe25ea743315809d2bb (patch)
tree41974632658fdc804d42d3c98859bd8f259828c8 /graph.c
parent22f9b7f3f59549735a480042a4b9ce292eedfae0 (diff)
strvec: convert more callers away from argv_array name
We eventually want to drop the argv_array name and just use strvec consistently. There's no particular reason we have to do it all at once, or care about interactions between converted and unconverted bits. Because of our preprocessor compat layer, the names are interchangeable to the compiler (so even a definition and declaration using different names is OK). This patch converts remaining files from the first half of the alphabet, to keep the diff to a manageable size. The conversion was done purely mechanically with: git ls-files '*.c' '*.h' | xargs perl -i -pe ' s/ARGV_ARRAY/STRVEC/g; s/argv_array/strvec/g; ' and then selectively staging files with "git add '[abcdefghjkl]*'". We'll deal with any indentation/style fallouts separately. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'graph.c')
1 files changed, 5 insertions, 5 deletions
diff --git a/graph.c b/graph.c
index 96af8f6..09c9cc9 100644
--- a/graph.c
+++ b/graph.c
@@ -82,7 +82,7 @@ static void graph_show_line_prefix(const struct diff_options *diffopt)
static const char **column_colors;
static unsigned short column_colors_max;
-static void parse_graph_colors_config(struct argv_array *colors, const char *string)
+static void parse_graph_colors_config(struct strvec *colors, const char *string)
const char *end, *start;
@@ -93,13 +93,13 @@ static void parse_graph_colors_config(struct argv_array *colors, const char *str
char color[COLOR_MAXLEN];
if (!color_parse_mem(start, comma - start, color))
- argv_array_push(colors, color);
+ strvec_push(colors, color);
warning(_("ignore invalid color '%.*s' in log.graphColors"),
(int)(comma - start), start);
start = comma + 1;
- argv_array_push(colors, GIT_COLOR_RESET);
+ strvec_push(colors, GIT_COLOR_RESET);
void graph_set_column_colors(const char **colors, unsigned short colors_max)
@@ -350,8 +350,8 @@ struct git_graph *graph_init(struct rev_info *opt)
} else {
- static struct argv_array custom_colors = ARGV_ARRAY_INIT;
- argv_array_clear(&custom_colors);
+ static struct strvec custom_colors = STRVEC_INIT;
+ strvec_clear(&custom_colors);
parse_graph_colors_config(&custom_colors, string);
/* graph_set_column_colors takes a max-index, not a count */