Open rbiswas4 opened 6 years ago
What is not clear to me is if I have to choose between
github + clone to personal machines + compile model
vsoverleaf
model. This has to do withdesc-tex
being used as a submodule on the git repository, but needs to removed for pushing to overleaf.
To use overleaf, you will need to direct-download desc-tex
rather than installing it as a submodule. This does not prevent you from working with the project locally with git or on github. It simply means that if you want any updated desc-tex
files, you'll need to download them yourself instead of relying on git or the Makefile to do it.
is it possible to not commit the pdf file, but have it autogenerated?
This is the default behavior. The pdf is never committed automatically.
To use overleaf, you will need to direct-download desc-tex rather than installing it as a submodule. This does not prevent you from working with the project locally with git or on github. It simply means that if you want any updated desc-tex files, you'll need to download them yourself instead of relying on git or the Makefile to do it.
OK. But here is my problem:
desc-tex
. So, it was installed as a sub-module. desc-tex
files for commit, and they are not on the github repository. However, even if I delete that desc-tex
directory, or even clone from the github in a different location (therefore not having the desc-tex
directory, I cannot push the repository to the remote overleaf repository.
git push overleaf master --force
Counting objects: 343, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (132/132), done.
Writing objects: 100% (343/343), 2.90 MiB | 1.51 MiB/s, done.
Total 343 (delta 204), reused 342 (delta 204)
remote: Resolving deltas: 100% (204/204)
remote: error: invalid git repo
remote:
remote: hint: Your Git repository contains a reference we cannot resolve.
remote: hint: If your project contains a Git submodule,
remote: hint: please remove it and try again.
To https://git.overleaf.com/16532000jqqzrstkkgst
! [remote rejected] master -> master (invalid git repo)
error: failed to push some refs to 'https://git.overleaf.com/16532000jqqzrstkkgst'
time[master]
Any advice or sugestions on this would be very useful!
This is the default behavior. The pdf is never committed automatically.
The default behavior is to not commit ... yes. But it is not autogenerated in the github either. ie. if a collaborator wants to look at the pdf, they have to clone the github repo and make the pdf themselves.
Look into the git help for submodule. You probably need to deinit the module. You may also need to delete the .gitmodules file to satisfy overleaf, even if it's empty.
I don't understand what you're looking for with the second issue. Are you expecting GitHub to compile the code for you when you push and then host the result? Because that isn't something it does. @drphilmarshall once had a way of using Travis to accomplish this excrutiatingly slowly, but it's since vanished. However, I have the non-Travis guts in the script below. It isn't integrated with start_paper, but should work with perhaps minor modifications.
#!/bin/bash
# q/d way of getting compiled products onto GitHub without saving their histories.
function parse_git_branch {
s=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1/' | tr -d ' '`
echo "$s"
}
current=$(parse_git_branch)
orphan=compiled
files=$(basename $(pwd)).pdf
message=upload
safe=safety
[ ${#files[@]} -ge 1 ] || {
echo "No files to upload."
exit
}
# because this process is destructive, make a copy of everything
mkdir $safe || exit $?
rm -f $safe/* # oh, the irony
cp -v $files $safe/
git checkout --orphan $orphan && \
git rm -rf . && \
git add $files && \
git commit -m "$message" && \
git push -f origin $orphan
git checkout $current
git branch -D $orphan
mv -v $safe/* .
rmdir $safe
Look into the git help for submodule. You probably need to deinit the module. You may also need to delete the .gitmodules file to satisfy overleaf, even if it's empty.
Yes ... I have tried those following instructions on the net (without understanding why etc.: so I will not be shocked if I did something wrong). But the thing that surprised me is that this was a problem even when I tried doing this from a freshly cloned repository.
Anyway, thanks for confirming that there is some submodule related issue I am missing, and I should hope to be able to fix this: that is quite useful to know :)
I don't understand what you're looking for with the second issue
You exactly pointed to what I was looking for. I know @drphilmarshall got the pdf to display (I thought using gh-pages) for example in the Observing Strategy white paper. This is also common in the LSST documents stored on github. For similar reasons, this is useful for DESC notes, as it is useful to point large groups of people to a pdf, rather than asking them to download and make the note. Will look at your script and try to understand what was supposed to happen.
Ok. I'm certainly not opposed to bringing this kind of functionality back in, so let me know how it goes.
In working with collaborators who wanted to use overleaf rather than set up latex on their own machines:
What is not clear to me is if I have to choose between
github + clone to personal machines + compile model
vsoverleaf
model. This has to do withdesc-tex
being used as a submodule on the git repository, but needs to removed for pushing to overleaf.