[Rpm-maint] [rpm-software-management/rpm] Don't error git based %autosetup when master branch does not exist (PR #2120)
Miro Hrončok
notifications at github.com
Fri Jul 8 09:21:47 UTC 2022
The master branch is not guaranteed to exist.
Consider this config:
$ git config --global init.defaultBranch main
In that case, %autosetup -S git(_am) failed with:
...
+ /usr/bin/git checkout rpm-build
Switched to branch 'rpm-build'
+ /usr/bin/git branch --set-upstream-to=master
fatal: the requested upstream branch 'master' does not exist
hint:
hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.
hint: Disable this message with "git config advice.setUpstreamFailure false"
error: Bad exit status from /var/tmp/rpm-tmp... (%prep)
This was added in 3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b,
the rationale was:
> Additionally it sets the
> "rpm-build" branch's upstream to "master", so that in the active work
> tree where the "rpm-build" is checked out, commands such as
> "git rebase -i" automatically have a default behavior that makes sense.
However, that is only useful if the master branch exists in the upstream tarball,
which is probably not very common (upstream tarballs are rarely git repos,
even when working from git archives).
Alternatively, if this feature is indeed needed,
the macro could check if it is on a git branch before calling `git init`
and use that branch here instead of master,
but I considered that too complex.
You can view, comment on, or merge this pull request online at:
https://github.com/rpm-software-management/rpm/pull/2120
-- Commit Summary --
* Don't error git based %autosetup when master branch does not exist
-- File Changes --
M macros.in (3)
-- Patch Links --
https://github.com/rpm-software-management/rpm/pull/2120.patch
https://github.com/rpm-software-management/rpm/pull/2120.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2120
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2120 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220708/75ad66de/attachment.html>
More information about the Rpm-maint
mailing list