git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 3/4] Add map_user() and clear_mailmap() to mailmap

From
Marius Storm-Olsen <marius@trolltech.com>
Date
Feb 4, 2009, 08:50 UTC
Message-ID
<498956E9.3050606@trolltech.com>
In-Reply-To
<7v3aeu66hv.fsf@gitster.siamese.dyndns.org>
Junio C Hamano said the following on 04.02.2009 07:50:
> Marius Storm-Olsen <marius@trolltech.com> writes:
> Use of ample paragraph breaks would make it much easier to eyes.
Ok.
Show 5 quoted lines
> Also, the example shows how lines would look line in a mailmap
> file.  I would avoid giving a false impression that the parser
> should take C++ style comment introducer // by using '#' which is a
> documented one (I suspect anything that follows the last angle
> bracket is simply ignored, though).
Right, it is, but I agree with your point.
Show 5 quoted lines
>> @@ -86,6 +95,27 @@ Jane Doe <jane@desktop.(none)>
>>  Joe R. Developer <joe@random.com>
> 
> This context line was updated a few days ago (not a big deal, just in case
> you didn't know).

Right, I saw the patch on the list, but I based the patch series on master, which I don't think had the update at the time? Anyways, do you prefer the patches based on next instead? (Documentation/SubmittingPatches says master, but maybe that has changed)

Show 7 quoted lines
>> +#if DEBUG_MAILMAP
>> +#define debug_mm(...) fprintf(stderr, __VA_ARGS__)
>> +#else
>> +inline void debug_mm(const char *format, ...) {}
>> +#endif
> 
> "static inline void ...";

Sure. (I seriously hope that the compiler optimizes that empty function call away for me though, without specifying inline :-)

Show 12 quoted lines
>> @@ -37,25 +117,65 @@ static int read_single_mailmap(struct string_list *map, const char *filename, ch
>> ...
>> +		/* Locate 2nd name and email. Possible mappings in mailmap file are:
>> +		 *   proper_name <commit_email>
>> +		 *   proper_name <proper_email> <commit_email>
>> +		 *   proper_name <proper_email> commit_name <commit_email>
>> +		 */
> 
> 	/*
>          * We tend to write a multi line comment block
>          * like this.
>          */
Ok.
>> +		do {
...
>> +			if ((left_bracket2 = strchr(right_bracket1, '<')) == NULL)
>> +				continue;
...
Show 7 quoted lines
>> +		} while(0);
> 
> Yuck.  Is it just me or is this new codeblock especially denser
> than existing code?  I wonder use of a few smaller helper functions
> (that the compiler may be able to inline without being told for us)
> would make this easier to read without funny-looking "do { ... if
> (...) continue; } while (0)" trick?

Heh, It was mostly a copy'n'paste from the previous code block, with minor tweaks and variable renaming. I'll factor things out to make it an easier read.

> Two "char *tmp" in this scope are both decl-after-statement errors.

Yikes! I wonder why I never got any compiler notification about those. They should never have been there, sorry.

-- 
.marius [@trolltech.com]
'if you know what you're doing, it's not research'
Previous: Junio C HamanoNext: Nanako Shiraishi
Message 7 of 9 in “Extend mailmap functionality”
  1. 0/4 Extend mailmap functionalityMarius Storm-Olsen, Feb 2, 2009
  2. 1/4 Add log.mailmap as configurational option for mailmap locationMarius Storm-Olsen, Feb 2, 2009
  3. 2/4 Add find_insert_index, insert_at_index and clear_func functions to string_listMarius Storm-Olsen, Feb 2, 2009
  4. 3/4 Add map_user() and clear_mailmap() to mailmapMarius Storm-Olsen, Feb 2, 2009
  5. 4/4 Change current mailmap usage to do matching on both name and email of author/committer.Marius Storm-Olsen, Feb 2, 2009
  6. Junio C HamanoFeb 4, 2009
  7. Marius Storm-OlsenFeb 4, 2009
  8. Nanako ShiraishiFeb 4, 2009
  9. Marius Storm-OlsenFeb 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.