using source-branch and source-tag not possible but no explanation in help why this is the case
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
trying to build a kernel snap from a certain tag and branch results in the following error:
Sorry, an error occurred in Snapcraft:
Failed to pull source: cannot specify both 'source-branch' and 'source-tag' for a git source.
See `snapcraft help sources` for more information.
looking at "snapcraft help sources" does not explain that these two are mutually exlusive in any way:
...
- source-branch: <branch-name>
Snapcraft will checkout a specific branch from the source tree. This
only works on multi-branch repositories from git and hg (mercurial).
...
- source-tag: <tag>
Snapcraft will checkout the specific tag from the source tree revision
control system.
...
they should either not be mutually exclusive (why are they at all) or there should be a proper hint in the help that one disables support for the other
IMHO I think this is not a snapcraft bug, just a misunderstanding of how git + commits work. For a given repo at a given point in time, a branch points at a single, specific commit. So if you specify a commit and a branch, that only resolves unambiguously if you specify the same commit as what the branch is currently pointing to. I think they are mutually exclusive for snapcraft since if you specify both a branch and a commit, it's either redundant or ambiguous.