Jorl17 / sharelatex-git-integration-unofficial

Easily track your ShareLaTeX changes using git. One simple command to rule them all!
GNU General Public License v2.0
68 stars 13 forks source link

Support password-protected projects and self-hosted ShareLaTeX sites #2

Closed abelgomez closed 7 years ago

abelgomez commented 7 years ago

This PR includes the following changes:

abelgomez commented 7 years ago

If this PR is merged, the README.md file should be updated accordingly in the following sections:

Jorl17 commented 7 years ago

Hi! Thank you for your excellent work!

I am a bit busy at the moment, so I will look into this in the coming weekend (might make a couple of comments here and there through the remainder of the week).

I will take care of the changes to the README. I will also add you to the authors list on the main .py file (I will probably also add this project to PyPI). Do you have any particular e-mail you would like me to attach to the copyright notice?

One important note is that I might make some changes to retain backwards compatibility. I know of several people (back at my old university) who use this script and breaking backwards-compatibility is mostly a no-go. I'm also not very fond of adding dependencies on external libraries (for the same reason and the fact that some of these people are really not very tech-savvy and got "a friend of a friend to install this on their windows machines"), but I'll see what I can cook up.

Once again, thank you for your contribution! I'll check back in the weekend.

abelgomez commented 7 years ago

Ok, no problem!

Thank you for including me in the copyright notice, I was not expecting any additional credit for my contribution. Regarding the e-mail, if it's possible, I'd prefer if you just include the URL of my GitHub profile (https://github.com/abelgomez) instead of an e-mail. I change my public e-mail quite often.

With respect to the backwards compatibility, I thought that removing the .sharelatex-git file and executing the script again with the needed parameters was not a big deal, and helped to maintain the code clean 😄.

Anyway, if this is a big issue, I can take charge of implementing the code to migrate files from the the old format to the new format automatically when needed.

Regarding the dependencies, to be fair, I didn't think on them. For sure the install script can be improved to take care of them if needed.

Let me know anything you may need from me!

abelgomez commented 7 years ago

In the latest commits, I have added a few fixes and I added support for the automatic migration of old-style .sharelatex-git files. Now all the modifications are backwards compatible.

Regarding the dependencies, I'll let you decide :)

FYI: the only additional dependencies are requests and bs4, both available via pip. The first one is used to easily maintain HTTP sessions, needed for sites requiring authentication. The second one is used to easily parse the downloaded webpages (for example, to get the CSRF token, needed in the post message).

Jorl17 commented 7 years ago

Hi! I have not forgotten about this. In the coming days I'll accept your excellent pull request with a couple of changes (mostly code-level changes, with the output being the same). I've just been a bit lazy about editing the README.

Thank you once again for your excellent work! :)

Jorl17 commented 7 years ago

I have merged this PR and made the necessary adjustments to the README. If you have any issues, do say! I'm closing the PR for now.

Once again, thank you for your work! :)

abelgomez commented 7 years ago

Perfect! Many thanks!

BTW, I've found a small inconsistency here, where it's still stated that user/password is not supported.

Since this is already done, maybe I can find some time to implement the push to sharelatex if you think it's worth.

Cheers!

Jorl17 commented 7 years ago

Done in 4ff7177d13bf9deaf15511598a306fba12d3a0a2 :) Thanks!

I had already started some work on push support, but that was about a year ago. Have a shot at it if you have time, then, please.

Cheers!

abelgomez commented 7 years ago

I'll let you know in that case!