Bug 436739

Summary: kdesrc-build fails to update packages that don't have a "master" branch
Product: [Developer tools] kdesrc-build Reporter: Alex <alex765>
Component: generalAssignee: Michael Pyne <mpyne>
Status: RESOLVED FIXED    
Severity: normal CC: justin.zobel, nate
Priority: NOR    
Version First Reported In: Git   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Alex 2021-05-07 16:18:20 UTC
One example: https://invent.kde.org/network/tok

This project uses "dev" as its default branch. So, if you try to kdesrc-build it, there is this output:

Error updating tok, removing from list of packages to build.
 > tok build was requested, but it has no source code at the requested git branch
Comment 1 Michael Pyne 2022-07-08 00:56:37 UTC
Git commit f1d429d147f8ec0240e6ac0f6ab2eec797a6c4dd by Michael Pyne.
Committed on 08/07/2022 at 00:52.
Pushed by mpyne into branch 'master'.

git: Don't fail to clone due to branch name if none required.

There is a wider variety of potential default branch names from a git
repository that we might want to clone.  Many use now 'main' but not all
of them. We also have modules that use something else entirely, like
'dev' (as reported in bug 436739).

Most of the time the user doesn't actually care about the branch, they
just want whatever the mainline trunk is. To handle this we had
previously defaulted to assuming the branch was 'master' so we could
optimize the amount of data transferred during initial clone.

Now this is likely to lead to an error. Instead, if the user hasn't
specified otherwise, just perform the git clone as normal.

To do this right there's a wee bit of other work elsewhere to detect
which branch head we actually got from the remote git repository but
that's not difficult to do either.

M  +21   -6    modules/ksb/Updater/Git.pm

https://invent.kde.org/sdk/kdesrc-build/commit/f1d429d147f8ec0240e6ac0f6ab2eec797a6c4dd