Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Dec 22, 2014
  1. Junio C Hamano

    Merge branch 'sb/string-list'

    gitster authored
    API simplification.
    
    * sb/string-list:
      string_list: remove string_list_insert_at_index() from its API
      mailmap: use higher level string list functions
      string_list: document string_list_(insert,lookup)
Commits on Dec 4, 2014
  1. stefanbeller Junio C Hamano

    string_list: remove string_list_insert_at_index() from its API

    stefanbeller authored gitster committed
    There no longer is a caller to this function.
    
    Signed-off-by: Stefan Beller <sbeller@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Nov 25, 2014
  1. Michael Haggerty Junio C Hamano

    sort_string_list(): rename to string_list_sort()

    mhagger authored gitster committed
    The new name is more consistent with the names of other
    string_list-related functions.
    
    Suggested-by: Junio C Hamano <gitster@pobox.com>
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. stefanbeller Junio C Hamano

    string_list: document string_list_(insert,lookup)

    stefanbeller authored gitster committed
    Signed-off-by: Stefan Beller <sbeller@google.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 21, 2014
  1. tanayabh Junio C Hamano

    string-list: add string_list initializer helper function

    tanayabh authored gitster committed
    The string-list API has STRING_LIST_INIT_* macros to be used
    to define variables with initializers, but lacks functions
    to initialize an uninitialized piece of memory to be used as
    a string-list at the run-time.
    Introduce `string_list_init()` function for that.
    
    Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
    Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 6, 2014
  1. tanayabh Junio C Hamano

    string-list: spell all values out that are given to a string_list ini…

    tanayabh authored gitster committed
    …tializer
    
    STRING_LIST_INIT_{NODUP,DUP} initializers list values only
    for earlier structure members, relying on the usual
    convention in C that the omitted members are initailized to
    0, i.e. the former is expanded to the latter:
    
    	struct string_list l = STRING_LIST_INIT_DUP;
    	struct string_list l = { NULL, 0, 0, 1 };
    
    and the last member that is not mentioned (i.e. 'cmp') is
    initialized to NULL.
    
    While there is nothing wrong in this construct, spelling out
    all the values where the macros are defined will serve also
    as a documentation, so let's do so.
    
    Signed-off-by: Tanay Abhra <tanayabh@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 21, 2013
  1. Junio C Hamano

    Merge branch 'ap/log-mailmap'

    gitster authored
    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 7, 2013
  1. Junio C Hamano

    string-list: allow case-insensitive string list

    gitster authored
    Some string list needs to be searched case insensitively, and for
    that to work correctly, the string needs to be sorted case
    insensitively from the beginning.
    
    Allow a custom comparison function to be defined on a string list
    instance and use it throughout in place of strcmp().
    
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 2, 2013
  1. Junio C Hamano

    Merge branch 'mh/ceiling'

    gitster authored
    An element on GIT_CEILING_DIRECTORIES list that does not name the
    real path to a directory (i.e. a symbolic link) could have caused
    the GIT_DIR discovery logic to escape the ceiling.
    
    * mh/ceiling:
      string_list_longest_prefix(): remove function
      setup_git_directory_gently_1(): resolve symlinks in ceiling paths
      longest_ancestor_length(): require prefix list entries to be normalized
      longest_ancestor_length(): take a string_list argument for prefixes
      longest_ancestor_length(): use string_list_split()
      Introduce new function real_path_if_valid()
      real_path_internal(): add comment explaining use of cwd
      Introduce new static function real_path_internal()
Commits on Nov 8, 2012
  1. Michael Haggerty Jeff King

    string_list: add a function string_list_remove_empty_items()

    mhagger authored peff committed
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Acked-by: Johan Herland <johan@herland.net>
    Signed-off-by: Jeff King <peff@peff.net>
Commits on Oct 29, 2012
  1. Michael Haggerty Jeff King

    string_list_longest_prefix(): remove function

    mhagger authored peff committed
    This function was added in f103f95 in
    the erroneous expectation that it would be used in the
    reimplementation of longest_ancestor_length().  But it turned out to
    be easier to use a function specialized for comparing path prefixes
    (i.e., one that knows about slashes and root paths) than to prepare
    the paths in such a way that a generic string prefix comparison
    function can be used.  So delete string_list_longest_prefix() and its
    documentation and test cases.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Jeff King <peff@peff.net>
