Closed ieugen closed 2 years ago
Hi!
You can set the :auto-add
key inside :vcs
in workspace.edn
to false to turn off auto adding of git files, like this:
{:vcs {:name "git"
:auto-add false}
...}
Thank you @tengstrand but my use case if for creating a new project with polylith and I don't have a workspace.edn.
I would argue that it's better to make this OPT-IN instead of OPT-OUT so people can turn it on if they want it.
I agree with @ieugen -- I've always thought the default behavior (auto-committing) is a bad idea. I turn it off in workspace.edn
when I create a project, but having it auto-commit on workspace creation is problematic too and there's currently no way to opt-out of that (and I really do think auto-commit should be opt-in and the default should be to not commit -- for all create
commands -- so I think :auto-add false
should be the default in workspace.edn
unless someone explicitly opts into that behavior when they create the workspace).
Please have a look at the issue-160 branch and see if it behaves as expected (the gitbook doc has to be updated too). To get the current behaviour when creating a workspace, you now have to pass in :commit
to the create workspace
command, otherwise the workspace will not execute the git commands that initiates the git repo + commits the files and directories. All commands should now also work with a workspace that is not a git repo.
The :auto-add
setting was already set to false
by default, so I haven't touched that.
Describe the bug A clear and concise description of what the bug is.
Ran
poly create
on an existing repository and poly created a commit automatically. That commit had a lot of extra files that would never reach git.To Reproduce Steps to reproduce the behavior:
Expected behavior
I would like poly to allow me to commit instead of auto-comitting by default. I believe the behaviour could be to OPT-IN for auto-commit via a cli parameter.
I also noticed that poly create will overwrite any files that happen to match what it creates. You lose un-committed changes. It happened with deps.edn and .gitignore.
Additional context
I did
git reset --soft