Live data from Hacker News

Build Git – Learn Git

kushagragour.in

31–40 of 42 posts

Re: Build Git – Learn Git

#32
post #27

Earlier quoted context omitted.

I always thought that was just the name of the parent folder of .git

That's correct, repositories themselves are not named. You can change the name of the parent directory without consequence.

Renaming more things should be this easy.

Re: Build Git – Learn Git

#33
post #8

This reminds me of a talk by Jim Wierich I heard years ago where he pretends to design a new vcs in order to explain how git works. I'm not sure if a full recording can be found anywhere other than buying it from Pragmatic Programmers. https://www.youtube.com/watch?v=bBQJP6D8aGY

The talk is only available as a screencast from the Pragmatic Programmers, but the slides are freely available on my github account (https://github.com/jimweirich/presentation_source_control).

I use this talk as an introduction to any Git Immersion workshops that I run (see also http://gitimmersion.com/)

Re: Build Git – Learn Git

#34
I appreciate the work that has gone into this, and think it is a great starting point for an interesting tutorial about git.

My concern is that the tutorial ignores or discards ideas essential to how git works, and what makes git different to other version control systems.

As other comments have said, this is showing 'just another SCM system' without illuminating the design decisions that make git different.

For example, in git it is extremely important that commit objects have a unique identifier for any given working directory, history, and commit meta-data. Without this guarantee the distributed architecture of git is (almost) impossible to implement.

In the commit section the tutorial states:

a simple Commit class would have ... a change containing the snapshot of change made. Understanding how a change is actually stored is beyond the scope of this implementation.

This terminology is misleading at best, and skips over a very important concept in how git actually works. The phrase 'snapshot of change made' is misleading, as a commit doesn't contain any explicit information about changes made. Instead, the staged files in the working directory are saved into a 'blob' store, a tree structure is created to represent the directory structure, and a reference to the tree is saved in the commit object. I understand that all this is outside the scope of the tutorial, however an outline of how commits work is important information for anyone trying to understand how git works. For example, the storage format is the primary reason operations in git are so fast.

Again, I like the tutorial, but if it wants to teach about git, as opposed to other version control systems, it needs to ensure the key git concepts are maintained.

Re: Build Git – Learn Git

#36
post #34

I appreciate the work that has gone into this, and think it is a great starting point for an interesting tutorial about git. My concern is that the tutorial ignores or discards ideas essential to how git works, and what makes git different to other version control systems. As other comments have said, this is showing 'just another SCM system' without illuminating the design decisions that make git different. For exam…

I 100% agree. It's always great to try to implement complicated things, but it misses the point if what you're implementing is nothing like the original system. You aren't learning how Git works if you do it that way are instead just mimicking API names

Re: Build Git – Learn Git

#37
It's a cool concept but like other comments say it overlooks a lot of the things that make git, git.

Best way to learn? use it!

Maybe just create a dummy repo and go from there with it. Maybe use the GUI tools until you're comfortable with the command line.

For me personally, it was command line first. If you aren't sure about something with git, googling it will pretty much always throw out your answer.

Re: Build Git – Learn Git

#38
post #34

I appreciate the work that has gone into this, and think it is a great starting point for an interesting tutorial about git. My concern is that the tutorial ignores or discards ideas essential to how git works, and what makes git different to other version control systems. As other comments have said, this is showing 'just another SCM system' without illuminating the design decisions that make git different. For exam…

I 100% agree. It's always great to try to implement complicated things, but it misses the point if what you're implementing is nothing like the original system. You aren't learning how Git works if you do it that way are instead just mimicking API names

Reiterating on my point again, the aim of this project is not to replicate Git. JS-Git (https://github.com/creationix/js-git) does that.Here I am trying to code basic concepts relaxing complex stuff so that reader can focus & visualize more abstract concepts. I have tried to bring in concepts as and when wanted instead of just overloading the reader with complex stuff all at once.

Re: Build Git – Learn Git

#39
post #37

It's a cool concept but like other comments say it overlooks a lot of the things that make git, git. Best way to learn? use it! Maybe just create a dummy repo and go from there with it. Maybe use the GUI tools until you're comfortable with the command line. For me personally, it was command line first. If you aren't sure about something with git, googling it will pretty much always throw out your answer.

I'm not sure I quite agree. Use it, yes, but if you're using Git as a black box then you're much more likely to be frustrated by it than if you understand what's going on under the hood. I tend to point people at "Git from the bottom up"[0] -- it gives people the understanding they need to work out the effect they require, from which they can work out which set of commands will get them there.

[0] http://ftp.newartisans.com/pub/git.from.bottom.up.pdf

Re: Build Git – Learn Git

#40
Great work and keep continuing with the series. I understand this is not exactly the real git's inner working, but this series of articles may lead some other coder or hacker or other inquisitive mind to stitch together the missing part. That's the beauty of sharing!
Post reply on HN