Live data from Hacker News

Git 2.11 has been released

github.com

51–60 of 68 posts

Re: Git 2.11 has been released

#51
post #12

This is a really well written partial set of release notes. I was curious and looked at the full release notes [1], and I think these are pretty well written as well. I'm very impressed, especially given that git has such a large set of contributors. [1]: https://github.com/git/git/blob/v2.11.0/Documentation/RelNot...

I liked this gem in L547: > The code that we have used for the past 10+ years to cycle 4-element ring buffers turns out to be not quite portable in theoretical world.

That piqued my curiousity, and I had to dig up the relevant commit: https://github.com/git/git/commit/bb84735c80.

It deals with wrapping an integer index around after incrementing it, the old code just used ++index and a bitmask, the new code uses + 1 and modulo.

I have problems understanding this right now, in my world ++index for an int really shouldn't trigger overflow when counting to at most 4, on any (sem-)realistic environment?

Feeling extra dense, must have more coffee.

Re: Git 2.11 has been released

#53
post #51
post #12

Earlier quoted context omitted.

I liked this gem in L547: > The code that we have used for the past 10+ years to cycle 4-element ring buffers turns out to be not quite portable in theoretical world.

That piqued my curiousity, and I had to dig up the relevant commit: https://github.com/git/git/commit/bb84735c80 . It deals with wrapping an integer index around after incrementing it, the old code just used ++index and a bitmask, the new code uses + 1 and modulo. I have problems understanding this right now, in my world ++index for an int really shouldn't trigger overflow when counting to at most 4, on any (sem-)rea…

The counter never resets, it just keeps going up and we only look at the low bits. So eventually it will need to wrap. It's doubtful that ever happened in practice, even on a 32-bit system (you'd need to print 2 billion SHA-1s in a single process, and even the largest repos have on the order of millions).

So the key difference between the old and the new is that the counter resets to zero every fourth call.

Re: Git 2.11 has been released

#54

This is a really well written partial set of release notes. I was curious and looked at the full release notes [1], and I think these are pretty well written as well. I'm very impressed, especially given that git has such a large set of contributors. [1]: https://github.com/git/git/blob/v2.11.0/Documentation/RelNot...

In Git Rev News edition 20 (https://git.github.io/rev_news/2016/10/19/edition-20/) there are also articles about some changes in v2.11:

- Changing the default for “core.abbrev”?

- Prepare the sequencer for the upcoming rebase -i patches

(I am a Git Rev News editor.)

Re: Git 2.11 has been released

#55
Jesus christ Git's interface design is horrible.

  Master Coder: Hmm. We refer to changes by a long, totally non-human-parseable string of characters that nobody can memorize,
  and when we abbreviate it, it doesn't work 100% of the time. What can we do about it?
  
  Novice Apprentice: Well... how about we stop using a long totally non-human-parseable string of characters that no 
  human can can memorize just to briefly refer to specific changes in human-readable output?
  
  MC: What?! HERESY. Making a human use a cryptographic hash to reference a single random logical reference point in a mass of
  logical binary objects among millions of others is clearly the best way to go. We just need some quick fixes.
  
  NA: But... you can't reference it via speech, it doesn't work reliably via text when abbreviated, and it gives absolutely no
  context whatsoever as to what it is. What's the point of using a cumbersome, inhuman reference for something you
  only need to talk about briefly through a computer interface?
  
  MC: SILENCE FOOL! ME DESIGN GOOD. YOU MAKE CODE MASTER ANGRY.
  
  NA: Err... but what if we just let the program rename the references temporarily to human-parseable short strings, and resolve
  what they are in between logs and commits?
  
  MC: I SAID SILENCE!! Just for that, i'm going to make you explain to a new user why we force people to regularly clean
  our their repositories after doing complicated things with them, like merging.

Re: Git 2.11 has been released

#56

Jesus christ Git's interface design is horrible. Master Coder: Hmm. We refer to changes by a long, totally non-human-parseable string of characters that nobody can memorize, and when we abbreviate it, it doesn't work 100% of the time. What can we do about it? Novice Apprentice: Well... how about we stop using a long totally non-human-parseable string of characters that no human can can memorize just to briefly refer…

I disagree with you, I think the hash is a very good auto-generated unique identifier to every commit. What do you suggest to use instead? You do have the option to tag commits with human friendly names.

Re: Git 2.11 has been released

#57

Jesus christ Git's interface design is horrible. Master Coder: Hmm. We refer to changes by a long, totally non-human-parseable string of characters that nobody can memorize, and when we abbreviate it, it doesn't work 100% of the time. What can we do about it? Novice Apprentice: Well... how about we stop using a long totally non-human-parseable string of characters that no human can can memorize just to briefly refer…

> Git is full of some of the worst design decisions in modern software history.

It's also full of some of the best software design decisions. The internals of Git are simple and elegant and they work like a charm. There have been very little changes to the internal workings since the first commit of Git.

I agree that the user interface is inconsistent, ugly and hard to grasp. But if you have a solid understanding of the internals, with the help of the git manpages it's pretty easy to achieve what you want.

There's software that's intended to work like a black box, just poke around the user interface and you can get stuff done. Git is not one of those. You need to understand the internal model, accept that the UI sucks, embrace the manpages, quit whining and get shit done.

Re: Git 2.11 has been released

#58

They were off by a factor of 10 with the likelihood of being struck and killed by lightning, according to the nws website. To clarify: the likelihood of being merely struck by lightning is ~ 1/1,000,000 per year. The likelihood of being struck and killed is 1/10,000,000 , or about 1/2^23.25 Given this, you would only have to be struck and killed by lightning 6.8 years in a row to equal a sha1 hash collision probabili…

I think the probability of being killed by lightning even two years in a row is already zero.

Re: Git 2.11 has been released

#59
I'm curious if anyone knows if the optimizations Twitter made to improve fetch performance for large, active repos have made it upstream yet? I don't work there anymore and neither do any of the people who were originally doing that work, but it was a pretty impressive speed up (I could git pull thousands of commits and be done in under a second on a 3GB repo with no large objects). I know the watchman support made it in, which was the other half of what made large repos perform well, but I haven't seen mention of the log-structured patch queue stuff that helped the server by eliminating most of the work to calculate what to send on a fetch. Anyone know?

Re: Git 2.11 has been released

#60

Why doesn't git upon commit ensure the sha-1 is unique by having some nonce as part of it? I guess if you only work with rebases instead of merges, it should be possible, right?

I think the answer is "it doesn't need to", because the probability of a collision is too low.

The issue is with collisions in the truncated hashes which are often used to refer to objects in emails and such. Not the full SHA.

Post reply on HN