Closed marcodelapierre closed 1 month ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
pinging this one back as I think it should be discussed - should be a quick fix, if approved for action
@pditommaso @bentsherman @jordeu
Basically the AssetManager should be modified to accept both master
and main
as "default branch" names: https://github.com/nextflow-io/nextflow/blob/fe5bea992e2c0dd99a2f72388df386975c32c83a/modules/nextflow/src/main/groovy/nextflow/scm/AssetManager.groovy#L911-L915
is there a way to know what is the default branch of a repo?
is there a way to know what is the default branch of a repo?
The default branch concept do not exists on Git, it is a provider concept. I know that using Github API you can check which is the default branch.
Indeed https://stackoverflow.com/a/16501903/395921.
Very likely it's available also on BitBucket and GitLab
This just came up again, @Biowilko was asking if it was the case. I had totally forgotten about this issue and assured him that master
couldn't be hardcoded in the codebase 👀 (then I tried it myself)
We're hoping to move to using main
as the default branch name for all @nf-core repos soon, but will need to wait for this to be resolved first.
Is it solved by #4659?
Hey Phil, yep, at the moment any Nextflow git repo whose default branch is not master
should have it explicitly mentioned in the manifest for proper functionality:
manifest {
..
name = 'hello world'
description = 'Toy pipeline for simple Nextflow tests'
homePage = ' ... '
..
defaultBranch = 'main'
..
}
The most developed open PR to handle multiple git revisions is #5089.
With it, pipelines with non master default branch will not give an error.
However, there is still a corner case caveat (documented in the PR) where the default branch appears duplicated in the list of branches, both as DEFAULT
(or similar) and <defaultBranch name>
. This happens if the pipeline has previously been called both with no -r
/--revision
flag AND with -r <defaultBranch name>
. These two ways of calling the default branch may point to distinct commits over time; they can be reconciled by updating both to latest.
Possible approach to using git
to figure this out here: https://stackoverflow.com/questions/28666357/how-to-get-default-git-branch
https://github.com/nextflow-io/socks now has default branch main
, can use this for testing.
Smell bad 😆
Resolved by #5375
I have a github repo whose primary branch is called
main
instead ofmaster
, which is becoming increasingly common. Nextflow asks me to specify the branch with-r
:All good with
-r
:I suggest to enable Nextflow to look for both
master
andmain
branches.