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

Re: [RFC/PATCH] Making ce_path_match() more useful by accepting globs

From
Alex Riesen <raa.lkml@gmail.com>
Date
Nov 26, 2007, 19:56 UTC
Message-ID
<20071126195659.GC3675@steel.home>
In-Reply-To
<7vsl2ujc6x.fsf@gitster.siamese.dyndns.org>
Junio C Hamano, Sun, Nov 25, 2007 21:35:18 +0100:
Show 23 quoted lines
> Currently, these do not work:
> 
>    git diff-files 't/*.sh'
>    git diff-index HEAD 'xdiff/*.c'
>    git update-index -g 'Documentation/howto/*.txt'
> 
> This is because ce_path_match(), the underlying function that is used to
> see if a cache entry matches the set of pathspecs, only understands
> leading directory match.
> 
> This teaches ce_path_match() to use the match_pathspec() used in
> git-ls-files, which knows about glob patterns.
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> 
>  [SORRY FOR A RESEND -- I screwed up the To: field of the previous message]
> 
>  * Having two different behaviours of pathspec matching has been
>    bothering me for quite some time.  The changes here look trivially
>    correct and the result passes all the tests, but this is quite close
>    to the core part of the system, and would benefit greatly from extra
>    set of eyes.

How about doing the same what was done with recursive directory walker (no, I'm not confusing pathname filters with paths)? Always have the glob expansion for porcelain (git-diff, git-log, git-show), and add a command-line option to activate for plumbing?

(Well, the oldtimers as yourself will probably find it hard to separate git-diff-tree from git-diff).

Previous: Junio C Hamano
Message 2 of 2 in “Making ce_path_match() more useful by accepting globs”
  1. Making ce_path_match() more useful by accepting globsJunio C Hamano, Nov 25, 2007
  2. Alex RiesenNov 26, 2007

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.