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

Support git module with both branch and ref specified #216

Open
ekohl opened this issue Apr 11, 2023 · 2 comments
Open

Support git module with both branch and ref specified #216

ekohl opened this issue Apr 11, 2023 · 2 comments

Comments

@ekohl
Copy link

ekohl commented Apr 11, 2023

This is what puppetfile-updater generates and it makes sense. For reproducible builds you want to pin to a specific commit, but sometimes that's not on the default branch so it can help to specify the branch to generate the correct refspec.

I see there is an explicit test for this case (https://github.com/xorpaul/g10k/blob/master/tests/TestReadPuppetfileConflictingGitAttributesRef) so that does imply it's explicitly chose, but I'm not sure it really is invalid.

@xorpaul
Copy link
Owner

xorpaul commented Apr 19, 2023

Hmm, are you saying specifying a commit hash can not be unique in a git repository? Because that would be news to me.

Or what do you want to archive by specifying the branch and a commit hash of a Puppet module repository?

@ekohl
Copy link
Author

ekohl commented Apr 19, 2023

Hmm, are you saying specifying a commit hash can not be unique in a git repository? Because that would be news to me.

No, that's not what I'm saying

Or what do you want to archive by specifying the branch and a commit hash of a Puppet module repository?

Updating is easier: if you know it which branch it came from then you can easily check if there are new commits. A commit hash can belong to multiple branches, so it's hard to figure out.

Another thing you can consider is the fetch spec. The default is something like fetch = +refs/heads/*:refs/remotes/origin/* but if you know the branch you can use fetch = +refs/heads/master:refs/remotes/origin/master and only retrieve that single branch. That can save bandwidth and make cloning faster when there are a lot of branches.

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