Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

What is objects/17 git directory?

Alexey_Efimov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2016

Hello,

Can anyone explain that purpose of objects/17 directory inside .git directory?

Thanks!

1 answer

1 accepted

1 vote
Answer accepted
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2016

Each 'git commit'

  • creates a unique commit Id (160-bit SHA-1 hash - calculated from the contents of the commit)
  • stores its data within the folder .git/objects within subfolders

==> The subfolders are created from the first two characters of your current commit-ID. The files within the subfolders are named from the rest of your commit-ID

This splitting is probably done to avoid thousands of files within a single folder.

---------------------

Example:

Your commitID is 17556a21ebc68ce39bb53f26af9a590eb76d8c46

-> corresponding data is stored within .git/objects/17/556a21ebc68ce39bb53f26af9a590eb76d8c46

 

 

 

Alexey_Efimov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2016

Bitbucket server code (GC scheduler) used exactly objects/17 dir. This is some of special directory i guess, but i can't find any docs about this directory.

And, yes, i know that is two first symbols from commit hash. My question is little bit another smile

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 15, 2016

Bitbucket Server checks how many loose objects there are in the 17 directory to decide whether a gc needs to be run. The assumption is that loose objects should be reasonably evenly distributed across the different object directories, so the count in 17 is a reasonable indicator. There's nothing special about 17 though..

Alexey_Efimov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2016

smile

If directory does not exists will GC never executed?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events