Commits on Sep 12, 2012
  1. Michael Haggerty Junio C Hamano

    string_list: add a function string_list_longest_prefix()

    mhagger authored gitster committed
    Add a function that finds the longest string from a string_list that
    is a prefix of a given string.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Michael Haggerty Junio C Hamano

    string_list: add a new function, string_list_remove_duplicates()

    mhagger authored gitster committed
    Add a function that deletes duplicate entries from a sorted
    string_list.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. Michael Haggerty Junio C Hamano

    string_list: add a new function, filter_string_list()

    mhagger authored gitster committed
    This function allows entries that don't match a specified criterion to
    be discarded from a string_list while preserving the order of the
    remaining entries.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. Michael Haggerty Junio C Hamano

    string_list: add two new functions for splitting strings

    mhagger authored gitster committed
    Add two new functions, string_list_split() and
    string_list_split_in_place().  These split a string into a string_list
    on a separator character.  The first makes copies of the substrings
    (leaving the input string untouched) and the second splits the
    original string in place, overwriting the separator characters with
    NULs and referring to the original string's memory.
    
    These functions are similar to the strbuf_split_*() functions except
    that they work with the more powerful string_list interface.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  5. Michael Haggerty Junio C Hamano

    string_list: add function string_list_append_nodup()

    mhagger authored gitster committed
    Add a new function that appends a string to a string_list without
    copying it.  This can be used to pass ownership of an already-copied
    string to a string_list that has strdup_strings set.
    
    Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Aug 14, 2011
  1. Junio C Hamano

    string-list: Add API to remove an item from an unsorted list

    Johannes Sixt authored gitster committed
    Teach the string-list API how to remove an entry in O(1) runtime by
    moving the last entry to the vacated spot. As such, the routine works
    only for unsorted lists.
    
    Signed-off-by: Johannes Sixt <j6t@kdbg.org>
    Signed-off-by: Elijah Newren <newren@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 16, 2011
  1. jrn Junio C Hamano

    standardize brace placement in struct definitions

    jrn authored gitster committed
    In a struct definitions, unlike functions, the prevailing style is for
    the opening brace to go on the same line as the struct name, like so:
    
     struct foo {
    	int bar;
    	char *baz;
     };
    
    Indeed, grepping for 'struct [a-z_]* {$' yields about 5 times as many
    matches as 'struct [a-z_]*$'.
    
    Linus sayeth:
    
     Heretic people all over the world have claimed that this inconsistency
     is ...  well ...  inconsistent, but all right-thinking people know that
     (a) K&R are _right_ and (b) K&R are right.
    
    Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 5, 2010
  1. Junio C Hamano

    string_list: Add STRING_LIST_INIT macro and make use of it.

    Thiago Farina authored gitster committed
    Acked-by: Jonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: Thiago Farina <tfransosi@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Alex Riesen Junio C Hamano

    Add a for_each_string_list_item macro

    raalkml authored gitster committed
    This is more lightweight than a call to for_each_string_list function with
    callback function and a cookie argument.
    
    Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jun 27, 2010
  1. Julian Phillips Junio C Hamano

    string_list: Fix argument order for string_list_append

    qur authored gitster committed
    Update the definition and callers of string_list_append to use the
    string_list as the first argument.  This helps make the string_list
    API easier to use by being more consistent.
    
    Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  2. Julian Phillips Junio C Hamano

    string_list: Fix argument order for string_list_lookup

    qur authored gitster committed
    Update the definition and callers of string_list_lookup to use the
    string_list as the first argument.  This helps make the string_list
    API easier to use by being more consistent.
    
    Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  3. Julian Phillips Junio C Hamano

    string_list: Fix argument order for string_list_insert_at_index

    qur authored gitster committed
    Update the definition and callers of string_list_insert_at_index to
    use the string_list as the first argument.  This helps make the
    string_list API easier to use by being more consistent.
    
    Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  4. Julian Phillips Junio C Hamano

    string_list: Fix argument order for string_list_insert

    qur authored gitster committed
    Update the definition and callers of string_list_insert to use the
    string_list as the first argument.  This helps make the string_list
    API easier to use by being more consistent.
    
    Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  5. Julian Phillips Junio C Hamano

    string_list: Fix argument order for for_each_string_list

    qur authored gitster committed
    Update the definition and callers of for_each_string_list to use the
    string_list as the first argument.  This helps make the string_list
    API easier to use by being more consistent.
    
    Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
  6. Julian Phillips Junio C Hamano

    string_list: Fix argument order for print_string_list

    qur authored gitster committed
    Update the definition and callers of print_string_list to use the
    string_list as the first argument.  This helps make the API easier to
    use by being more consistent.
    
    Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Mar 25, 2010
  1. Stephen Boyd Junio C Hamano

    string-list: add unsorted_string_list_lookup()

    bebarino authored gitster committed
    Sometimes users need to lookup a string in an unsorted string_list. In
    that case they should use this function instead of the version for
    sorted strings.
    
    Signed-off-by: Stephen Boyd <bebarino@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jan 10, 2010
  1. Junio C Hamano

    string-list: rename the include guard to STRING_LIST_H

    Thiago Farina authored gitster committed
    Signed-off-by: Thiago Farina <tfransosi@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 27, 2009
  1. Jay Soffian Junio C Hamano

    string-list: new for_each_string_list() function

    jaysoffian authored gitster committed
    Add a convenience function for iterating over a string_list's items via
    a callback.
    
    Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Feb 8, 2009
  1. Junio C Hamano

    Add find_insert_index, insert_at_index and clear_func functions to st…

    Marius Storm-Olsen authored gitster committed
    …ring_list
    
    string_list_find_insert_index() and string_list_insert_at_index()
    enables you to see if an item is in the string_list, and to
    insert at the appropriate index in the list, if not there.
    This is usefull if you need to manipulate an existing item,
    if present, and insert a new item if not.
    
    Future mailmap code will use this construct to enable
    complex (old_name, old_email) -> (new_name, new_email)
    lookups.
    
    The string_list_clear_func() allows to call a custom
    cleanup function on each item in a string_list, which is
    useful is the util member points to a complex structure.
    
    Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commits on Jul 22, 2008
  1. dscho Junio C Hamano

    Rename path_list to string_list

    dscho authored gitster committed
    The name path_list was correct for the first usage of that data structure,
    but it really is a general-purpose string list.
    
    $ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list)
    $ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list)
    $ git mv path-list.h string-list.h
    $ git mv path-list.c string-list.c
    $ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path)
    $ perl -i -pe 's/path/string/g' string-list.[ch]
    $ git mv Documentation/technical/api-path-list.txt \
    	Documentation/technical/api-string-list.txt
    $ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths)
    
    ... and then fix all users of string-list to access the member "string"
    instead of "path".
    
    Documentation/technical/api-string-list.txt needed some rewrapping, too.
    
    Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
Something went wrong with that request. Please try again.