oceanhackweek / oceanhackweek.github.io

GitHub repo for the OceanHackweek website
https://oceanhackweek.org/
12 stars 38 forks source link

Verify setup for ohw-tutorials submodule #263

Open emiliom opened 1 year ago

emiliom commented 1 year ago

@abkfenris:

I'm copying your comment from https://github.com/oceanhackweek/oceanhackweek.github.io/pull/261#issuecomment-1650373948

The tutorials are linked via a git submodule which is defined here, but there is an incantation for adding them that I don't remember at the moment, but here is the PR when I set things up that way.

The .gitmodules setup seems straightforward. Once we have a tutorials OHW23 branch, we'll copy and adapt the ohw22 block to this:

[submodule "ohw23/tutorials"]
    path = ohw23/tutorials
    url = https://github.com/oceanhackweek/ohw-tutorials.git
    branch = OHW23

The incantation you referred to seems to be the

with:
    submodules: true

blocks in workflows/check_sphinx_build.yml and workflows/deploy-docs.yml. If so, it looks like nothing more needs to be done.

Does that look right?

abkfenris commented 1 year ago

I've added the OHW23 branch, but its currently pretty empty.

By incantation, I meant git submodules ... in the command line that sets up the .gitmodules entry and actually syncs it down (and updates it as we bring in new tutorials). I believe there is a bunch of info that gets added to .git/ to track the current commit, and .gitmodules is just for higher level info.

abkfenris commented 1 year ago

Thanks, tldr

➜
tldr git submodule

git submodule

Inspects, updates and manages submodules.
More information: <https://git-scm.com/docs/git-submodule>.

- Install a repository's specified submodules:
    git submodule update --init --recursive

- Add a Git repository as a submodule:
    git submodule add repository_url

- Add a Git repository as a submodule at the specified directory:
    git submodule add repository_url path/to/directory

- Update every submodule to its latest commit:
    git submodule foreach git pull

Or for a ore definitive source https://git-scm.com/book/en/v2/Git-Tools-Submodules

abkfenris commented 1 year ago

Or my shell history remembers last year git submodule add -b OHW22 https://github.com/oceanhackweek/ohw-tutorials.git ohw22/tutorials

emiliom commented 1 year ago

I've added the OHW23 branch, but its currently pretty empty.

Thanks!

By incantation, I meant git submodules ... in the command line that sets up the .gitmodules entry and actually syncs it down (and updates it as we bring in new tutorials). I believe there is a bunch of info that gets added to .git/ to track the current commit, and .gitmodules is just for higher level info.

So, we would run git submodule ... locally and push to the repo to make it work, or just if we want it to work locally? I don't think I follow. What exactly do we need to, where, and when?

emiliom commented 1 year ago

Or my shell history remembers last year git submodule add -b OHW22 https://github.com/oceanhackweek/ohw-tutorials.git ohw22/tutorials

:exploding_head: That's a long shell history! Great.

So, that's all we need to do, and just once? Should I run it locally, update the tutorials-index pages to OHW23 (to be a stub at this point), and push it to PR #261?

abkfenris commented 1 year ago

We'll also need to git submodule update ohw23/tutorials as they land to get them included, but the add only needs to happen once.