Live data from Hacker News

Git's initial commit

github.com

21–30 of 128 posts

Re: Git's initial commit

#22

Earlier quoted context omitted.

It's a C-style language syntax option. If it's only a single line in after the if, the braces are optional. I've also seen it in C++ and PHP. Whether or not it's sloppy is up for debate and just a matter of personal preference.

C# also has it, and i've heard Java has got it as well, but I've never tested it in the latter. I personally like being able to do it since it allows me to do away with the 2 extra lines auto indent puts in if i add brackets. That's a 50% reduction for a 4 line if. Maybe I should just buy a bigger monitor.

The lead programmer at my last job encouraged us to use it as a way to make sure our conditionals & foreach loops (PHP programmer) weren't doing too much. If we had to use braces, it was a sign to check it out and see if it could stand some refactoring.

Re: Git's initial commit

#23

Earlier quoted context omitted.

It's a C-style language syntax option. If it's only a single line in after the if, the braces are optional. I've also seen it in C++ and PHP. Whether or not it's sloppy is up for debate and just a matter of personal preference.

C# also has it, and i've heard Java has got it as well, but I've never tested it in the latter. I personally like being able to do it since it allows me to do away with the 2 extra lines auto indent puts in if i add brackets. That's a 50% reduction for a 4 line if. Maybe I should just buy a bigger monitor.

I use a plugin called littlebrace for visual studio, which reduces brace lines to like 3 pt font. My C# code has started looking like Python :)

Re: Git's initial commit

#25

Earlier quoted context omitted.

It's a C-style language syntax option. If it's only a single line in after the if, the braces are optional. I've also seen it in C++ and PHP. Whether or not it's sloppy is up for debate and just a matter of personal preference.

C# also has it, and i've heard Java has got it as well, but I've never tested it in the latter. I personally like being able to do it since it allows me to do away with the 2 extra lines auto indent puts in if i add brackets. That's a 50% reduction for a 4 line if. Maybe I should just buy a bigger monitor.

Or use a better bracing style. Or move to significant whitespace.

Re: Git's initial commit

#29
post #11

Earlier quoted context omitted.

Given that the only way to reuse it is to duplicate the tree and commit metadata exactly, or find an sha1 collision, I think it's pretty safe. :) I wonder if there are any git sha1 collisions out there in aggregate, say across all of github. Would they even notice if there were?

>I wonder if there are any git sha1 collisions out there in aggregate, say across all of github. Despite the incredibly high number of all commits there must be, I think the chance of a collision is still very unlikely. 2^160 is a pretty big number.

The number of inputs before a likely collision is more on the order of 2^80. Which is still pretty large.

Re: Git's initial commit

#30

Earlier quoted context omitted.

>I wonder if there are any git sha1 collisions out there in aggregate, say across all of github. Despite the incredibly high number of all commits there must be, I think the chance of a collision is still very unlikely. 2^160 is a pretty big number.

The number of inputs before a likely collision is more on the order of 2^80. Which is still pretty large.

True, the birthday paradox definitely makes it a lot more likely, but as you say the odds should still be too low.
Post reply on HN