platformio / platformio-core

Your Gateway to Embedded Software Development Excellence :alien:
https://platformio.org
Apache License 2.0
7.89k stars 792 forks source link

Please allow disabling automatic .gitignore generation; or any arbitrary .tpl file #4181

Open mkeveney opened 2 years ago

mkeveney commented 2 years ago

My platformIO projects generally live in a subfolder of a larger .git repository. I prefer to manage a single .gitignore file in the root of my repository.

PlatformIO insists upon re-generatng the .gitignore file. I'd like to be able to turn this off.

This subject is discussed here: https://community.platformio.org/t/how-to-disable-auto-generating-gitignore-when-using-vscode/17125

Where @maxgearhardt helpfully detailed the technical reasons for this. He suggests a more general solution might be to allow disabling any .tpl file.

-Matt

ivankravets commented 2 years ago

Thanks for the issue. We will think about how to fix it.

A temporary solution is to use Advanced Scripting and extra script:

import os

if os.path.isfile(".gitignore"):
    os.remove(".gitignore")
CircadianRebel commented 2 years ago

Came here to file this same issue. My organization uses hg, not git, and this bad behavior on pio's part is a pain and causes usability issues. e.g. it causes programs such as vs code to constantly think there are modified files.

dazca commented 1 year ago

The automatic .gitignore creation should be disabled by default. Creating a .gitignore is bound to those who use git, and is not mandatory to use git to use PlatformIO. Furthermore, it is implying a fixed way-to-organize your repository and might not be the case.

These two assumptions were done while adding this feature, and they were way too broad. At the end, creating yourself the .gitignore manually is the standard procedure of those who use git, and if someone wants this feature by default will look for it on the PlatformIO documentation. The other way around (the now implemented and with no way to disable) is weird.

NathanSweet commented 1 year ago

I'm using the script workaround but extra_scripts goes under env, so the .gitignore file will still be created and hang out until the next build is run.

McKayRansom commented 1 year ago

I also ran into this issue, generating a .gitignore is not intuitive behavior. Took me a while to figure out it was PlatformIO. Would love an option in the VS Code extension to turn this off. That way it would show up when searching for VSCode settings. That was the first place I looked.

NilsNachname commented 1 year ago

Yes please. This conflicts with my project structure and it's very bothersome that there is no way to disable the behavior.

arduhe commented 4 months ago

I have a - admittedly somewhat rough 😉 - solution for this problem. I have deleted the annoying template, which could be found under

~/.platformio/penv/lib/python3.6/site-packages/platformio/project/integration/tpls/vscode/.gitignore.tpl

Nevertheless, I would prefer a more permanent and less invasive solution

ElTrasho3000 commented 1 month ago

I also would highly appreciate the automatic generation of .gitignore to not happen as default. Also the workaround is annoying, because I need to rebuild everytime to get rid of the .gitignore. So even if I only changed/added comments in my code, I need to delete automatic .gitignore either manually or by building again.

mkeveney commented 1 week ago

@arduhe

I have a - admittedly somewhat rough 😉 - solution for this problem. I have deleted the annoying template

Actually, I like this much better than the script. Thanks for the idea!