threads / discuss / 2281

git objects directory

Subject: git objects directory

## tl;dr

3 messages between Oct 31, 2005 and Oct 31, 2005.

replies: 2people: 3as markdown or json

Lexington Luthor· Oct 31, 2005, 15:33 UTC · lore
Hi,

Can someone please explain why git puts its objects in 256 sub-directories of objects instead of directly in the objects directory itself? I am trying to learn git (actually cogito), but I still don't understand why this structure is used.

What is the point of having the first byte of the hash as the directory name?

-- LL
Nikolai Weibull· Oct 31, 2005, 16:08 UTC · re: Lexington Luthor · lore

Re: git objects directory

Lexington Luthor wrote:
> Can someone please explain why git puts its objects in 256 
> sub-directories of objects instead of directly in the objects directory 
> itself? I am trying to learn git (actually cogito), but I still don't 
> understand  why this structure is used.

Because otherwise there would be a lot of objects (files) in the objects subdirectory, which would cause a lot of problems with many filesystems.

Anyway, you best leave that directory be, but I understand your desire to understand :-).

        nikolai
-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
Johannes Schindelin· Oct 31, 2005, 16:08 UTC · re: Lexington Luthor · lore

Re: git objects directory

Hi,
On Mon, 31 Oct 2005, Lexington Luthor wrote:
> Can someone please explain why git puts its objects in 256 
> sub-directories of objects instead of directly in the objects directory 
> itself?

Some filesystems have problems with huge directories. And originally the plan was to have all objects as files (now the older ones live in packs).

Hth, Dscho

← back to recent threads