News for hackers. Stuff that matters.
Re:We Put Half a Million Files in One Git Repository, Here’s... by jamesfinlayson on Thursday June 16, 2022 @02:14AM (#31762933)
Ah - that would explain why at my current job there was a node_modules directory in git with nearly 2 million lines of Javascript within.

It is gone now.

Re:We Put Half a Million Files in One Git Repository, Here’s... by SenHeng on Thursday June 16, 2022 @02:26AM (#31763007)
The days before lock files were a thing and 'it works on my machine!' was rampant.
Re:We Put Half a Million Files in One Git Repository, Here’s... by sausagefeet on Thursday June 16, 2022 @10:07AM (#31766218)
Lock files protect you from the version changing out from under you, but modules disappearing from NPM is a thing that happens. Yes, you can use artifactory or similar as a proxy but that requires infrastructure that you may not want to run. That is all to say: there are situations where committing node_modules is the least evil.
Re:We Put Half a Million Files in One Git Repository, Here’s... by anitil on Thursday June 16, 2022 @02:53AM (#31763172)
... are we no longer doing 'works on my machine' ?
Re:We Put Half a Million Files in One Git Repository, Here’s... by dotancohen on Thursday June 16, 2022 @03:24AM (#31763365)
Ostensibly if it works in Alice's Docker instance, it will run in Bob's Docker instance too.
Re:We Put Half a Million Files in One Git Repository, Here’s... by sigio on Thursday June 16, 2022 @06:18AM (#31764330)
Well... unless some dev's have M1-macs, and some of the docker layers are not available for arm, or the other way around, not available for amd64. Gives interesting issues.
Re:We Put Half a Million Files in One Git Repository, Here’s... by Beltiras on Thursday June 16, 2022 @05:43AM (#31764139)
Except for weird Docker edge cases (extremely rare, but does happen).
Re:We Put Half a Million Files in One Git Repository, Here’s... by necovek on Thursday June 16, 2022 @06:12AM (#31764295)
Not rare at all.

Docker is a congregation of technologies held together with duct tape and glue.

Eg. permissions handling is completely different on Macs with Docker Desktop from the Linux dockerd stuff: on Macs, it automatically translates user ownership for any "mounted" local storage (like your code repository), whereas on Linux user IDs and host system permissions are preserved. Have some developers use Macs and others use Linux, and attempt to do proper permissions setup (otherwise known as "don't run as root"), and you are looking for some fun debugging sessions.

Re:We Put Half a Million Files in One Git Repository, Here’s... by the_common_man on Thursday June 16, 2022 @10:35AM (#31766547)
> Docker is a congregation of technologies held together with duct tape and glue.

No, it's not. What a wild conclusion to reach from the example you gave.

Re:We Put Half a Million Files in One Git Repository, Here’s... by coding123 on Thursday June 16, 2022 @03:23AM (#31763358)
At companies that don't check in node_modules, build folders, and are using standard packaging tooling like maven or yarn or npm or what-have-you. Yes, I haven't experienced that in like 15 years.
Re:We Put Half a Million Files in One Git Repository, Here’s... by raverbashing on Thursday June 16, 2022 @03:38AM (#31763438)
Ugh

The price of letting less experienced people "go crazy" in the repo

Re:We Put Half a Million Files in One Git Repository, Here’s... by diegoveralli on Thursday June 16, 2022 @05:30AM (#31764051)
Npm didn't support lockfiles until version 5, released in 2017, Yarn had them at launch in 2016. Before that committing node_modules was often used as a form of vendoring, to get reproducible builds.

If a new project these days commits node_modules to git, it's likely a mistake, but for legacy projects started before 2017 it was the lesser of two evils.

Edit: spelling.

Re:We Put Half a Million Files in One Git Repository, Here’s... by jamesfinlayson on Thursday June 16, 2022 @08:09PM (#31772532)
Hm, this project was started in 2017. The node_modules directory was for Serverless (a tool written in Javascript), not the website itself (which was written in AngularJS - probably not the best choice in 2017 either).
Re:We Put Half a Million Files in One Git Repository, Here’s... by Groxx on Thursday June 16, 2022 @01:20PM (#31768594)
s/was often used as a/was the only practical/

Prior to lock files (and potentially after, as checked-in files are beyond trivial to modify and review and that can be worthwhile) committing dependencies in some form was basically the only reasonable way to have reproducible builds, unless you wanted to build your own package manager / lock file implementation.

Which is what Yarn did.

Re:We Put Half a Million Files in One Git Repository, Here’s... by megous on Thursday June 16, 2022 @04:42PM (#31770734)
Or sane people wanting to have some cheap, low effort way to track changes in their project's dependencies.