airr-community / ogrdb

Website and associated database for managing submissions of inferred alleles
Other
8 stars 1 forks source link

add airr-standards as a submodule #91

Closed schristley closed 3 years ago

schristley commented 3 years ago

@williamdlees Officially started! This PR makes the AIRR schema (actually the whole airr-standards repository) available in the airr-standards directory as a git submodule. As submodules have some peculiarities, let me mention a few things. For one, this means you will need to do some additional commands after a git clone to initialize any submodules, however make sure to checkout the appropriate OGRDB branch first.

git clone https://github.com/airr-community/ogrdb.git
cd ogrdb
git checkout airr-standards
git submodule update --init --recursive
cd airr-standards
git checkout germline-schema

The airr-standards is essentially a git clone of the airr-standards repository, so you can make changes and commit them, and you can change the branch like above. Do a git status while your pwd is in the airr-standards folder, and you will see the changes. At the top level OGRDB directory, git doesn't know about changes inside the submodule, only that it's changed, for example:

[ogrdb]$ git status
On branch airr-standards
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   airr-standards (new commits)

no changes added to commit (use "git add" and/or "git commit -a")

Thus you commit the submodule as a whole like so:

git add airr-standards
git commit -m "new stuff"

I've committed the HEAD of the germline-schema branch, but when you clone and init, it will not show that branch when you do git status, instead it will show something like this:

[airr-standards]$ git status
HEAD detached at 595ca38
nothing to commit, working tree clean

Which shows that the OGRDB git doesn't know anything about the branches, it just points to a specific commit (595ca38 in this case). But change the branch and you can pull the latest changes. When it comes to release time, you can fix airr-standards to a specific version by checking out a tag, git checkout v1.3.1

I've been browsing the code, and studying build_from_schema.py, but I've only made some superficial commits.