Git's initial commit
81–90 of 128 posts
Re: Git's initial commit
#82Earlier quoted context omitted.
I was under the impression that git hashes are generated based on the contents in a commit. If that's true you cannot retire them. They're not random.
While that is true, part of the contents that is hashed is the time of commit. Therefore if you (somehow...) managed to get that hash, you could just reset and commit again. Or amend. In any case, I believe he was joking. The odds of a sha1 collision are very very low.
Re: Git's initial commit
#83Re: Git's initial commit
#84* +Side note on trees: since a "tree" object is a sorted list of +"filename+content", you can create a diff between two trees without +actually having to unpack two trees. Just ignore all common parts, and +your diff will look right. In other words, you can effectively (and +efficiently) tell the difference between any two random trees by O(n) +where "n" is the size of the difference, rather than the size of the +tree. *
Um, What?
Re: Git's initial commit
#85My god... the comments. Looks like the reddit culture (i.e. fun for in jokes but not particularly professional)
Re: Git's initial commit
#86Earlier quoted context omitted.
It's pointless to argue over these kind of things. Every major project/company has their own codified code style guide, and if you want to contribute/earn your salary then you must follow that style guide to the T. Here's the relevant quote from the Linux kernel coding style[0]: Do not unnecessarily use braces where a single statement will do. if (condition) action(); [0] https://www.kernel.org/doc/Documentation/Codi…
You can sidestep the braces debate by using a lisp.
Re: Git's initial commit
#87It's so short. The readme is the best explanation of git I've seen.
Does anyone know if the structure of git has changed much? I would like to read this thinking this is pretty close to the current implementation but I would have no idea. anyone?
It's actually really great to see that the model hasn't changed much (there must have been a long phase of thinking before though)
If you want to go deeper, you can check out this page:
Re: Git's initial commit
#88Linus wrote: * +Side note on trees: since a "tree" object is a sorted list of +"filename+content", you can create a diff between two trees without +actually having to unpack two trees. Just ignore all common parts, and +your diff will look right. In other words, you can effectively (and +efficiently) tell the difference between any two random trees by O(n) +where "n" is the size of the difference, rather than the siz…
Hence diffing arbitrary commits with git is always O(N) in the number of changed files, regardless of the number of interstitial commits.