ParkenDD / ParkAPI2

Rewrite of `offenesdresden/ParkAPI` with Django
MIT License
3 stars 0 forks source link

data-sources as git submodule(s) #12

Closed defgsus closed 2 years ago

defgsus commented 2 years ago

Mhh. I don't have experience with git submodule yet.

git submodule status prints 1ebdca71d43e075ee0d4326013a7218ea4edcfe5 web/scrapers/ParkAPI2_sources (heads/master)

and the .gitmodules file does not mention a particular commit. I guessed it would always point to the latest commit on the default branch.

I've done a small change to ParkAPI2-sources just to see what happens. If you run

git submodule update --remote

in the ParkAPI2 it will pull the newest commit of the submodule. But it actually creates a change in the ParkAPI2 repo that needs to be committed. How can we fix that? Any idea?

jklmnn commented 2 years ago

Okay, I just took a look and it seems we have to live with the change here. I think it's fine to have this change and just include it (as a separate commit) into new features. The downsides are that we may have to keep a rebase order if we have multiple contributions at a time and that external contributers may just include this change unknowingly into one of their commits. There seems to be GitSlave to solve that kind of problem however I couldn't find it in the Debian repos so I'd say it's a bit of an obscure dependency just to correctly check out the repository.

The only change I'd suggest is that you pin the branch of the submodule with

git submodule set-branch -b <branch> <path_to_submodule>

so that we can be sure that --remote will always fetch the head of our intended branch.

defgsus commented 2 years ago

Yeah, i did some reading as well. The submodule feature does not really fit our purpose and yes, there is a couple of other tools or scripts that try to solve the problem but i don't want that dependencies.

The only change I'd suggest is that you pin the branch of the submodule with

git submodule set-branch -b <branch> <path_to_submodule>

so that we can be sure that --remote will always fetch the head of our intended branch.

Mhh, the set-branch is a newer git feature not available on my local git 2.17.1 but i used

git config -f .gitmodules submodule.web/scrapers/ParkAPI2_sources.branch master

which possibly has the same effect (it puts a branch = master in the .gitmodules file)