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

Possible improvement in DB structure

From
ABArnaud Bertrand <xda@abalgo.com>
Date
Dec 23, 2019, 13:00 UTC
Message-ID
<CAEW0o+gwbNyDqmiouFzO16LsRUfcAnSwj9K77oGe5hi=EVMB=w@mail.gmail.com>
Hello,
According to my understanding, git has only 3 kinds of objects:
(excluding the packed version)
- the blobs
- the trees
- the commits

Today to parse all objects of the same type, it is necessary to parse all the objects and test them one by one.

It should be so simple to organize objects in .git/objects/blobs .git/objects/trees .git/object/commits

May be due to my limited knowledge of git, I don't see any advantage to put everything together. By splitting the objects directory, the gain in performance could be important, the scripts simplified, the representation more clear.

To be backward compatible, we can imagine a get-object() function that parses .git/objects/blobs .git/objects/trees .git/object/commits and, when not found .git/objects

A get-tree() function that first parses git/objects/trees and when not found .git/objects

idem for getblob() and getcommit()

Is there a reason that I don't understand behind the decision to put everything together ?

Best regards,
Arnaud Bertrand
Next: brian m. carlson
Message 1 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.