jupyterhub / nbgitpuller

Jupyter server extension to sync a git repository one-way to a local path
https://nbgitpuller.readthedocs.io
BSD 3-Clause "New" or "Revised" License
205 stars 84 forks source link

Fix regression: can't reset some files anymore #264

Closed jdmansour closed 2 years ago

jdmansour commented 2 years ago

Hi, unfortunately my recent pull request introduced another bug. Under some circumstances, you can't reset a file by deleting and pulling anymore. It happens when you:

The result is that it will get the file from the local branch, not the remote branch, so it is reset to an old version from the student.

When resetting, I changed git checkout back to use origin/{branch_name}. The merge afterwards did not always do the right thing. We still have to deal with the case that a file has been deleted upstream. For that, I just check if that is the case and then skip the file.

I've also added a fix for a related bug that I noticed at the same time. It happens when you delete the file remotely and edit it locally.

jdmansour commented 2 years ago

Thanks, yes as far as I'm concerned it is ready for review!

yuvipanda commented 2 years ago

Thanks a lot, @jdmansour! Do you think we should make a release after this?

I'd also love to invite you to be a co-maintainer on this project! Is that something you would be interested in? :D

jdmansour commented 2 years ago

Hi @yuvipanda, sorry, I missed this. Yeah I guess a release would be good, since the previous one had a regression. But I have one more patch in the pipeline that can handle conflicted branches. Maybe after that?

And yes I could imagine being a co-maintainer. But I'm not familiar with your future plans for nbgitpuller and co. Maybe we could get together and have a talk? My email is in my profile.