This message was deleted.
# opal
s
This message was deleted.
o
If I’m not mistaken HEAD doesn’t apply when you do an initial clone of a repository, and the idea is that you explicitly clone a specific branch (As opposed to the whole repo) Also when @Asaf Cohen and I started OPAL - it was before the main vs master debate became prominent.
a
I see you’re doing
git clone -v --branch=<name> <URL>
and I think you should do
git clone -v --depth 1 <URL>
because this also implies
--single-branch
and defaults to the remote’s HEAD. So you don’t have to worry whether that’s master or main. I would consider adding
--shallow-submodules
as well. Incase the users are creating some sort of submodule hell for themselves. At least you’ll limit the pull to the smallest size.
You still want to enable users to switch branches… so I suppose you would add
--branch=<name>
but you might have to have some logic to decide if the ENV var is not
null
and yes, HEAD wouldn’t work for clone. Not substituted into the
--branch=HEAD
command. That would fail.
o
These are good points. @Asaf Cohen, @Ro'e Katz - WDYT ?
a
Will this create a backwards incompatible change with users who are using master as the default? 🤔 I think so.
o
I think that can be mitigated by having another config value that forces a branch.
a
Well, if I already have OPAL deployed in production and have not set a branch manually. It will be defaulting to master. If I update OPAL without modifying the environment then it may switch to another branch.
Either way. I’m pro-making this change. OPAL isn’t 1.0 yet. So by SemVer standards, it’s alright. 👍🏻
😊 1
o
Let’s wait for tomorrow for the rest of the gang to chime in 🙂