-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --safe-directory flag #86
Comments
I had to lookup what this safe directory is doing:
is it possible the directory The issue with |
If the git repo can't be opened because of the `safe.directory` config a hint will be printed: > Could not open the git repository. > If run from docker set the right user id and group id. > E.g. `docker run -u \"$(id -u):$(id -g)\" -v \"$PWD:/tmp\" --workdir /tmp --rm convco/convco` Refs: #86
#88 adds better error handling for this case. If it occurs you will see this in the stderr output:
|
If the git repo can't be opened because of the `safe.directory` config a hint will be printed: > Could not open the git repository. > If run from docker set the right user id and group id. > E.g. `docker run -u \"$(id -u):$(id -g)\" -v \"$PWD:/tmp\" --workdir /tmp --rm convco/convco` Refs: #86
Is your feature request related to a problem? Please describe.
My team has been struggling to get the newest release (0.3.12) to work inside of a Jenkins environment, that then launches the convco container with docker.
Running this command:
docker run -v "$PWD:/tmp" --workdir /tmp --rm convco
We have been seeing the error:
Error: Git(Error { code: -3, klass: 7, message: "config value 'safe.directory' was not found" })
While this would regularly be overcome easily with the command
git config --add safe.directory *
, this is unfortunately not an option for the docker container as far as we have figured out.Describe the solution you'd like
I would like an easy way to add a safe-directory. I believe this could be achieved with convco updating the configuration of git, and therefore suggest adding an optional flag that would temporarily add a specified safe directory.
Describe alternatives you've considered
Our workaround to this was to create a gitconfig file, and mount that as a volume.
Working command:
docker run --rm -v "$PWD:/tmp" -v "$PWD/gitconfig:/etc/gitconfig" -w /tmp convco version
Additional context
If this is not possible for the time being, a note in the README indicating this workaround would be nice.
The text was updated successfully, but these errors were encountered: