mailmap: style fixes
Wrap overlong lines and format the multi-line comments to match our coding style. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jul 15, 2013 at 02:54 UTC
bd23794552a9d344ddda9fac20d7ee9b7607f6b1
1 file changed
+27
-15
mailmap.c
+27
-15
@@ -31,7 +31,8 @@ struct mailmap_entry {
31
static void free_mailmap_info(void *p, const char *s)
32
{
33
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));
36
free(mi->name);
37
free(mi->email);
38
}
@@ -39,8 +40,10 @@ static void free_mailmap_info(void *p, const char *s)
40
static void free_mailmap_entry(void *p, const char *s)
41
{
42
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));
47
48
free(me->name);
49
free(me->email);
@@ -50,7 +53,8 @@ static void free_mailmap_entry(void *p, const char *s)
53
}
54
55
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)
58
{
59
struct mailmap_entry *me;
60
int index;
@@ -76,7 +80,8 @@ static void add_mapping(struct string_list *map,
80
}
81
82
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);
85
/* Replace current name and new email for simple entry */
86
if (new_name) {
87
free(me->name);
@@ -88,7 +93,8 @@ static void add_mapping(struct string_list *map,
93
}
94
} else {
95
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);
98
if (new_name)
99
mi->name = xstrdup(new_name);
100
if (new_email)
@@ -97,11 +103,12 @@ static void add_mapping(struct string_list *map,
103
}
104
105
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));
108
}
109
110
static char *parse_name_and_email(char *buffer, char **name,
104
- char **email, int allow_empty_email)
111
+ char **email, int allow_empty_email)
112
{
113
char *left, *right, *nstart, *nend;
114
*name = *email = NULL;
@@ -305,21 +312,25 @@ static struct string_list_item *lookup_prefix(struct string_list *map,
312
}
313
314
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)
317
{
318
struct string_list_item *item;
319
struct mailmap_entry *me;
320
321
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));
324
325
item = lookup_prefix(map, *email, *emaillen);
326
if (item != NULL) {
327
me = (struct mailmap_entry *)item->util;
328
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
+ */
334
struct string_list_item *subitem;
335
subitem = lookup_prefix(&me->namemap, *name, *namelen);
336
if (subitem)
@@ -340,8 +351,9 @@ int map_user(struct string_list *map,
351
*name = mi->name;
352
*namelen = strlen(*name);
353
}
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));
357
return 1;
358
}
359
debug_mm("map_user: --\n");