#590 Is --release argument really needed when working on local Git repo?
Opened by oturpe. Modified

For Fedora packages using rpmautospec,
development can only happen inside a Git repository.
This means that even new packages
that do not have a Fedora Package Sources repository yet
must be developed inside some repository.
Currently, attempting to do that in the most obvious way
produces errors from fedpkg:

$ git init -b rawhide new-package && cd new-package
rawhide $ nano new-package-spec # write a working specfile
rawhide $ fedpkg mockbuild
sources file doesn't exist. Source files download skipped.
Failed to get repository name from Git url or pushurl
Failed to get ns from Git url or pushurl
Could not execute mockbuild: Unable to find remote branch. Use --release
If current branch has to track a remote branch, fix it with command:
    git branch -u origin/rawhide

The error message in itself is good,
and indeed using --release rawhide makes this work.
However, I am left wondering,
it is really necessary to have a remote tracking branch for local development?
Mockbuild and many other commands actually never access the remote branch,
so it seems unnecessary to insist on having it configured.

As for the obvious reply "why don't you just set the --release argument?",
the background for this issue is the ongoing process
of making Fedora Package Maintainer Docs
as approachable as possible to new contributors.
Getting rid of extra arguments does help.

I did some experiments,
and it seems that the commands listed above would complete successfully,
if calculation of property Commands.branch_merge was relaxed somewhat:
If a remote tracking branch is not found,
the local branch name is used as a fallback.
Alternatively, the existing property could be left as it is
(so that existing usage that really needs the remote branch name will not break),
and a new property branch_name could be introduced
with the definition given above.

Before proceeding with a complete pull request,
I would like to get some feedback on this idea.
Somehow, I have a feeling that I may be missing something here.


I could not find any mailing list or such for general discussion,
so I assume general discussion like this
can happen in the issue tracker.

I know this is an old issue, but... --release is necessary so mockbuild can choose the correct root configuration to build the package.

Without --release (or a branch name that identifies the release), how will it know whether to run the build using mock -r fedora-rawhide-x86_64, mock -r fedora-43-x86_64, mock -r fedora-42-x86_64, or some other appropriate configuration?

Unless we wanted to define a particular --release argument as the default, but... that feels like a bad idea that could potentially confuse things rather than make them clearer. (And how do we choose? Should rawhide be the default? Or should the current host release be the default, so that a mockbuild by default is roughly akin to a local build, but with sandboxed dependencies?)

It's helping newer packagers if the documentation forces them into the mindset that they always need to be aware which release they're building a package for, when they run a build. At least IMHO.

Metadata