summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2019-09-25 10:33:06 -0400
committerMichal Domonkos <mdomonko@redhat.com>2022-07-01 10:52:14 +0200
commitbca4e67db36edf467a146b5d208da3b1cfdaaef9 (patch)
treebbc65b587228fe3c141501ca1ce6172e0dbd0f8c
parent09e5eac3f00144cbecd12a69390f6db98870f7eb (diff)
downloadrpm-bca4e67db36edf467a146b5d208da3b1cfdaaef9.tar.gz
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 <pjones@redhat.com> (cherry picked from commit 3a6b1d8fbf846d3f1b139d343fdfddebe99ae42b)
-rw-r--r--macros.in5
1 files changed, 4 insertions, 1 deletions
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*}} -\