Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a status-only Git repository?

Tags:

git

The documentation for the git update-index command has this to say about the --info-only switch :

--info-only is used to register files without placing them in the object database. This is useful for status-only repositories.

Since Git is a content-tracking system as opposed to a file-tracking system, I'm curious about scenarios in which you'd want to do that; that is, register files with the index without actually placing them (and presumably their contents) in the object database.

I've also googled around for the term "status-only repository" without success. Could someone clarify what such a repository is and what it's good for?

like image 313
ardila Avatar asked Jun 19 '16 17:06

ardila


1 Answers

The change that added that feature was part of a series of patches by Bryan Larsen to “support working without the object database”. This is what he explained it with:

Sometimes you may wish to keep an audit trail of what changed, where, and by whom. You do not need to know the exact details of the change, and the files are so large that keeping an extra copy of the data in the object database cache is prohibitively expensive.

Git is (almost) ideally suited for this. There's very little out there that is faster than git-diff-cache.

The design of git also facilitates this. git-update-cache --cacheinfo allows the index to be updated without an object in the database, and operations can then be performed around the index. However, there are some things that are inconvenient and one show stopper.

There wasn’t actually any discussion going on about the why on that thread, and I could find another one covering the topic. So it might have been an idea Bryan played around with and wanted to have for himself.

I’m personally not aware of anything that actually uses this for something, so this might be a theoretical use case after all. On the other hand, the idea is pretty simple and could actually be used for something.

like image 186
poke Avatar answered Oct 04 '22 05:10

poke