platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

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

Open mkeveney opened this issue 3 years ago • 9 comments

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

mkeveney avatar Feb 12 '22 21:02 mkeveney

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")

ivankravets avatar Feb 14 '22 11:02 ivankravets

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.

CircadianRebel avatar Jul 21 '22 22:07 CircadianRebel

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.

dazca avatar Feb 20 '23 09:02 dazca

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.

NathanSweet avatar Apr 26 '23 22:04 NathanSweet

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.

McKayRansom avatar Jul 17 '23 18:07 McKayRansom

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

NilsNachname avatar Sep 13 '23 13:09 NilsNachname