tzdb
tzdb copied to clipboard
Use a git submodule instead of squashing commits
I cannot make a PR since this needs two branches, one of which is a squashed branch: https://github.com/x-hgg-x/tzdb/tree/generated https://github.com/x-hgg-x/tzdb/tree/v0.5.x
Steps to reproduce:
- Create a new
generated
branch with only the generated data, and squash the branch to leave only one commit, then push it on Github. - Switch to the main branch, delete the
src/generated
folder and commit, then run the commandgit submodule add -f -b generated -- ./ src/generated
.
After modifying the generated data, we can then do the following :
cd src/generated
git checkout generated
git add .
git commit --amend --no-edit # Don't keep history for the generated files
git push
cd ../..
git add src/generated
git commit -m 'update'
git push
That's a good idea! Especially because my current squashing workflow breaks git blame
. I will use a submodule for future commits
~It seems that Cargo cannot update the submodule when using a git dependency in Cargo.toml
(rust-lang/cargo#7992).~
Fixed in rust-lang/cargo#11106.
Implemented in #127.