tzdb icon indicating copy to clipboard operation
tzdb copied to clipboard

Use a git submodule instead of squashing commits

Open x-hgg-x opened this issue 1 year ago • 2 comments

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 command git 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

x-hgg-x avatar Sep 15 '22 17:09 x-hgg-x

That's a good idea! Especially because my current squashing workflow breaks git blame. I will use a submodule for future commits

Kijewski avatar Sep 15 '22 17:09 Kijewski

~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.

x-hgg-x avatar Sep 15 '22 17:09 x-hgg-x

Implemented in #127.

x-hgg-x avatar Sep 25 '22 07:09 x-hgg-x