News for hackers. Stuff that matters.
Re:Git ignores .gitignore with .gitignore in .gitignore by tehbeard on Wednesday May 18, 2022 @10:50AM (#31423511)
I heavily advise AGAINST using this for anything apart from OS level file spam (.DS_Store etc).

We spent a good part of a day rebuilding a repo after a junior dev. left, when we found out they'd misused global gitignore and hadn't commited several important files due to an ignore they had set for a seperate project.

Lessons learnt. Ensure new devs don't use it, and code review on another machine than theirs...

Re:Git ignores .gitignore with .gitignore in .gitignore by fishywang on Wednesday May 18, 2022 @01:13PM (#31425210)
If they did not commit all the important files and your CI system didn't catch that, that's definitely the fault of your CI system, not global gitignore.
Re:Git ignores .gitignore with .gitignore in .gitignore by tehbeard on Friday May 20, 2022 @02:01AM (#31443887)
Because there isn't a CI?

Shocking I know /s.

But not everyone on here is part of a 20 man SV tech startup making the next social media for beagles and deploying 50 times a day...

Re:Git ignores .gitignore with .gitignore in .gitignore by Dobbs on Friday May 20, 2022 @07:06PM (#31453657)
You don’t have to be at a tech startup to have things like CI and/or code review platforms.
Re:Git ignores .gitignore with .gitignore in .gitignore by aynawn on Saturday May 21, 2022 @10:17AM (#31458139)
Agreed. If the code is in GitHub, it's incredibly easy to create a simple github actions workflow that could run the app.
Re:Git ignores .gitignore with .gitignore in .gitignore by llllllllllll9 on Wednesday May 18, 2022 @04:55PM (#31427539)
so glad i don't work with you.
Re:Git ignores .gitignore with .gitignore in .gitignore by xxpor on Wednesday May 18, 2022 @05:09PM (#31427704)
Why? They're right imo
Re:Git ignores .gitignore with .gitignore in .gitignore by llllllllllll9 on Thursday May 19, 2022 @09:36PM (#31442375)
fishywang's attitude
Re:Git ignores .gitignore with .gitignore in .gitignore by SZJX on Sunday May 22, 2022 @02:20PM (#31471158)
What attitude lmao. They’re very matter-of-fact in expressing an objective opinion from what I can see.
Re:Git ignores .gitignore with .gitignore in .gitignore by llllllllllll9 on Wednesday May 25, 2022 @03:14PM (#31509191)
what perceptive skills lmao! i couldn't stand talking to you for 2 minutes.

lmao!

Re:Git ignores .gitignore with .gitignore in .gitignore by OrderlyTiamat on Thursday May 19, 2022 @03:18AM (#31431673)
I don't understand, you'd rather work without a CI pipeline?
Re:Git ignores .gitignore with .gitignore in .gitignore by llllllllllll9 on Thursday May 19, 2022 @09:37PM (#31442377)
i'd rather not work with fishywang
Re:Git ignores .gitignore with .gitignore in .gitignore by runarberg on Wednesday May 18, 2022 @11:38AM (#31424105)
You might have learned the wrong lesson.

A broken code should not be able to make it to production, there should be several steps to prevent that, including: Peer review, CI, QA, a staging environment, manual testing, etc.

Always assume that developers can screw up in trivial ways, and build your delivery system such that trivial screw ups will be caught early, rather then dictate how your devs setup their work stations.

Also don’t code review the code it self, review the diff.

Re:Git ignores .gitignore with .gitignore in .gitignore by nullgeo on Wednesday May 18, 2022 @03:21PM (#31426595)
Yeah exactly, if I `require important.rb` in this file, and `important.rb` wasn't committed how did that project even build and get deployed. Any sane build system will instantly fail for this situations. Looks like an issue with dev ops/engineering culture rather than .gitignore
Re:Git ignores .gitignore with .gitignore in .gitignore by someweirdperson on Wednesday May 18, 2022 @04:54PM (#31427533)
>Also don’t code review the code it self, review the diff.

A significant percentage of the most critical problems I detect during reviews is in the parts that have not been changed, invisible in the diff. A good diff is necessary, but not sufficient.

Re:Git ignores .gitignore with .gitignore in .gitignore by bmitc on Wednesday May 18, 2022 @12:54PM (#31425000)
Telling developers to not use the global .gitignore seems to be the wrong response. For example, I use VS Code, its extensions, and various other development tools that create local files that should not be in repositories. Those files and directories do not belong in a repository's .gitignore file, unless it's a personal project. They most often belong in a global .gitignore unless a team uses a common set of tools. Having a single developer's custom tools be handled by a repository's .gitignore seems to be the wrong approach.
Re:Git ignores .gitignore with .gitignore in .gitignore by Fatnino on Wednesday May 18, 2022 @05:00PM (#31427592)
.git/info/exclude seems like the right place for this.
Re:Git ignores .gitignore with .gitignore in .gitignore by bmitc on Wednesday May 18, 2022 @05:08PM (#31427686)
That's only per repository, isn't it? It won't really be convenient when you're working across several repositories or languages.
Re:Git ignores .gitignore with .gitignore in .gitignore by sitzkrieg on Wednesday May 18, 2022 @10:54AM (#31423552)
how did that project ever build on ci :)
Re:Git ignores .gitignore with .gitignore in .gitignore by xyst on Wednesday May 18, 2022 @11:30AM (#31424010)
hint: there was no CI
Re:Git ignores .gitignore with .gitignore in .gitignore by superjan on Wednesday May 18, 2022 @12:05PM (#31424435)
I heavily advise AGAINST not using CI. If properly applied it solves .gitignore mistakes and many more, made by those infamous junior devs. On second thought, not just juniors. Oh well.
Re:Git ignores .gitignore with .gitignore in .gitignore by 89vision on Wednesday May 18, 2022 @11:16AM (#31423853)
but it worked on my machine
Re:Git ignores .gitignore with .gitignore in .gitignore by abustamam on Wednesday May 18, 2022 @12:59PM (#31425061)
Ship your machine as CI, problem solved /s
Re:Git ignores .gitignore with .gitignore in .gitignore by rubyist5eva on Wednesday May 18, 2022 @01:07PM (#31425150)
docker wants to know your location
Re:Git ignores .gitignore with .gitignore in .gitignore by TheSoftwareGuy on Wednesday May 18, 2022 @03:54PM (#31426912)
Probably the dev made the code review before leaving