Comments (7)
The author has proposed "a commit specifies the entire state of a repository, but is usually stored on disk as a set of changes" as an alternative. Does that sound reasonable?
from learngitbranching.
I'm assuming your the same commentator from HN -- thanks a ton for catching this. I'll paste my reply below:
"Thanks a ton for catching this. I guess there is a distinction to be made -- the compression might use delta's, but a commit specifies the entire state of the repository.
It's a tricky line to walk though, because commands like "git show" and "git patch" clearly show the delta-like nature of a single commit. I also don't want newcomers to think that commits are heavy and should be used sparingly.
I'm totally down to discuss this on a github issue with you, we could go over the wording. Maybe something like "a commit specifies the entire state of a repository, but is usually stored on disk as a set of changes"?"
Does that wording work? Here's a draft:
A commit in git specifies the state of the repository. This state encodes what each file looks like, so you can think of it as a snapshot of everything you're working on.
Git wants to keep commits as lightweight as possible though, so it doesn't just copy the entire directory every time you commit. It actually stores each commit as a set of changes, or a "delta", from one version of the repository to the next.
In order to clone a repository, you have to unpack or "resolve" all these deltas. That's why you might see the command line output:
resolving deltas
when cloning a repo.
It's a tricky concept, but for now you can think of commits as snapshots of the directory that are stored as deltas. Combining all the deltas together inside an empty folder gives you the full repository.
from learngitbranching.
It's not particularly important, but I'm the one from HN. :)
Your expanded draft looks fine (otac0n, if you can see any issues, let us know ), and is readable. I'll let you worry over how much you think needs to be explained up front :).
EDIT: I think the important thing is to get across the idea (which you do in the revision) that a commit is a state of the repo, and git handles the storage of said states (and switching between them) efficiently by mostly just keeping track of changes. However, bear in mind that I'm unsure how much of this has to be done explicitly using 'git gc'.
from learngitbranching.
It's also a lot to digest on (literally) the first intro screen in the entire app. I wish we could do stepping stones but then you have to oversimplify either way
either way I changed the dialog for now, lets see how that goes
from learngitbranching.
Fixed in 168852b
from learngitbranching.
The thing us that it is USUALLY stored as a snapshot, not as a diff. (see
git-hash-object)
When .pack files are involved, it gets more complicated. However, in the
common case, both versions of the files are stored.
On Feb 16, 2013 3:04 PM, "Chris Greene" [email protected] wrote:
The author has proposed "a commit specifies the entire state of a
repository, but is usually stored on disk as a set of changes" as
alternative. Does that sound reasonable?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-13676807.
from learngitbranching.
I followed up with issue #13 which is I hope a clearer, and correct, treatment of the commit data structure.
from learngitbranching.
Related Issues (20)
- Remove branches already concluded (i.e. merged/closed)? HOT 1
- link to a particular lesson HOT 3
- fakeTeamwork command for creating a branch and adding commits is not working! HOT 2
- In git-branch, the name <bugFix> is not allowed
- no support for `git merge A B` HOT 2
- Ban checkout and use "modern" commands switch/restore HOT 3
- Add Turkish (tr_TR) Translations 🇹🇷 HOT 1
- [Bug] Origin IP found HOT 1
- Hi
- Add more clarification on "git branch -f" command HOT 4
- I am a new open source development and I want to create a feature in the Introduction Sequence. Where should I start? HOT 1
- o/main is not synced when doing `git pull origin main:main` HOT 4
- Rebase Introduction is incorrect (git 2.42.0) HOT 4
- level remoteAdvanced3 branch naming not in assignment but required HOT 3
- level 5: teamwork * should not be shown HOT 2
- show solution doesn't work with custom level HOT 3
- minor correction for Korean translation
- Add deep links HOT 2
- Incorrect implementation for git fetch/pull with colon ":" affecting remoteAdvance6 HOT 4
- Add direct link to each level HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learngitbranching.