[Twisted-Python] the repository metadata of inevitability
Hi all, Right now we have an Git mirror which has bogus committer IDs for everybody. Eventually, this will become the actual real repository. Before that happens, for aesthetic reasons, I would like to fix the metadata in the mirror so that it accurately records the email address of the committer, ideally with an email address that's actually associated with their github account so the right little picture shows up :). I'll probably do this by using every committer's twistedmatrix.com <http://twistedmatrix.com/> email address, and they can either choose to associate that on Github (and Gravatar and Bitbucket or wherever) or not. Does anyone know how I would re-generate the mirror to fix this? I'd like to get it done soon before we slide further down the inexorable descent towards Git being the real upstream repository; having such a flag day after the migration seems untenable. Also: can anyone (probably only Tom Prince, unfortunately) with knowledge of how the buildbot works tell me if any of that configuration is going to need to be adjusted? Thanks! -glyph
Glyph <glyph@twistedmatrix.com> writes:
Does anyone know how I would re-generate the mirror to fix this?
You should be able to change the metadata in-place, and force-push a new repository (or delete and re-create?) Obviously, all the hashes are going to change if you change the author names. You'll want to look at "git filter-branch" and probably just --env-filter will be sufficient (and quite fast) for this use-case. Beware that you'll likely want to change both of GIT_AUTHOR_EMAIL *and* GIT_COMMITTER_EMAIL (they're probably the same, especially if this is a git-svn clone).
Also: can anyone (probably only Tom Prince, unfortunately) with knowledge of how the buildbot works tell me if any of that configuration is going to need to be adjusted?
I have done the above to a simple buildbot setup before, and I recall it being happy -- it usually exports a specific hash if I recall correctly. Of course, Twisted's setup is likely considerably more complex than mine was :) Cheers, meejah
On Jan 23, 2015, at 2:04 PM, meejah <meejah@meejah.ca> wrote:
Glyph <glyph@twistedmatrix.com> writes:
Does anyone know how I would re-generate the mirror to fix this?
You should be able to change the metadata in-place, and force-push a new repository (or delete and re-create?) Obviously, all the hashes are going to change if you change the author names.
You'll want to look at "git filter-branch" and probably just --env-filter will be sufficient (and quite fast) for this use-case.
Beware that you'll likely want to change both of GIT_AUTHOR_EMAIL *and* GIT_COMMITTER_EMAIL (they're probably the same, especially if this is a git-svn clone).
If I do this with filter-branch, though, that's going to break git-svn support entirely because the hashes won't match, right?
Also: can anyone (probably only Tom Prince, unfortunately) with knowledge of how the buildbot works tell me if any of that configuration is going to need to be adjusted?
I have done the above to a simple buildbot setup before, and I recall it being happy -- it usually exports a specific hash if I recall correctly. Of course, Twisted's setup is likely considerably more complex than mine was :)
<https://github.com/twisted-infra/twisted-buildbot-configuration/ <https://github.com/twisted-infra/twisted-buildbot-configuration/>> is available for your perusal if you want to find it out :). But yeah, it's Twisted's configuration specifically I'm asking about, since our frankenstein svn→git setup is both weird and rickety. The goal of the ongoing changes I'm referring to in my original message is to remove it. -glyph
Glyph <glyph@twistedmatrix.com> writes:
If I do this with filter-branch, though, that's going to break git-svn support entirely because the hashes won't match, right?
"Maybe". I haven't tried that. Certainly the hashes won't match, but the git-svn-id tags in the commit messages will still match. So, *could* plausibly work, but I don't recall if I ever tried additional pulls from svn after filter-branch (we were migrating wholesale to git in "one" step). Another way is to re-do the git-svn clone, but provide a svn->git mapping. You can do this with a program if they're "regular" (e.g. if you can just add "@twistedmatrix.com" to the SVN ids). Or you can provide an explicit file mapping SVN -> name + email. Not sure how long your clones take, but I know they can take a looooooong time, so might be worth trying the filter-branch way while-u-wait for a re-clone ;) Anyway, the option is --authors-prog to "git svn fetch" (or --authors-file I think if you do the static mapping way?) With the program, you get the SVN id as the only arg, and spit out "first last <email@example.com>" on stdout. I documented a bunch of my adventures in this regard (migrating a large SVN repo to Git) on my blog: https://meejah.ca/blog/migrating-svn-to-git Unfortunately, I can't simply release all my scripts for that, but I could "use it as inspiration" if any of those steps sound useful to Twisted.
<https://github.com/twisted-infra/twisted-buildbot-configuration/> is available for your perusal if you want to find it out :).
Okay, I'll take a look. -- meejah
On Jan 23, 2015, at 1:23 PM, Glyph <glyph@twistedmatrix.com> wrote:
... an email address that's actually associated with their github account so the right little picture shows up :) ...
HawkOwl showed me a neat trick. You can add your git-svn-generated committer ID as an email address to your github account, and you'll start getting credit for all your old commits. To get this ID, go into your git checkout and do something like: GIT_PAGER=cat git log --format=%ae -n 1 --author=glyph Except instead of "glyph" put your own name in there. (You can get this out of the github UI too but the only place I saw was in a tooltip which makes copying and pasting annoying.) Then go to https://github.com/settings/emails <https://github.com/settings/emails> and add paste the email into a box. Please be nice and only do this for your own committer ID, since obviously bbbe8e31-12d6-0310-92fd-ac37d47ddeeb isn't a domain that github can send verification messages to :-). -glyph
participants (2)
-
Glyph -
meejah