[Rpm-maint] [rpm-software-management/rpm] Revert branch creation in %autosetup -S git (PR #2154)

Michal Domonkos notifications at github.com
Thu Aug 18 08:47:50 UTC 2022


The "master" branch is not guaranteed to exist after repo initialization
in the %__scm_setup_git macro as it can be configured differently on the
system, for example:

    git config --global init.defaultBranch main

In such a case, the macro would fail (#2120):

    %{__git} branch --set-upstream-to=master
    fatal: the requested upstream branch 'master' does not exist

At first, it seemed like the most obvious fix would be to just supply
the branch name at init time:

    %{__git} init %{-q} --initial-branch=master\

However, that won't help if the repo is manually created in the %prep
stage before the %__scm_setup_git macro runs, which is exactly the case
with e.g. the edk2 package in Fedora (#2121):

    %prep
    [...]
    git init -q
    [...]
    %autosetup -S git

Therefore, the safest fix is to just revert the original feature and the
unsuccessful fixup commit.  If we really need this feature, it can
always be revisited in the future and done differently.

This reverts commits:
3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b
8b9da98e4c9e256c7c6ecca7f1e5bdbbce29e5da
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/2154

-- Commit Summary --

  * Revert branch creation in %autosetup -S git

-- File Changes --

    M macros.in (7)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/2154.patch
https://github.com/rpm-software-management/rpm/pull/2154.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2154
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2154 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220818/bde7c7ea/attachment-0001.html>


More information about the Rpm-maint mailing list