Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit bd23794

Browse files
committed
mailmap: style fixes
Wrap overlong lines and format the multi-line comments to match our coding style. Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fbfba7a commit bd23794

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

mailmap.c

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,19 @@ struct mailmap_entry {
3131
static void free_mailmap_info(void *p, const char *s)
3232
{
3333
struct mailmap_info *mi = (struct mailmap_info *)p;
34-
debug_mm("mailmap: -- complex: '%s' -> '%s' <%s>\n", s, debug_str(mi->name), debug_str(mi->email));
34+
debug_mm("mailmap: -- complex: '%s' -> '%s' <%s>\n",
35+
s, debug_str(mi->name), debug_str(mi->email));
3536
free(mi->name);
3637
free(mi->email);
3738
}
3839

3940
static void free_mailmap_entry(void *p, const char *s)
4041
{
4142
struct mailmap_entry *me = (struct mailmap_entry *)p;
42-
debug_mm("mailmap: removing entries for <%s>, with %d sub-entries\n", s, me->namemap.nr);
43-
debug_mm("mailmap: - simple: '%s' <%s>\n", debug_str(me->name), debug_str(me->email));
43+
debug_mm("mailmap: removing entries for <%s>, with %d sub-entries\n",
44+
s, me->namemap.nr);
45+
debug_mm("mailmap: - simple: '%s' <%s>\n",
46+
debug_str(me->name), debug_str(me->email));
4447

4548
free(me->name);
4649
free(me->email);
@@ -50,7 +53,8 @@ static void free_mailmap_entry(void *p, const char *s)
5053
}
5154

5255
static void add_mapping(struct string_list *map,
53-
char *new_name, char *new_email, char *old_name, char *old_email)
56+
char *new_name, char *new_email,
57+
char *old_name, char *old_email)
5458
{
5559
struct mailmap_entry *me;
5660
int index;
@@ -76,7 +80,8 @@ static void add_mapping(struct string_list *map,
7680
}
7781

7882
if (old_name == NULL) {
79-
debug_mm("mailmap: adding (simple) entry for %s at index %d\n", old_email, index);
83+
debug_mm("mailmap: adding (simple) entry for %s at index %d\n",
84+
old_email, index);
8085
/* Replace current name and new email for simple entry */
8186
if (new_name) {
8287
free(me->name);
@@ -88,7 +93,8 @@ static void add_mapping(struct string_list *map,
8893
}
8994
} else {
9095
struct mailmap_info *mi = xcalloc(1, sizeof(struct mailmap_info));
91-
debug_mm("mailmap: adding (complex) entry for %s at index %d\n", old_email, index);
96+
debug_mm("mailmap: adding (complex) entry for %s at index %d\n",
97+
old_email, index);
9298
if (new_name)
9399
mi->name = xstrdup(new_name);
94100
if (new_email)
@@ -97,11 +103,12 @@ static void add_mapping(struct string_list *map,
97103
}
98104

99105
debug_mm("mailmap: '%s' <%s> -> '%s' <%s>\n",
100-
debug_str(old_name), old_email, debug_str(new_name), debug_str(new_email));
106+
debug_str(old_name), old_email,
107+
debug_str(new_name), debug_str(new_email));
101108
}
102109

103110
static char *parse_name_and_email(char *buffer, char **name,
104-
char **email, int allow_empty_email)
111+
char **email, int allow_empty_email)
105112
{
106113
char *left, *right, *nstart, *nend;
107114
*name = *email = NULL;
@@ -305,21 +312,25 @@ static struct string_list_item *lookup_prefix(struct string_list *map,
305312
}
306313

307314
int map_user(struct string_list *map,
308-
const char **email, size_t *emaillen,
309-
const char **name, size_t *namelen)
315+
const char **email, size_t *emaillen,
316+
const char **name, size_t *namelen)
310317
{
311318
struct string_list_item *item;
312319
struct mailmap_entry *me;
313320

314321
debug_mm("map_user: map '%.*s' <%.*s>\n",
315-
(int)*namelen, debug_str(*name), (int)*emaillen, debug_str(*email));
322+
(int)*namelen, debug_str(*name),
323+
(int)*emaillen, debug_str(*email));
316324

317325
item = lookup_prefix(map, *email, *emaillen);
318326
if (item != NULL) {
319327
me = (struct mailmap_entry *)item->util;
320328
if (me->namemap.nr) {
321-
/* The item has multiple items, so we'll look up on name too */
322-
/* If the name is not found, we choose the simple entry */
329+
/*
330+
* The item has multiple items, so we'll look up on
331+
* name too. If the name is not found, we choose the
332+
* simple entry.
333+
*/
323334
struct string_list_item *subitem;
324335
subitem = lookup_prefix(&me->namemap, *name, *namelen);
325336
if (subitem)
@@ -340,8 +351,9 @@ int map_user(struct string_list *map,
340351
*name = mi->name;
341352
*namelen = strlen(*name);
342353
}
343-
debug_mm("map_user: to '%.*s' <%.*s>\n", (int)*namelen, debug_str(*name),
344-
(int)*emaillen, debug_str(*email));
354+
debug_mm("map_user: to '%.*s' <%.*s>\n",
355+
(int)*namelen, debug_str(*name),
356+
(int)*emaillen, debug_str(*email));
345357
return 1;
346358
}
347359
debug_mm("map_user: --\n");

0 commit comments

Comments
 (0)