Skip to content

Commit 92e4315

Browse files
committed
Split git setup to several steps
Configuration requirements for `git` and `git_am` can be different enough so that that these two should not share the setup routine in it's entirety [1]. On the other hand, some parts of the setup can (and should) be kept same in both approaches. [1]: #3472 This splits the `%__scm_setup_git` macro into several named steps, that are later combined. This will allow for future differentiation of `git` and `git_am` by customizing (only) the relevant step(s).
1 parent fe9a914 commit 92e4315

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

macros.in

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,17 +1239,26 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\
12391239
%__scm_source_timestamp @${SOURCE_DATE_EPOCH:-${RPM_BUILD_TIME:?}}
12401240

12411241
# Git
1242-
%__scm_setup_git(q)\
1242+
%__scm_init_git(q)\
12431243
%{__git} init %{-q}\
1244+
%{__git} config gc.auto 0
1245+
1246+
%__scm_configure_git\
12441247
%{__git} config user.name "%{__scm_username}"\
1245-
%{__git} config user.email "%{__scm_usermail}"\
1246-
%{__git} config gc.auto 0\
1248+
%{__git} config user.email "%{__scm_usermail}"
1249+
1250+
%__scm_import_git(q)\
12471251
%{__git} add --force .\
12481252
GIT_COMMITTER_DATE=%{__scm_source_timestamp} GIT_AUTHOR_DATE=%{__scm_source_timestamp}\\\
12491253
%{__git} commit %{-q} --allow-empty -a\\\
12501254
--author "%{__scm_author}" -m "%{NAME}-%{VERSION} base"\
12511255
%{__git} checkout --track -b rpm-build
12521256

1257+
%__scm_setup_git(q)\
1258+
%{expand:%__scm_init_git %{-q}}\
1259+
%{expand:%__scm_configure_git}\
1260+
%{expand:%__scm_import_git %{-q}}
1261+
12531262
%__scm_apply_git(qp:m:)\
12541263
%{__git} apply --index --reject %{-p:-p%{-p*}} -\
12551264
GIT_COMMITTER_DATE=%{__scm_source_timestamp} GIT_AUTHOR_DATE=%{__scm_source_timestamp}\\\

0 commit comments

Comments
 (0)