eclipse-velocitas / vehicle-app-python-template

Vehicle App template for Python
Apache License 2.0
17 stars 26 forks source link

[Feature]: Task to configure Git name and email #208

Open eriksven opened 1 year ago

eriksven commented 1 year ago

Description

It would be nice to easily configure the name and the email address to be used as part of a commit. When I perform an initial commit in a DevContainer with the Git-integration of VSCode for a new project in a new copy of the Eclipse Velocitas Template, it fails because the name and the email address have not been configured in Git yet.

So the user needs to manually sets this, e.g., by executing

git config --global user.name "John Doe" git config --global user.email "john.doe@example.org"

Suggested Solution

Create a new task "Configure Git" which asks the user for a name and an email address and sets the git config accordingly.

Alternatives

Check during the boot of the container whether the name and email are set for Git. If it is not the case, ask the user for these values. The advantage would be that the user does not do be aware of the existence of the task and will not run into the described problem during the commit. However, I do not like this alternative because it may interrupt the boot process even in the unlikely case that the user does not want to perform any Git commits.

Additional Context

If you feel this is a useful addition, I would volunteer to try to build such a task.

kse3hi commented 1 year ago

Hi @eriksven, as alternative (or additional) environmental variables can be used. PR: https://github.com/eclipse-velocitas/devenv-devcontainer-setup/pull/45 - please check if this will be good alternative for you suggestion?

kse3hi commented 1 year ago

Hi @eriksven , please check the new behavior. To automatically apply your git name and email just create next local environmental variables: GIT_CONFIG_NAME=<git_name> GIT_CONFIG_EMAIL=<git_email>

Integration PR into the template: https://github.com/eclipse-velocitas/vehicle-app-python-template/pull/213