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

Re: Possible improvement in DB structure

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 23, 2019, 21:41 UTC
Message-ID
<20191223214125.GA38316@google.com>
In-Reply-To
<CAEW0o+jRW8LJqfjsDVtUiSNxwM9yBkj0c=Ddy3kEGUdsYM8myQ@mail.gmail.com>
Hi Arnaud,
Arnaud Bertrand wrote:
> Today, I think that tags are not located in objects directory but in
> refs/tags which is a good idea.;-)

Not precisely. See "git help repository-layout" for more details, or https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#hacking-git or the "git internals" chapter of https://git-scm.com/book/.

Show 6 quoted lines
> The origin of my reflection was that I wanted to find an old file.
>
> I knew that in the past of my project, we had started to write a
> driver for a device and it was abandoned. I wanted to find this file.
> I knew a "key line" to search for and I knew the file was a .c file
> but I didn't know the exact name.
Thanks for this context!  It's very helpful.
> So, the goal was to parse all the database, find all the different .c
> files and grep it to find the the driver.

Git intends to make this kind of history mining not too difficult. You can run a command like

	git log --all -S'the key line' -- '*.c'

and it should do the right thing. Or you can do something more complex using something like "git rev-list --all | git diff-tree --stdin --name-only --diff-filter=D" (to show deleted files).

Is the problem that that command is too slow?

Hope that helps, Jonathan

Previous: Arnaud Bertrand
Message 4 of 4 in “Possible improvement in DB structure”
  1. Arnaud BertrandDec 23, 2019
  2. brian m. carlsonDec 23, 2019
  3. Arnaud BertrandDec 23, 2019
  4. Jonathan NiederDec 23, 2019

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.