170 points chmaynard 15 hours ago 88 comments
WCSTombs 14 hours ago | parent
KolmogorovComp 13 hours ago | parent
nomel 13 hours ago | parent
jayd16 13 hours ago | parent
wtfwhateven 12 hours ago | parent
vlovich123 11 hours ago | parent
awesome_dude 7 hours ago | parent
jayd16 30 minutes ago | parent
Issue is it would be pretty slow so you'd want it to be a one time thing.
em-bee 13 hours ago | parent
infogulch 11 hours ago | parent
nextaccountic 10 hours ago | parent
Failing that, have a kind of git object that wraps another and says hey this is in sha1 don't mess with it
schacon 4 hours ago | parent
Yes, you do need to do that. However, there is also much more work after that.
Git will not intermingle SHA-256 and SHA-1 enabled repositories, even in things like submodules, so anything used in that manner will need to keep both versions into the indefinite future. If you rely on a submodule that has not yet converted, you will have to convert it yourself and try to keep it up to date, or the forge will have to automatically keep a bidirectional mirror (if you have submodules in various forges, you'll have to wait for all of them to do it), etc.
This means that every SHA referenced anywhere on the internet, in commit messages, in issues, in code comments is now invalid and needs a mapping to find the rewritten one for forever.
It also means that every commit signature ever made is now invalid and will probably have to be stripped from the rewritten new 256 history because it's impossible to resign everything.
Companies like Google and GitHub are working on keeping two versions of each repository so that there can be long stages of ecosystem migrations, but no matter what, it's going to be a huge pain for millions of developers for years to come.
coliveira 11 hours ago | parent
tombert 11 hours ago | parent
coliveira 11 hours ago | parent
nvme0n1p1 10 hours ago | parent
aw1621107 10 hours ago | parent
Just because something does provide an immediate perfect solution does not mean it isn't not worth investigating and/or pursuing.
Also consider that bugs tend to be more prevalent in new code (e.g., [0]) as a result, you are likely to see more of a benefit from writing new code in a memory-safe language than raw line count proportions would indicate.
[0]: https://security.googleblog.com/2024/09/eliminating-memory-s...
baq 7 hours ago | parent
devilsdata 7 hours ago | parent
Joker_vD 5 hours ago | parent
shakow 6 hours ago | parent
jcranmer 10 hours ago | parent
I wouldn't agree with all of those reasons, but it's very definitely not "just for the sake of it." One of the better reasons so many people look to writing some things in Rust is that we now have pretty ample evidence than trying to write a binary file format parser in C is a cornucopia of CVEs that are just simply absent in Rust, and the excuse of "well, but a sufficiently smart programmer doesn't write bugs in C" doesn't cut it anymore.
coliveira 10 hours ago | parent
jcranmer 10 hours ago | parent
eviks 10 hours ago | parent
cxr 10 hours ago | parent
duskwuff 9 hours ago | parent
I don't see how that's possible without turning the language into something that isn't C, either by adding significant new functionality (e.g. fat pointers) or subtracting enough functionality that it's a much less capable language (e.g. disallowing dynamic memory allocation).
hellcow 8 hours ago | parent
An important improvement over rust is that "Fil-C has no unsafe statement."
rpadovani 7 hours ago | parent
In case of fil-c, it is about 1.5-4x slower performance, and a memory overhead.
So, let's not present it as a panacea to all problems: there could good reasons to use it, but it isn't a magic trick.
112233 9 hours ago | parent
epidemian 10 hours ago | parent
Maybe git's case is different though. Do you have more info about it? Are you a git maintainer who was coerced to use Rust, or do you know of such cases?
serbuvlad 7 hours ago | parent
on my Linux system, C takes ownership of a 'top-level' /usr/include directory, all the kernel APIs have their canonical definitions in C headers, a lot of system features like nsswitch require dynamically linked C libraries etc. etc.
Rust is just something that programs can choose to be written in and that doesn't inconvenience me in any way.
devilsdata 7 hours ago | parent
eviks 10 hours ago | parent
Good, are there (m)any other plans to ditch the slow files and use proper database? Or is it only reserved for various post-git competitors?
112233 10 hours ago | parent
cesarb 9 hours ago | parent
The filesystem is a proper database, just not a relational one.
Linus focused heavily on performance when he wrote git; he used the filesystem because, as the main Linux kernel maintainer, he knew that the Linux VFS and filesystems were fast enough for these use cases.
(It's the use cases that have changed; it was not expected back then to have more than a few hundred refs in a single repository.)
eviks 8 hours ago | parent
Ah, yeah, "you're holding it wrong", though use cases haven't changed, it's closer to the expected common case of expectations turning out wildy wrong (Why would you ever expect people to stop NAMING things at scale???)
But also the core property of the filesystem database has always been low performance for a bunch of tiny things
spankalee 8 hours ago | parent
schacon 4 hours ago | parent
This is work that Patrick and GitLab have been doing for years now and it's very impressive and nearly complete.
jayd16 14 minutes ago | parent
ithkuil 3 hours ago | parent
globular-toast 8 hours ago | parent
gotosun1 7 hours ago | parent
masklinn 7 hours ago | parent
And sha256 is in private preview at GitHub: https://github.com/bk2204/talk-rust-in-git/blob/dev/presenta...
nickserv 1 hour ago | parent
Priorities!
IshKebab 7 hours ago | parent
onetoo 7 hours ago | parent
IshKebab 7 hours ago | parent
1. Git push should default to --force-with-lease --force-if-includes.
2. push.autoSetupRemote should be enabled by default.
3. The default conflict style should be zdiff3.
4. diff.submodule should be 'log' by default (gives much nicer submodule diffs).
5. Submodule updates / clones should be recursive by default. (There is a setting for this but I can't remember it.)
mjmas 1 hour ago | parent
receive.denyCurrentBranch should be updateInstead by default (or at the very least mentioned in the help message, rather than it recommending ignore or warn or refuse, none of which do what is wanted)
coldpie 55 minutes ago | parent
This one always baffled me. The default conflictstyle is so hard to read it's almost useless. Using diff3 is mandatory.
I hadn't heard of zdiff3, I'll give it a shot.
iib 7 hours ago | parent
[1] https://blog.gitbutler.com/how-git-core-devs-configure-git
Oxodao 5 hours ago | parent
moebrowne 7 hours ago | parent
jodersky 6 hours ago | parent
Basically, the idea is to attribute a new kind of ID to an initial 'change'. During review, or whenever a commit is rebased, the change ID is kept, whereas the commit of course changes. This allows tooling to identify all previous versions of a change, and is what enables "per-commit" code review à la Gerrit [2] (which IMO is a much better experience than the branch-review-squash model that GitHub normalized). It's also used in jj, although I'm not familiar with that.
As of today, any tool that wants a change ID needs to somehow encode it in commit message bodies. The proposed discussion was about making a change ID a standard header field that git would natively keep across rebases.
[1] https://lore.kernel.org/git/Z_OGMb-1oV0Ex05e@pks.im/T/#mf941...
[2] https://gerrit-review.googlesource.com/Documentation/user-ch...
ncphillips 6 hours ago | parent
stabbles 4 hours ago | parent
For example, if GitHub is down, that would not be a blocker to access review comments or to do reviews. And maybe you could push your reviews to a GitLab mirror if you want a UI.
nickserv 1 hour ago | parent
Surely you mean when GitHub is down.
As an aside, I thought it a bit worrisome that the move to Sha256 is apparently delayed due to GitHub dragging their feet on this.
schacon 4 hours ago | parent
I doubt that core Git will adopt it anytime soon as it was not discussed at this years contributor summit (last week) and doesn't seem to be a hot topic on the ML.
What I would like to see is support for `git rebase` not dropping it, which is the current main issue. The `git replay` command, as well as commands based on the same sequencing code (`git history` for example) do not drop custom headers like this, so there is partial non-breakage, but several of the other history editing commands do drop custom headers.
lostmsu 2 hours ago | parent
ikawe 1 hour ago | parent
If you never rewrite history, you could achieve something similar, but it precludes you from having a “tidy” branch.
Whether or not you’re into rewriting history is a different discussion that has been hashed out over and over again.
notpushkin 6 hours ago | parent
Quite a generous offer!
</aside>
Razengan 5 hours ago | parent
gregoriol 5 hours ago | parent
m000 4 hours ago | parent
Then you can also do `git diff > changes.diff`. Or simply `rsync -avPh repo/ repo.snap/`, if your repo isn't huge. Or consider putting your repo in a filesystem that can do CoW snapshots.
lolakutty 4 hours ago | parent
GTP 4 hours ago | parent
cesarb 3 hours ago | parent
penguin_booze 3 hours ago | parent
TacticalCoder 3 hours ago | parent
What about future attacks by quantum computers? Is Git safe from quantum computers for it's all hashes only? Or shall there be issues with quantum attacks?
I'm asking for there are several projects that are already moving to quantum-resistant schemes (like OpenSSH who uses an hybrid scheme [1]).
krior 2 hours ago | parent
TacticalCoder 2 hours ago | parent
And from the other comment, symmetric cryptography is safe too from QC attacks.
So it's apparently as you wrote: it's really only asymmetric crypto that is at risk.
jcranmer 19 minutes ago | parent
Quantum algorithms require some sort of quantum 'trick' to actually have any speedup over classical computers. The most general quantum trick is Grover's algorithm, which lets you find f⁻¹(x) (given f and x) in sqrt(N) queries rather than N queries, where N is the size of the set from which x is drawn. This cuts the bit security of every algorithm in half, although for things like cryptographic hashes, it really means that a second preimage is now only as 'easy' as finding a collision (due to the birthday attack).
The other really well-known quantum trick is QFT, which allows you to find the period of an unknown periodic function really quickly. This is what allows quantum computers to break asymmetric algorithms based on integer factoring or elliptic curves, since they can both be expressed in terms of the QFT.
rainworld 2 hours ago | parent
mitxela 2 hours ago | parent
This has nothing to do with SHAttered
brookst 2 hours ago | parent
But the article helps. Basically Grover’s is not as potent as Shorr’s. And it seems like everyone is convinced there is no dramatically better quantum algorithm than Grover’s?
DannyBee 1 hour ago | parent
Grover's assumes the function is a black box that you cannot look inside and that your only way of finding a certain result is through repeated invocation.
Under this assumption, Grover's is optimal in the number of invocations of the function required to find the result.
However, this assumption may be quite wrong for AES and friends. It may be the structure allows for non brute force attacks that are totally impractical classically but not subject to Grover's optimality limitation quantumly.
The only thing you are guaranteed here is that if you cannot take advantage of structure at all then Grover's is the best you can do.
Given that we have pretty much always found a way to take some advantage of structure, I would bet we will do so here.
That may or may not make it viable to break at all, I just wouldn't bet that it must be treated like a black box forever.
To me that would be a very bad bet.
brookst 57 minutes ago | parent
And, if I’m following you, that’s the key difference in Grover’s and Shorr’s: Shorr’s takes advantage of structure?
fnordsensei 2 hours ago | parent
jakub_g 2 hours ago | parent
All those problems just go away when branches are no longer files on disk.
I enabled it in setup script of one large repo I maintain; the main issue is the incompatibility with some people's personal tooling based on libgit2 (some git status tooling in oh-my-zsh), but people do find workarounds.
harrouet 1 hour ago | parent