beanshell / beanshell

Beanshell scripting language
Apache License 2.0
815 stars 183 forks source link

Request to fix broken original author info... #750

Closed patniemeyer closed 5 months ago

patniemeyer commented 5 months ago

Hi everyone - I’m Pat Niemeyer, the original author of BeanShell from way back. I apologize in advance for asking this since it’s an especially annoying request, but I have figured out why Github doesn’t associate me with the project as an author/contributor. When @nickl- did the initial import of the code from the old SVN repository, the author email got mangled with some kind of uid suffix, so GitHub can’t find the author to link.

Unfortunately the only way to fix this is to do some surgery on that commit with git filter branch and force push the change. I even pinged GitHub support to see if they had any ideas on a less invasive way but that is all they could come up with.

I recognize that doing this would mess with working copies that developers have cloned locally and would be a major inconvenience for them, but if there is a time in the future when we could fix this I would greatly appreciate it. I am active on Github and it would be nice to be associated with this project that I spent so much time on in years past :)

For reference, this is the raw commit info that shows the broken email: https://github.com/beanshell/beanshell/commit/c4fc63a1e39e0637ac17090e4f27c0aec95cc2b9.patch

And this is a suggested script that should fix it.

# Clone a bare copy of the repo
git clone --bare https://github.com/<username>/<reponame>.git
cd <reponame>.git

# Fix up the broken email
git filter-branch --env-filter '
BAD_EMAIL="patniemeyer@gmail.com@934af587-6f8e-29cc-0aa7-85b2284b99e2"
CORRECT_EMAIL="patniemeyer@gmail.com"
if [ "$GIT_AUTHOR_EMAIL" = "$BAD_EMAIL" ]; then
    export GIT_AUTHOR_EMAIL="$CORRECT_EMAIL"
fi
' --tag-name-filter cat -- --branches --tags

# Double check that it went well and then:
# git push --force --tags origin 'refs/heads/*'
nickl- commented 5 months ago

I don't see a problem with this @patniemeyer, you should have the privileges go ahead and make the changes.

nickl- commented 5 months ago

Please note there are some new PRs merged since my previous comment so pull fresh HEAD before making changes.

patniemeyer commented 5 months ago

Ok! This is done. I diff'd the results before pushing and the change looks right. I'll save the old bare repo for a while in case there are any issues with the push.

Sorry for any inconvenience this causes anyone working on the project. Thanks!

nickl- commented 5 months ago

I also have a backup so we have our bases covered. Glad this could be resolved.

opeongo commented 4 months ago

I recognize that doing this would mess with working copies that developers have cloned locally and would be a major inconvenience for them

Could you provide a bit more information about what this means?

I have a local copy of the repository and I just did a pull from origin/master and many branches got forced updates. Are there some steps that I need to take to resolve this before I mess things up further? What will happen to my outstanding pull requests?

opeongo commented 4 months ago

I just tried to push a branch up to origin, but it is both 1000 commits ahead and behind master. What steps I need to take to correct this?

opeongo commented 4 months ago

Never mind, I learned some git-fu. Created a new branch from the new master at a commit prior to my work and then cherry-picked in to it.

nickl- commented 4 months ago

Sounds about right

patniemeyer commented 4 months ago

@opeongo Thank you for doing that. I am sorry for the disruption. The approach you took with cherry-picking is the most general way to do this, however (for anyone else who might be in this situation) you might also be able to just diff your branch and then apply the patch to the new branch:

# in the old repo
git diff [start of branch] > some.patch
# in the new repo
git apply some.patch

Again, I appreciate your taking the time to migrate your work.