Subject: [PATCH 00/17] pathspec cleanup

From: Brandon Williams <[email-masked]>
Date: Tue, 6 Dec 2016 13:51:29 -0800

The intent of this series is to cleanup some of the pathspec initialization
code as well as finally migrating the remaining users of the _raw field or
get_pathspec() to the pathspec struct interface.  This way both the _raw field
and get_pathspec() can be removed from the codebase.  This also removes the
functionality where parse_pathspec() modified the const char * argv array that
was passed in (which felt kind of odd to me as I wouldn't have expected the
passed in array to be modified).

I also noticed that there are memory leaks associated with the 'original' and
'match' strings.  To fix this the pathspec struct needed to take ownership of
the memory for these fields so that they can be cleaned up when clearing the
pathspec struct.

Most of the work went to simplifying the prefix_pathspec function.  This
consisted of factoring out long sections of code into their own helper
functions.  The overall result is a much more readable function.

Brandon Williams (17):
  mv: convert to using pathspec struct interface
  dir: convert create_simplify to use the pathspec struct interface
  dir: convert fill_directory to use the pathspec struct interface
  ls-tree: convert show_recursive to use the pathspec struct interface
  pathspec: remove the deprecated get_pathspec function
  pathspec: copy and free owned memory
  mv: small code cleanup
  pathspec: remove unused variable from unsupported_magic
  pathspec: always show mnemonic and name in unsupported_magic
  pathspec: simpler logic to prefix original pathspec elements
  pathspec: factor global magic into its own function
  pathspec: create parse_short_magic function
  pathspec: create parse_long_magic function
  pathspec: create parse_element_magic helper
  pathspec: create strip submodule slash helpers
  pathspec: small readability changes
  pathspec: remove outdated comment

 Documentation/technical/api-setup.txt |   2 -
 builtin/ls-tree.c                     |  12 +-
 builtin/mv.c                          |  44 +++-
 cache.h                               |   1 -
 dir.c                                 |  28 +--
 pathspec.c                            | 449 +++++++++++++++++++---------------
 pathspec.h                            |   5 +-
 7 files changed, 301 insertions(+), 240 deletions(-)

-- 
2.8.0.rc3.226.g39d4020