-
Notifications
You must be signed in to change notification settings - Fork 59
Return values from environment for GIT_AUTHOR_* #20
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
base: master
Are you sure you want to change the base?
Conversation
|
I like this conceptually, git-deploy only cares that you set your username and E-Mail, but it shouldn't try to enforce one particular way of doing so when Git support multiple ways of doing it. But I thought hooking into the low-level config mechanism to support this was a bit hacky, so I wrote dc4541f as an alternative. Would that do what you wanted to do Rob, and does anyone else like that patch better? |
|
@avar That implementation looks fine to me; I didn't care for the "special case" nature of my patch, but I just wanted to get it done. I considered using |
|
@demerphq The reason I use an environment variable instead of git-config is because I have all of my dotfiles in a Git repository, but I want commits made at work to show up with my work e-mail, and commits made for personal projects to show up with my personal e-mail. I could use Git's include configuration feature, but this is relatively new and not available in some versions of Git (like some boxes we have at work). I think it makes sense for git-deploy to support the environment variables because Git itself does. |
|
@hoelzro Actually I can't even get this to work, I pushed an updated So it seems to me that this whole approach is inherently broken until such time as git-tag itself is patched to accept these environment values. Otherwise all the stuff git-deploy will create on your behalf won't have this author info. |
|
@avar Shouldn't you be grepping for 'Tagger' rather than 'Author' in |
|
@hoelzro I got the grep wrong but it doesn't set the tagger either, see my reply in the git mailing list thread. |
|
I see; that makes sense. I set GIT_COMMITTER_* in my environment as well; is there a way we can get git-deploy to pick those up? |
|
@hoelzro It picks up GIT_COMMITTER_{NAME,EMAIL}, but then this is getting a bit tricky. With just user.{name,email} set in the config we could guarantee that everything we have for both commits and tags had the right info. With the env vars you have to ensure that all of GIT_{AUTHOR,COMMITTER}_{NAME,EMAIL} are set, and maybe we should even check that they're all set to the same thing. Maybe you could hack up the WIP patch I had with the tests to do something like that? |
Some Git users, like myself, prefer to manage the username and e-mail address that Git sees in the environment.
git-deploydoes not currently respect this; it simply complains thatuser.nameanduser.emailare not set. This pull request adds the ability to consult the environment variables for those settings.