Closed endorama closed 1 month ago
To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.
This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.
We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.
Thanks for your understanding and cooperation!
To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.
This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.
We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.
Thanks for your understanding and cooperation!
I am considering making a PR to add support for GIT_AUTHOR_NAME
and GIT_AUTHOR_EMAIL
environment variables. Could someone give me feedback on (a) whether this would be appreciated, and (b) whether you agree that ConfigScoped
(in repository.go
) would be the right place to do this?
Just to clarify: my use case is that I want to use argocd-autopilot to bootstrap a Bitbucket repo. When using token-based authentication, Bitbucket requires committing using a special git author email address, and currently I have no way of passing that (other than setting XDG_CONFIG_HOME
to a special folder that is only used for argocd-autopilot, but that's an ugly workaround IMHO :) The relevant call in argocd-bootstrap is:
That's why I want to add it in ConfigScoped
.
I'm using
go-git
through a project and faced this error:[...]: author field is required
.In my Git configuration I do not specify the
user.email
field; here is the excerpt:This configuration forces to set
user.email
setting for each repo.I went on debugging this:
loadConfigAuthorAndCommitter
is called byCommitOptions.Validate()
, executed as first step inWorktree.Commit()
https://github.com/go-git/go-git/blob/99457e570d34320b12fb4fcd0f054f3d0b1d3eec/worktree_commit.go#L21-L24loadConfigAuthorAndCommitter
function first step is to load the system configurations: https://github.com/go-git/go-git/blob/99457e570d34320b12fb4fcd0f054f3d0b1d3eec/options.go#L476This behaviour seems to contradicts the
git
documentation about Environment variables. UnderCommitting
in Git Internals Environment variables is written:(Incidentally these variables include
GIT_AUTHOR_NAME
andGIT_AUTHOR_EMAIL
, which should override any file based configuration and I tried using to overcome the mentioned error).Expected behaviour:
go-git
follows git behaviour and respects environment variables at commit time, not relying only on file based configurationsBy looking at other issues I noticed aligning with what git does is important, so I would contribute a PR to change this behaviour by loading specified environment variables in
loadConfigAuthorAndCommitter
before system configuration and configuring author and committer accordingly to what git docs say.