Skip to content

New get_pathspec()

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Rename functions in preparation for get_pathspec() restructurearchive.c builtin/add.c builtin/checkout.c +19 more+41 -410 replies
2/5Replace has_wildcard with PATHSPEC_NOGLOBcache.h dir.c setup.c +1 more+39 -362 replies
3/5Convert prefix_pathspec() to produce struct pathspec_itemcache.h setup.c+19 -80 replies
4/5Implement new get_pathspec()cache.h dir.c+56 -190 replies
5/5grep: convert to use the new get_pathspec()builtin/grep.c+1 -92 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] New get_pathspec()

This is on top of jc/magic-pathspec. It implements new get_pathspec(). Remaining work includes

- implement verify_pathspec() (see notes on 5/5)

- make use of pathspec_item.plain_len introduced in 3/5

- convert the rest to use new get_pathspec(). Can we make it a GSoC project?

- get rid of old pathspec code.

- implement a whole lot more of pathspec magic.

I think that's it. We also need to think if we can use similar syntax for gitattr/gitignore, reuse as much code as possible.

[PATCH 1/5] Rename functions in preparation for get_pathspec() restructure

I figure I cannot bring all commands to the new get_pathspec() at once and remove the old one. So instead I rename the old one so that we can have both implementations running in parallel.

[PATCH 2/5] Replace has_wildcard with PATHSPEC_NOGLOB

This effectively kills Junio's use_wildcard rename patch.

[PATCH 3/5] Convert prefix_pathspec() to produce struct pathspec_item

Also put plain_len field in place for literal matching on prefix. Nobody uses it yet though.

[PATCH 4/5] Implement new get_pathspec()

I don't move prefix_pathspec() to dir.c yet. It may need some updates until things are stablized. It will be moved at latest when get_pathspec_old() is retired.

[PATCH 5/5] grep: convert to use the new get_pathspec()

The first user of the new get_pathspec(), just to make sure I don't introduce too many bugs.
The verify_filename() issue remains. I suggest we keep an incarnation of it to catch simple pathspecs, then implement verify_pathspec() for wildcard pathspecs.

 archive.c              |    2 +-
 builtin/add.c          |    6 ++--
 builtin/checkout.c     |    8 ++--
 builtin/clean.c        |    4 +-
 builtin/commit.c       |    6 ++--
 builtin/grep.c         |   14 ++------
 builtin/ls-files.c     |    8 ++--
 builtin/ls-tree.c      |    2 +-
 builtin/mv.c           |    2 +-
 builtin/rerere.c       |    2 +-
 builtin/reset.c        |    4 +-
 builtin/rm.c           |    4 +-
 builtin/update-index.c |    2 +-
 cache.h                |   26 +++++++++++++--
 dir.c                  |   81 +++++++++++++++++++++++++++++++++++------------
 dir.h                  |    4 +-
 read-cache.c           |    4 +-
 rerere.c               |    2 +-
 resolve-undo.c         |    2 +-
 revision.c             |    2 +-
 setup.c                |   45 +++++++++++---------------
 tree-walk.c            |   25 +++++++--------
 wt-status.c            |    4 +-
 23 files changed, 151 insertions(+), 108 deletions(-)
Signature · 1 line
1.7.4.74.g639db