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

Re: Bad git log behavior with multiple glob path arguments

From
JNJeremy Nickurak <jeremy@nickurak.ca>
Date
Mar 5, 2014, 16:21 UTC
Message-ID
<CA+eQo_2Gcipe7VA7WMY+etULjmSC=TqGmpZmGSGeWv03c93FDA@mail.gmail.com>
In-Reply-To
<CACsJy8A28x5m1SLV-R=QrFniPXUbV+x9N27GA-j+Ut_oe_6oGQ@mail.gmail.com>
On Wed, Mar 5, 2014 at 3:01 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 9 quoted lines
> On Wed, Mar 5, 2014 at 12:56 PM, Jeremy Nickurak <jeremy@nickurak.ca> wrote:
>> git log seems to understand globs in the last path argument, and the
>> last path argument only. I didn't see anything in the git log man page
>> expressly saying this was to be expected, but it does seem like it
>> ought to work for all the arguments or none of them.
>
> What version did you use? We have a fix in the same area,
> e4ddb05 (tree_entry_interesting: match against all pathspecs -
> 2014-01-25), and it's in v1.8.5.5 and v1.9.0
So close! :) 1.8.5.3
>> Note that glob matching doesn't seem to occur unless '--' is included.
>
> do you mean "git log" does not run at all and complains about
> disambiguation, or it runs but nothing is filtered?
It complains about disambiguation:

$ mkdir -p ~/tmp; cd ~/tmp; git init; echo hello > hello.txt; git add hello.txt; git commit -m hello; echo "Without --:"; git log --oneline '*.txt'; echo "With --:"; git log --oneline -- '*.txt'; Reinitialized existing Git repository in /home/nickuj/tmp/.git/ On branch master nothing to commit, working directory clean Without --: fatal: ambiguous argument '*.txt': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' With --: 78ff378 hello

Previous: Duy Nguyen
Message 3 of 3 in “Bad git log behavior with multiple glob path arguments”
  1. Jeremy NickurakMar 5, 2014
  2. Duy NguyenMar 5, 2014
  3. Jeremy NickurakMar 5, 2014

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.