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

Retrieving logs matching pattern for all time.

From
JNJeremy Nickurak <vger-lists@trk.nickurak.ca>
Date
Sep 3, 2011, 00:03 UTC
Message-ID
<CA+eQo_0gZpbz399GN1b+0mq8OY3Xoo+kij=UGSjwbJcNreYBvw@mail.gmail.com>

I have a glob pattern of files, and I'd like to get git logs for every commit that touched those files. 'git log filesmatchingglob*' is pretty close.

Unfortunately, because the * is interpreted by bash, it doesn't catch logs for files that don't exist anymore.

Protecting the * from bash was my next thought, but that doesn't seem to help:
Show 12 quoted lines
> user@host:~$ mkdir something
> user@host:~$ cd something
> user@host:~/something$ git init
> Initialized empty Git repository in /home/nickuj/something/.git/
> user@host:~/something$ echo hello > hello.txt
> user@host:~/something$ git add hello.txt
> user@host:~/something$ git commit -m hello hello.txt
> [master (root-commit) ca4b223] hello
>  1 files changed, 1 insertions(+), 0 deletions(-)
>  create mode 100644 hello.txt
> user@host:~/something$ git log -- 'hel*'
> user@host:~/something$
IE, git doesn't seem to interpret globs itself in patterns.

http://stackoverflow.com/questions/543346/git-list-all-the-files-that-ever-existed suggests a means to get a list of all files that ever existed, and I could certainly iterate across that, find the files that match the pattern, and then run git-log against that.... but it seems like a problem somebody's already solved more elegantly.

Any thoughts?
-- 
Jeremy Nickurak
Next: Thomas Rast
Message 1 of 3 in “Retrieving logs matching pattern for all time.”
  1. Jeremy NickurakSep 3, 2011
  2. Thomas RastSep 4, 2011
  3. Junio C HamanoSep 4, 2011

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.