-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Function to parse author and committer information from environment #3751
Comments
(Function to parse author and committer information from environment)
Use GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL if available (or GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL) Fall back to EMAIL if GIT_AUTHOR_EMAIL/GIT_COMMITTER_EMAIL is not available Use the default user info (user.name, user.email) as last resorts. Return GIT_ENOTFOUND if we don't have enough info for a signature
Use GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL if available (or GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL) Fall back to EMAIL if GIT_AUTHOR_EMAIL/GIT_COMMITTER_EMAIL is not available Use the default user info (user.name, user.email) as last resorts. Return GIT_ENOTFOUND if we don't have enough info for a signature
Use GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL if available (or GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL) Fall back to EMAIL if GIT_AUTHOR_EMAIL/GIT_COMMITTER_EMAIL is not available Use the default user info (user.name, user.email) as last resorts. Return GIT_ENOTFOUND if we don't have enough info for a signature
Is this issue still not resolved, I'd like to work on this issue seems achievable to me. Let me know. |
I think that it's not, you're welcome to it @venkatesh-coder |
Thanks @ethomson, I will try my best. I will ask questions if I need more clarification. |
as @joshtriplett mentioned, I created functions
|
When creating an action signature (e.g. for a commit author and committer) read the following environment variables that can override the configuration options: * `GIT_AUTHOR_NAME` is the human-readable name in the "author" field. * `GIT_AUTHOR_EMAIL` is the email for the "author" field. * `GIT_AUTHOR_DATE` is the timestamp used for the "author" field. * `GIT_COMMITTER_NAME` sets the human name for the "committer" field. * `GIT_COMMITTER_EMAIL` is the email address for the "committer" field. * `GIT_COMMITTER_DATE` is used for the timestamp in the "committer" field. * `EMAIL` is the fallback email address in case the user.email configuration value isn't set. If this isn't set, Git falls back to the system user and host names. This is taken from the git documentation chapter "10.8 Environment Variables": https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables This PR adds support for reading these environment variables by adding two new functions `git_signature_default_author` and `git_signature_default_committer` and deprecates the `git_signature_default` function. Fixes: libgit2#3751 Prior work: * libgit2#4409 * libgit2#5479 * libgit2#6290
When creating an action signature (e.g. for a commit author and committer) read the following environment variables that can override the configuration options: * `GIT_AUTHOR_NAME` is the human-readable name in the "author" field. * `GIT_AUTHOR_EMAIL` is the email for the "author" field. * `GIT_AUTHOR_DATE` is the timestamp used for the "author" field. * `GIT_COMMITTER_NAME` sets the human name for the "committer" field. * `GIT_COMMITTER_EMAIL` is the email address for the "committer" field. * `GIT_COMMITTER_DATE` is used for the timestamp in the "committer" field. * `EMAIL` is the fallback email address in case the user.email configuration value isn't set. If this isn't set, Git falls back to the system user and host names. This is taken from the git documentation chapter "10.8 Environment Variables": https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables This PR adds support for reading these environment variables by adding two new functions `git_signature_default_author` and `git_signature_default_committer` and deprecates the `git_signature_default` function. Fixes: libgit2#3751 Prior work: * libgit2#4409 * libgit2#5479 * libgit2#6290
git_signature_default
parses theuser.name
anduser.email
values fromgit_config
, but does not allow for other sources of that information. Perman git-commit-tree
:While the existing behavior of
git_signature_default
should likely not change to take environment variables into account, I'd suggest adding agit_signature_author_env
andgit_signature_committer_env
that do. Those would be the appropriate defaults to pass when creating a commit, for any program mimicking the git command-line tools.The text was updated successfully, but these errors were encountered: