KordingLab / llm4papers

Apache License 2.0
22 stars 0 forks source link

Improvements to OverleafGitPaperRemote #25

Closed wrongu closed 1 year ago

wrongu commented 1 year ago

Motivation for this is to address #19 for OverleafGitPaperRemote by making use of the revision_id field of the edits.

Along the way I also added some tests, including one that essentially gets at the race-condition of #19.

Including some fancy syntax which may or may not be considered good design:

# this now happens in OverleafGitPaperRemote.perform_edit:
with paper.rewind(commit_id, message="applying some edits") as old_paper:
    old_paper._perform_replace(edit)

...and the git history-handling is done when the with block exits

wrongu commented 1 year ago

Note: tests pass locally on my machine... The tests are failing in GitHub Actions for strange git reasons, maybe having to do with the fact that there is no user.name configured.

Or maybe there is some difference between repo.index.commit (appears to work) and repo.git.commit (appears to be the source of the failing test).