diff --git a/0001-Update-expected-test-data-for-git-2.35.patch b/0001-Update-expected-test-data-for-git-2.35.patch new file mode 100644 index 0000000..79518f0 --- /dev/null +++ b/0001-Update-expected-test-data-for-git-2.35.patch @@ -0,0 +1,143 @@ +From 838bdd19f6cb60b705e05a65e7c7f0cb87cf3d92 Mon Sep 17 00:00:00 2001 +From: Stefano Rivera +Date: Sun, 6 Mar 2022 12:28:20 -0400 +Subject: [PATCH] Update expected test data for git 2.35 + +Commit order from fast-export --first-parent has changed in git 2.35, +see https://github.com/git/git/commit/726a228dfb19fae8befa0f209436f8fae7919a58 + +This will break the same tests on older git releases. + +Fixes: #344 +Signed-off-by: Stefano Rivera +--- + t/t9390/less-empty-keepme | 32 ++++++++++++++++---------------- + t/t9390/more-empty-keepme | 24 ++++++++++++------------ + 2 files changed, 28 insertions(+), 28 deletions(-) + +diff --git a/t/t9390/less-empty-keepme b/t/t9390/less-empty-keepme +index b8acab94..1a7ba5cb 100644 +--- a/t/t9390/less-empty-keepme ++++ b/t/t9390/less-empty-keepme +@@ -2,33 +2,33 @@ feature done + reset refs/heads/master + commit refs/heads/master + mark :1 +-author Full Name 1000020000 +0100 +-committer Full Name 1000020000 +0100 ++author Full Name 1000000000 +0100 ++committer Full Name 1000000000 +0100 + data 2 +-C ++A + + commit refs/heads/master + mark :2 +-author Full Name 1000030000 +0100 +-committer Full Name 1000030000 +0100 ++author Full Name 1000010000 +0100 ++committer Full Name 1000010000 +0100 + data 2 +-D ++B + from :1 + + reset refs/heads/master + commit refs/heads/master + mark :3 +-author Full Name 1000000000 +0100 +-committer Full Name 1000000000 +0100 ++author Full Name 1000020000 +0100 ++committer Full Name 1000020000 +0100 + data 2 +-A ++C + + commit refs/heads/master + mark :4 +-author Full Name 1000010000 +0100 +-committer Full Name 1000010000 +0100 ++author Full Name 1000030000 +0100 ++committer Full Name 1000030000 +0100 + data 2 +-B ++D + from :3 + + blob +@@ -42,8 +42,8 @@ author Full Name 1000040000 +0100 + committer Full Name 1000040000 +0100 + data 29 + E: Merge commit 'D' into 'B' +-from :4 +-merge :2 ++from :2 ++merge :4 + M 100644 :5 keepme + + commit refs/heads/master +@@ -68,8 +68,8 @@ author Full Name 1000050000 +0100 + committer Full Name 1000050000 +0100 + data 29 + F: Merge commit 'D' into 'B' +-from :4 +-merge :2 ++from :2 ++merge :4 + + blob + mark :10 +diff --git a/t/t9390/more-empty-keepme b/t/t9390/more-empty-keepme +index 902821da..f181c5a2 100644 +--- a/t/t9390/more-empty-keepme ++++ b/t/t9390/more-empty-keepme +@@ -2,29 +2,29 @@ feature done + blob + mark :1 + data 10 +-keepme v2 ++keepme v1 + + reset refs/heads/master + commit refs/heads/master + mark :2 +-author Full Name 1000080000 +0100 +-committer Full Name 1000080000 +0100 +-data 2 +-I ++author Full Name 1000040000 +0100 ++committer Full Name 1000040000 +0100 ++data 29 ++E: Merge commit 'D' into 'B' + M 100644 :1 keepme + + blob + mark :3 + data 10 +-keepme v1 ++keepme v2 + + reset refs/heads/master + commit refs/heads/master + mark :4 +-author Full Name 1000040000 +0100 +-committer Full Name 1000040000 +0100 +-data 29 +-E: Merge commit 'D' into 'B' ++author Full Name 1000080000 +0100 ++committer Full Name 1000080000 +0100 ++data 2 ++I + M 100644 :3 keepme + + commit refs/heads/master +@@ -33,7 +33,7 @@ author Full Name 1000090000 +0100 + committer Full Name 1000090000 +0100 + data 29 + J: Merge commit 'I' into 'H' +-from :4 +-merge :2 ++from :2 ++merge :4 + + done diff --git a/git-filter-repo.spec b/git-filter-repo.spec index 330ecfa..7a723ce 100644 --- a/git-filter-repo.spec +++ b/git-filter-repo.spec @@ -9,6 +9,7 @@ Group: Development/Tools/Version Control Url: https://github.com/newren/git-filter-repo # Source0: https://github.com/newren/git-filter-repo/releases/download/v%{version}/%{name}-%{version}.tar.xz +Patch0: https://github.com/newren/git-filter-repo/commit/838bdd1.patch#/0001-Update-expected-test-data-for-git-2.35.patch # BuildArch: noarch # @@ -16,6 +17,9 @@ BuildRequires: git-core >= 2.26.0 BuildRequires: python3-rpm-macros BuildRequires: python3-devel BuildRequires: python3-setuptools +# test deps +BuildRequires: perl-interpreter +BuildRequires: rsync # Requires: git-core >= 2.26.0 @@ -27,7 +31,10 @@ performance, with far more capabilities, and with a design that scales usability-wise beyond trivial rewriting cases. %prep -%autosetup -p1 +%setup -q +%if 0%{?fedora} +%patch0 -p1 +%endif # Remove shebang from the python module to avoid rpmlint warnings # (this is a symlink, but sed -i will break it, conveniently for us) @@ -36,6 +43,9 @@ sed -i '1,2d' git_filter_repo.py # Change shebang in all relevant files in this directory and all subdirectories find -type f -exec sed -i '1s=^#!%{_bindir}/\(python\|env python\)[23]\?=#!%{_bindir}/python3=' {} + +# Fix shebang print_my_version(); it affects the --version output +sed -Ei "s=#!/usr/bin/env python3=#!%{_bindir}/python3=" %{name} git_filter_repo.py + # Create setup.{cfg,py} to ensure we have egg-info for generating dependencies sed -e '/^setup_requires = setuptools_scm$/d' release/setup.cfg >setup.cfg @@ -58,6 +68,9 @@ sed -Ei 's,(a href=")(git),\1%{_docdir}/git/\2,g' Documentation/html/git-filter- install -d -m 0755 %{buildroot}%{_mandir}/man1 install -m 0644 Documentation/man1/git-filter-repo.1 %{buildroot}%{_mandir}/man1/git-filter-repo.1 +%check +t/run_tests + %files %license COPYING %doc README.md Documentation/*.md Documentation/html/*.html contrib/filter-repo-demos @@ -71,6 +84,7 @@ install -m 0644 Documentation/man1/git-filter-repo.1 %{buildroot}%{_mandir}/man1 - improve python provides - require git-core rather than git - include additional documentation +- run the test suite * Thu Jul 21 2022 Fedora Release Engineering - 2.34.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild