Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

bff still references master branch #28

Open
kuannie1 opened this issue Sep 3, 2020 · 2 comments
Open

bff still references master branch #28

kuannie1 opened this issue Sep 3, 2020 · 2 comments

Comments

@kuannie1
Copy link
Contributor

kuannie1 commented Sep 3, 2020

No description provided.

@mbarrien
Copy link

mbarrien commented Sep 3, 2020

To elaborate a bit more, there are hard coded references to master branch at https://github.com/chanzuckerberg/bff/blob/401caa5500365de3e2db24d78363fae0b6f6a246/pkg/util/git.go and
https://github.com/chanzuckerberg/bff/blob/a2aecc4a3d2fe807e23e20a2af16c99dfbb2f3ba/cmd/bump.go which need to be made configurable for a default branch name that doesn't match master.

In theory this could be extractable by git symbolic-ref refs/remotes/origin/HEAD (which reads the file .git/refs/remotes/origin/HEAD), but unfortunately if you change the default branch in GitHub, a git fetch/git pull doesn't update the default branch in that file (verified this behavior by running this). A user may need to manually reset it by running something like git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main.

Either being able to read that file (and documenting what the user needs to do to reset the default branch), or allowing a config file/env var to supply the the default branch would be useful.

References:
https://stackoverflow.com/questions/45811971/warning-ignoring-broken-ref-refs-remotes-origin-head
https://stackoverflow.com/questions/18726037/what-determines-default-branch-after-git-clone

@mbarrien
Copy link

https://stackoverflow.com/questions/51274430/change-from-master-to-a-new-default-branch-git says that git remote set-head origin -a will update the HEAD reference if the master changes, and I tested that this works. Take that into account in any documentation/code changes to support this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants