LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 04-11-2018, 02:05 PM   #1
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Rep: Reputation: 13
CAS Content Addressable Storage


I came across this while reading about GIT. As I understand so far, Git generates a hash for a file and stores the data per that hash. The data is written to a hard drive or maybe a DVD. What controls exactly where that data is written? Does this work within the directory/file structure or is there something different?
Does the hash become the file name?
Edit:
So the contents of the data to be saved is hashed and that value becomes the file name. The essence is that once the file is writ it is never changed. If it were changed, the name would be proof that the contents were changed. A good thing for a version manager.

Last edited by bkelly; 04-11-2018 at 03:33 PM. Reason: put the conclusion here.
 
Old 04-11-2018, 02:09 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
It's stored in a hidden folder at the root of the git repository's directory tree. The hidden folder is named ".git".

Last edited by dugan; 04-11-2018 at 02:16 PM.
 
Old 04-11-2018, 02:41 PM   #3
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
In a Git tutorial, when writing about blobs, it stated:

Quote:
It is a binary file, and in Git database, it is named as SHA1 hash of that file. In Git, files are not addressed by names. Everything is content-addressed.
Ok, I think I follow that. But every file must have a name. If the hash of a file becomes its name, the file still has a name. I don't yet have a Git repository to look at, but, I presume that if I found the right directory there will be a collection of files whose names are the hash functions, meaning the names are fundamentally useless to me if I attempt to use them directly. But obviously Git can access the data with those names. Am I completely off track here?
 
Old 04-11-2018, 02:49 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
http://gitready.com/advanced/2009/03...directory.html

They're in .git/objects.

The hashes are in the filenames.

Last edited by dugan; 04-11-2018 at 02:52 PM.
 
Old 04-11-2018, 03:22 PM   #5
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
I think I follow. It makes reading about Git a bit more comfortable. Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] simple cursor-addressable command? HalfMadDad Linux - Software 2 02-08-2013 10:57 AM
[SOLVED] Difference between addressable memory and maximum ram??? Nitesh Agarwal Programming 1 10-05-2011 03:57 AM
Maximum addressable RAM in distros? henryh3 Linux - Newbie 8 12-01-2008 05:36 PM
LXer: Dynamic Content - Temporary Data Storage LXer Syndicated Linux News 0 09-22-2008 02:10 PM
How to provision Data Storage Capacity for content caching rsean LQ Articles Discussion 0 07-30-2007 02:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 02:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration