Live data from Hacker News

Shit – An implementation of Git using POSIX shell

git.sr.ht

71–80 of 235 posts

Re: Shit – An implementation of Git using POSIX shell

#71
post #46
post #44

Earlier quoted context omitted.

> the supposedly obtuse interface makes a lot more sense when you approach it with an understanding of the fundamentals in hand. Agreed. I always said the best git tutorial is https://www.sbf5.com/~cduan/technical/git/ > The conclusion I draw from this is that you can only really use Git if you understand how Git works. Merely memorizing which commands you should run at what times will work in the short run, but it’s…

>The conclusion I draw from this is that you can only really use Git if you understand how Git works. I say this as someone who uses git regularly, and who prefers it to all other version control systems I have tried: A tool that breaks the principle of encapsulation by forcing you to grok its internals if you are to have any hope of understanding its arcane and inconsistent usage syntax is frankly not a very good to…

> I don't understand how vim works beyond the base conceptual level

How much time have you spent trying to figure out how to change the font size in Vim, rotate text 90° in Vim, recalculate a formula in Vim, or insert an image into a document you're editing in it? If the answer is “none”, you probably have a pretty deep understanding of the data model Vim manipulates, even if you aren't aware of it.

Re: Shit – An implementation of Git using POSIX shell

#72

Hiya HN. I was ranting on Mastodon earlier today because I feel like people learn git the wrong way - from the outside in, instead of the inside out. I reasoned that git internals are pretty simple and easy to understand, and that the supposedly obtuse interface makes a lot more sense when you approach it with an understanding of the fundamentals in hand. I said that the internals were so simple that you could implem…

I view not learning the basic concepts of how git works inside like trying to learn SQL without know what a table is. You could, but its easier if understand that basic abstractions which are its fundamental building blocks.

Theoretically, a person could learn SQL by knowing relational algebra and still not know what a table is. Just sayin’.

Re: Shit – An implementation of Git using POSIX shell

#73
post #44

Hiya HN. I was ranting on Mastodon earlier today because I feel like people learn git the wrong way - from the outside in, instead of the inside out. I reasoned that git internals are pretty simple and easy to understand, and that the supposedly obtuse interface makes a lot more sense when you approach it with an understanding of the fundamentals in hand. I said that the internals were so simple that you could implem…

> the supposedly obtuse interface makes a lot more sense when you approach it with an understanding of the fundamentals in hand. Agreed. I always said the best git tutorial is https://www.sbf5.com/~cduan/technical/git/ > The conclusion I draw from this is that you can only really use Git if you understand how Git works. Merely memorizing which commands you should run at what times will work in the short run, but it’s…

I never really understood Git until I read this tutorial: https://github.com/susam/gitpr

Things began to click for me as soon as I read this in its intro section:

> Beginners to this workflow should always remember that a Git branch is not a container of commits, but rather a lightweight moving pointer that points to a commit in the commit history.

    A---B---C
            ↑
         (master)
> When a new commit is made in a branch, its branch pointer simply moves to point to the last commit in the branch.

    A---B---C---D
                ↑
             (master)
> A branch is merely a pointer to the tip of a series of commits. With this little thing in mind, seemingly complex operations like rebase and fast-forward merges become easy to understand and use.

This "moving pointer" model of Git branches led me to instant enlightenment. Now I can apply this model to other complicated operations too like conflict resolution during rebase, interactive rebase, force pushes, etc.

If I had to select a single most important concept in Git, I would say it is this: "A branch is merely a pointer to the tip of a series of commits."

Re: Shit – An implementation of Git using POSIX shell

#75

Earlier quoted context omitted.

I meant the tool-vs-internals idea, not the specific example here. If you want something comparable in complexity: we learn programming from `print "hello world"`, not from memory models and assembly. Some people even just start with `=sum(...)` in excel. Every programmer pretty much stops at the level that's useful and productive for them. There's often sentiment that people should know more, but I don't think I've…

>we learn programming from `print "hello world"`, not from memory models and assembly You're talking to the wrong crowd with me, you know. I disagree with this approach, too. Maybe we start with "hello world" to get a taste, but the first thing we should do is start breaking it down.

Thanks. I do understand where you're coming from - your original claim makes sense in that context :-)

Re: Shit – An implementation of Git using POSIX shell

#76
This is essentially adding a blob inside .git/objects by taking a sha1 hash of the data after appending a header "blog \00". Then the first two characters of the hash are created as a directory and the remaining 38 acts as the file name inside which the zlib compressed data is stored. Nice project for learning the git internals.

Re: Shit – An implementation of Git using POSIX shell

#77
post #76

This is essentially adding a blob inside .git/objects by taking a sha1 hash of the data after appending a header "blog \00 ". Then the first two characters of the hash are created as a directory and the remaining 38 acts as the file name inside which the zlib compressed data is stored. Nice project for learning the git internals.

Well, it also includes creating tree and commit objects, and reading and writing the git index.

Re: Shit – An implementation of Git using POSIX shell

#78
post #66
post #21

Earlier quoted context omitted.

I'm definitely not the right person to ask, but: Archival/storage of video shouldn't be that costly. With 5400rpm drives (better for archival than more or less any other type of storage media, including faster hard drives), it looks like the going rate is about a United States cent per gigabyte. Two for 7200rpm drives from manufacturers that seem to produce the most reliable drives on the market, consumer-side. A set…

Storage is cheap. It’s the delivery that’s costly.

Delivery being costly is a myth propagated by Big Cloud®. Any dollar store VPS that isn't DO will have more than enough for streaming video all day every day.

That's irrelevant, though, given the person's question was about storage and archival.

Re: Shit – An implementation of Git using POSIX shell

#80

Earlier quoted context omitted.

Never tried yet for hosting content, however I've read good things about Lbry. https://lbry.com/faq

Ah yes, we needed another blockchain to solve this problem. Perfect.

The amusement here being that git itself is Merkel trees ;-)

(And yes, I've seen, and boosted, your Mastodon tirade, and am ... apprehensive in commenting here.)

Post reply on HN