From bca4e67db36edf467a146b5d208da3b1cfdaaef9 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 25 Sep 2019 10:33:06 -0400 Subject: Make "%autosetup -S git" and "%autosetup -S git_am" work on a branch. This changes the git autosetup handlers so that they do the initial commit of the expanded tarball on "master", then switch to a branch "rpm-build" before applying patches. 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. Signed-off-by: Peter Jones (cherry picked from commit 3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b) --- macros.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macros.in b/macros.in index 35462c933..d53ab5ed5 100644 --- a/macros.in +++ b/macros.in @@ -1163,7 +1163,10 @@ package or when debugging this package.\ %{__git} config gc.auto 0\ %{__git} add --force .\ %{__git} commit %{-q} --allow-empty -a\\\ - --author "%{__scm_author}" -m "%{NAME}-%{VERSION} base" + --author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"\ +%{__git} branch rpm-build \ +%{__git} checkout rpm-build \ +%{__git} branch --set-upstream-to=master %__scm_apply_git(qp:m:)\ %{__git} apply --index --reject %{-p:-p%{-p*}} -\ -- cgit v1.2.1