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

Re: multiple source file extensions

From
Jeff King <peff@peff.net>
Date
May 2, 2015, 02:33 UTC
Message-ID
<20150502023320.GB587@peff.net>
In-Reply-To
<20150502020431.GA15775@lanh>
On Sat, May 02, 2015 at 09:04:32AM +0700, Duy Nguyen wrote:
Show 14 quoted lines
> Subject: [PATCH] Avoid the need of "--" when wildcard pathspec is used
> [..]
> This patch modifies the rules a bit by considering any valid (*)
> wildcard pathspec "exist in worktree". The rules become:
> 
>  (1) if an arg is a rev, then it must either exist in worktree or not
>      be a valid wildcard pathspec.
> 
>  (2) else, it either exists in worktree or is a wildcard pathspec
> 
>  (3) else, "--" is required.
> 
> With the new rules, "--" is not needed most of the time when wildcard
> pathspec is involved.

I like it. Since this is a DWIM code path anyway, I don't think it should be a problem in practice (i.e., if you are trying to do something crazy like match a literal path that has a '*' in it, you really should be using "--" in the first place).

-Peff
Previous: Junio C HamanoNext: Thiago Farina
Message 9 of 13 in “multiple source file extensions”
  1. Thiago FarinaMay 2, 2015
  2. Josh HaginsMay 2, 2015
  3. Jeff KingMay 2, 2015
  4. Duy NguyenMay 2, 2015
  5. Duy NguyenMay 2, 2015
  6. Jeff KingMay 2, 2015
  7. Eric SunshineMay 2, 2015
  8. Junio C HamanoMay 3, 2015
  9. Jeff KingMay 2, 2015
  10. Thiago FarinaMay 4, 2015
  11. Jeff KingMay 5, 2015
  12. Mikael MagnussonMay 5, 2015
  13. Jeff KingMay 5, 2015

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.