Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a git submodule instead of squashing commits #124

Closed
x-hgg-x opened this issue Sep 15, 2022 · 3 comments
Closed

Use a git submodule instead of squashing commits #124

x-hgg-x opened this issue Sep 15, 2022 · 3 comments

Comments

@x-hgg-x
Copy link
Contributor

x-hgg-x commented Sep 15, 2022

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
@Kijewski
Copy link
Owner

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

@x-hgg-x
Copy link
Contributor Author

x-hgg-x commented Sep 15, 2022

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
Copy link
Contributor Author

x-hgg-x commented Sep 25, 2022

Implemented in #127.

@x-hgg-x x-hgg-x closed this as completed Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants