Skip to content
Commits on Sep 12, 2013
  1. @gitster

    mailmap: work around implementations with pure inline strcasecmp

    gitster committed
    On some systems (e.g. MinGW 4.0), string.h has only inline
    definition of strcasecmp and no non-inline implementation is
    supplied anywhere, which is, eh, "unusual".  We cannot take an
    address of such a function to store it in namemap.cmp.
    
    Work it around by introducing our own level of indirection.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Sep 11, 2013
  1. @gitster

    Merge branch 'sb/mailmap-freeing-NULL-is-ok'

    gitster committed
    * sb/mailmap-freeing-NULL-is-ok:
      mailmap: remove redundant check for freeing memory
Commits on Sep 9, 2013
  1. @gitster

    Merge branch 'jk/mailmap-incomplete-line'

    gitster committed
    * jk/mailmap-incomplete-line:
      mailmap: handle mailmap blobs without trailing newlines
Commits on Jul 15, 2013
  1. @gitster

    mailmap: style fixes

    gitster committed
    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>
  2. @gitster

    mailmap: do not downcase mailmap entries

    gitster committed
    The email addresses in the records read from the .mailmap file are
    downcased very early, and then used to match against e-mail
    addresses in the input.  Because we do use case insensitive version
    of string list to manage these entries, there is no need to do this,
    and worse yet, downcasing the rewritten/canonical e-mail read from
    the .mailmap file loses information.
    
    Stop doing that, and also make the string list used to keep multiple
    names for an mailmap entry case insensitive (the code that uses the
    list, lookup_prefix(), expects a case insensitive match).
    
    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>
  3. @gitster

    mailmap: do not lose single-letter names

    gitster committed
    In parse_name_and_email() function, there is this line:
    
    	*name = (nstart < nend ? nstart : NULL);
    
    When the function is given a buffer "A <A@example.org> <old@x.z>",
    nstart scans from the beginning of the buffer, skipping whitespaces
    (there isn't any, so nstart points at the buffer), while nend starts
    from one byte before the first '<' and skips whitespaces backwards
    and stops at the first non-whitespace (i.e. it hits "A" at the
    beginning of the buffer).  nstart == nend in this case for a
    single-letter name, and an off-by-one error makes it fail to pick up
    the name, which makes the entry equivalent to
    
    	<A@example.org> <old@x.z>
    
    without the name.
    
    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>
Commits on Jan 21, 2013
  1. @gitster

    Merge branch 'ap/log-mailmap'

    gitster committed
    Teach commands in the "log" family to optionally pay attention to
    the mailmap.
    
    * ap/log-mailmap:
      log --use-mailmap: optimize for cases without --author/--committer search
      log: add log.mailmap configuration option
      log: grep author/committer using mailmap
      test: add test for --use-mailmap option
      log: add --use-mailmap option
      pretty: use mailmap to display username and email
      mailmap: add mailmap structure to rev_info and pp
      mailmap: simplify map_user() interface
      mailmap: remove email copy and length limitation
      Use split_ident_line to parse author and committer
      string-list: allow case-insensitive string list
Commits on Jan 10, 2013
  1. @gitster

    mailmap: remove email copy and length limitation

    gitster committed
    In map_user(), we have email pointer that points at the beginning of
    an e-mail address, but the buffer is not terminated with a NUL after
    the e-mail address.  It typically has ">" after the address, and it
    could have even more if it comes from author/committer line in a
    commit object.  Or it may not have ">" after it.
    
    We used to copy the e-mail address proper into a temporary buffer
    before asking the string-list API to find the e-mail address in the
    mailmap, because string_list_lookup() function only takes a NUL
    terminated full string.
    
    Introduce a helper function lookup_prefix that takes the email
    pointer and the length, and finds a matching entry in the string
    list used for the mailmap, by doing the following:
    
     - First ask string_list_find_insert_index() where in its sorted
       list the e-mail address we have (including the possible trailing
       junk ">...") would be inserted.
    
     - It could find an exact match (e.g. we had a clean e-mail address
       without any trailing junk).  We can return the item in that case.
    
     - Or it could return the index of an item that sorts after the
       e-mail address we have.
    
     - If we did not find an exact match against a clean e-mail address,
       then the record we are looking for in the mailmap has to exist
       before the index returned by the function (i.e. "email>junk"
       always sorts later than "email").  Iterate, starting from that
       index, down the map->items[] array until we find the exact record
       we are looking for, or we see a record with a key that definitely
       sorts earlier than the e-mail we are looking for (i.e. when we
       are looking for "email" in "email>junk", a record in the mailmap
       that begins with "emaik" strictly sorts before "email", if such a
       key existed in the mailmap).
    
    This, together with the earlier enhancement to support
    case-insensitive sorting, allow us to remove an extra copy of email
    buffer to downcase it.
    
    A part of this is based on Antoine Pelisse's previous work.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 6, 2012
  1. @gitster

    mailmap: always return a plain mail address from map_user()

    gitster committed
    The callers of map_user() give email and name to it, and expect to get the
    up-to-date email and/or name to be used in their output. The function
    rewrites the given buffers in place. To optimize the majority of cases,
    the function returns 0 when it did not do anything, and it returns 1 when
    the caller should use the updated contents.
    
    The 'email' input to the function is terminated by '>' or a NUL (whichever
    comes first) for historical reasons, but when a rewrite happens, the value
    is replaced with the mailbox inside the <> pair.  However, it failed to
    meet this expectation when it only rewrote the name part without rewriting
    the email part, and the email in the input was terminated by '>'.
    
    This causes an extra '>' to appear in the output of "blame -e", because the
    caller does send in '>'-terminated email, and when the function returned 1
    to tell it that rewriting happened, it appends '>' that is necessary when
    the email part was rewritten.
    
    The patch looks bigger than it actually is, because this change makes a
    variable that points at the end of the email part in the input 'p' live
    much longer than it used to, deserving a more descriptive name.
    
    Noticed and diagnosed by Felipe Contreras and Jeff King.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Dec 14, 2011
  1. @gitster

    Merge branch 'ml/mailmap' into maint-1.7.6

    gitster committed
    * ml/mailmap:
      mailmap: xcalloc mailmap_info
    
    Conflicts:
    	mailmap.c
Commits on Jan 12, 2010
  1. @gitster

    mailmap.c: remove unused function

    gitster committed
    map_email() is not used anywhere.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Apr 2, 2009
  1. @gitster

    Merge branch 'maint'

    gitster committed
    * maint:
      Documentation: Remove an odd "instead"
      fix portability problem with IS_RUN_COMMAND_ERR
      mailmap: resurrect lower-casing of email addresses
Commits on Dec 8, 2007
  1. @gitster

    mailmap: fix bogus for() loop that happened to be safe by accident

    gitster committed
    The empty loop pretended to have an empty statement as its body by a
    phony indentation, but in fact was slurping the next statement into it.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 7, 2007
  1. @gitster

    War on whitespace

    gitster committed
    This uses "git-apply --whitespace=strip" to fix whitespace errors that have
    crept in to our source files over time.  There are a few files that need
    to have trailing whitespaces (most notably, test vectors).  The results
    still passes the test, and build result in Documentation/ area is unchanged.
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.