This is an archive of the discontinued LLVM Phabricator instance.

[utils] Give git a dummy email address when cherry picking.
ClosedPublic

Authored by rsundahl on Mar 23 2023, 8:52 AM.

Details

Summary

Git wants an email address these days. (Also a nit typo.)

Diff Detail

Event Timeline

rsundahl created this revision.Mar 23 2023, 8:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2023, 8:52 AM
rsundahl requested review of this revision.Mar 23 2023, 8:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 23 2023, 8:52 AM
rsundahl edited the summary of this revision. (Show Details)Mar 23 2023, 8:59 AM
thetruestblue added a comment.EditedMar 23 2023, 9:29 PM

This is fine... feels a little off.
Is there a script to run the docker container? Couldn't we bring it in there or when we build it?

I don't know use case for docker here. Just for tests? Or are we actually using these scripts for a dev environment we might push? Because in that case this feels wrong.

This is fine... feels a little off.
Is there a script to run the docker container? Couldn't we bring it in there or when we build it?

I don't know use case for docker here. Just for tests? Or are we actually using these scripts for a dev environment we might push? Because in that case this feels wrong.

No, it's just a new requirement that doesn't matter when it's being anonymously built in Docker. (This is only a utility function for those interested in Docker builds.)

Why we need a dummy address? Did you met any issues?

Can you just do

git cherry-pick -n

aka no commit? shouldn't require an email?

Can you just do

git cherry-pick -n

aka no commit? shouldn't require an email?

I don't need an email address.

$ git cherry-pick -n 6c6a905363debe5fc07f44e97d0f9c9308f7db64    // no email settings, no errors
$ git --version
git version 2.20.1

Maybe, this issue is from a certain git version.

XiaodongLoong accepted this revision.Mar 30 2023, 11:22 PM
This revision is now accepted and ready to land.Mar 30 2023, 11:22 PM

Why we need a dummy address? Did you met any issues?

Yes. The cherry pick failed because git wanted an email address for the commit. Since the commit is an anonymous commit in a container, I chose to provide an anonymous email address.

Can you just do

git cherry-pick -n

aka no commit? shouldn't require an email?

It's true that adding -n will avoid the commit, but doing so would be a functional change (leaving uncommitted changes in the working directory). This might not matter but it's more appropriate to anonymize the email address (since it's an owner-less docker image) and keeping the functionality as it is.