Remix.run Logo
cxr a day ago

I've never seen a .gitignore that was justified, ever. It probably shouldn't even exist. I've run into projects often enough with horked build scripts or bad docs about build pre-requisites, where upon failing partway through and necessitating some fix, the build failure leaves the tree in a state where it still won't build successfully even after fixing the thing that caused the original failure. The only fast fix is to rm .gitignore, then look at the output of git-status and rm -rf all the crap that it shows the original build attempt splattered everywhere before re-running the build script for a third attempt. Thanks, .gitignore.

.gitignore is banished in every project I'm in charge of. Everyone is required to manage their personal .git/info/exclude themselves, and any changeset attempting to slip .gitignore into the project will get ipso facto rejected. (Anyone is free to submit a change that adds a file contrib/gitignore if you think you have a set of useful globs relevant to the project that will be a help to others, along with instructions to cp that file to .git/info/exclude, but .gitignore is not making it in.)

Git needs to ship a git-ignore command (or extend git-config) that exclusively works by managing .git/info/exclude for you, including converting "legacy" .gitignore into the less anti-social version.

athorax a day ago | parent | next [-]

This is one of the strangest opinions I've seen in awhile. Your complaint seems like it should be pointed at projects not having a working "clean" make target.

Also:

  git status --ignored
  git clean -ndX # preview what would be removed
  git clean -fdX # actually delete the files (warning: destructive)
15 hours ago | parent [-]
[deleted]
quietbritishjim a day ago | parent | prev | next [-]

Or, you could have a build system that does a 100% out-of-tree build into ./build, and then if the build is broken you delete that one directory. You hardly need git to help you with that.

cxr a day ago | parent [-]

Oh, I can? Cool advice! How do I get the people with bad hygiene that we're talking about to follow it?

(You have lost the plot; your response amounts to explaining how soap and water works to someone who has just described their office mate's tendency not to shower.)

quietbritishjim a day ago | parent | next [-]

Get a new job? You can't be that "in charge of" a repo if you can't enforce rules this basic. In fact, I don't understand how you can enforce something as (being polite) unusual as banning .gitignore and yet can't enforce build system hygiene.

cxr 15 hours ago | parent [-]

Believe it or not, there are people whose interactions with software are not limited to projects that they wrote and have control over.

a day ago | parent | prev [-]
[deleted]
Phemist a day ago | parent | prev | next [-]

So all your fellow devs do `ln -s contrib/gitignore ./git/info/exclude`?

Also you can do `git status --ignored` and it will list all files changed, even if ignored. If that is really your main issue.

cxr 15 hours ago | parent [-]

> So all your fellow devs do `ln -s contrib/gitignore ./git/info/exclude`?

I don't know you think that will do or how symlinks work, but it won't lead to anything relevant to this discussion. (To answer your question: no.)

Phemist 11 hours ago | parent [-]

The symlink creates what is effectively a version-controlled gitignore. It would be the obvious way of getting around your arbitrary restriction (and how do you know they are not doing this, the symlink is not checked in).

My comment and the other replies show you how to use git to check and clean the files of the much maligned horked build script. These will work regardless of the gitignore contents.

But then again, pretty sure you are just having a laugh at our expense by taking this ridiculous position.

Supermancho a day ago | parent | prev [-]

I would not recommend this setup, which is effectively using a more complicated and error prone system. That being said, I could handle it.