git-autoconfig icon indicating copy to clipboard operation
git-autoconfig copied to clipboard

Add option to not auto add config

Open muuvmuuv opened this issue 4 years ago • 5 comments

Because it is possible to set a global git user it is not needed to set this exact one manually. Adding a new option to disable auto add would be great. A VS Code command to change/add one would be needed then.

muuvmuuv avatar Aug 18 '20 14:08 muuvmuuv

Added for next release.

ShyykoSerhiy avatar Aug 18 '20 15:08 ShyykoSerhiy

Implemented in 0.0.2 (commit https://github.com/ShyykoSerhiy/git-autoconfig/commit/5cbc6ffb3172f7fe30753f1ecc55ea97957ac5a7). Try it out.

ShyykoSerhiy avatar Sep 13 '20 18:09 ShyykoSerhiy

It is still asking. Did I get that correctly that I can just ignore a project? This would get a hell of a mess for test projects (I often do smth like npx create-next-app or ng new). Why not asking git for the current user config and if present do not ask to add one? Then a command can be used to easily add a different one.

muuvmuuv avatar Sep 15 '20 07:09 muuvmuuv

I would still need to store somewhere that you want to use global config instead of local one (per project). I can probably add a config param like "storeIgnorePerProject": boolean. If true then ignore list isn't stored globally, but instead for each ignored project "git-autoconfig.ignoreThisProject" property is set to true. If the folder with the project is removed, then "git-autoconfig.ignoreThisProject" is removed with the project too. This way temporary projects with the same folder path would work fine.

ShyykoSerhiy avatar Sep 16 '20 01:09 ShyykoSerhiy

Why is any config needed for that? I don't get it. I think it would be enough to just have one of those options:

  • an option "enable using global git user config"
  • enable it by default if git config --global --get-regexp user. return a user/email and give the user an option to disable this behaviour

No idea if VS Code can run git commands but would make it less of a hastle.

Two commands to add the user config and one that removes it is just an addition that would make it ez if someone like me uses global config but has cloned a repo from a private GitLab for example.

muuvmuuv avatar Sep 16 '20 07:09 muuvmuuv