From b5324488242b60e201473e2d5ecc4f17c05623b5 Mon Sep 17 00:00:00 2001 From: Felix Maurer Date: Thu, 8 Dec 2022 23:11:54 +0100 Subject: [PATCH] stgit: 1.5 -> 2.3.0 Version 2 of stgit was rewritten in Rust but in general offers the same feature set [1]. We therefore do not require a Python build environment anymore but a Rust one. However, we overwrite the default build, check and install phases to use the Makefiles provided by stgit. In addition, the following changes are made: - stgit now requires libcurl - perl is required during build (to build docs correctly) and during check (to run the extensive test suite) - the tests require sysctl and iconv on darwin; add them to the check inputs The added patch fixes failing test due to the recent git version in nixpkgs. The fix is also upstream and will most likely be released with 2.3.1, i.e., the patch can be removed then. [1]: https://github.com/stacked-git/stgit/releases/tag/v2.0.0 --- ...ix-use-canonical-Message-ID-spelling.patch | 249 ++++++++++++++++++ .../version-management/stgit/default.nix | 55 ++-- 2 files changed, 286 insertions(+), 18 deletions(-) create mode 100644 pkgs/applications/version-management/stgit/0001-fix-use-canonical-Message-ID-spelling.patch diff --git a/pkgs/applications/version-management/stgit/0001-fix-use-canonical-Message-ID-spelling.patch b/pkgs/applications/version-management/stgit/0001-fix-use-canonical-Message-ID-spelling.patch new file mode 100644 index 000000000000..71cab8fc283e --- /dev/null +++ b/pkgs/applications/version-management/stgit/0001-fix-use-canonical-Message-ID-spelling.patch @@ -0,0 +1,249 @@ +From c500ebe5a51da4eecba0c88d9a335e7a659e7ecb Mon Sep 17 00:00:00 2001 +From: Peter Grayson +Date: Sun, 18 Jun 2023 15:00:19 -0400 +Subject: fix: use canonical Message-ID spelling + +This change aligns with a change in git 2.41.0 to consistently spell +"Message-ID" instead of "Message-Id". + +The test suite is updated to accommodate both spellings, since such headers +are case insensitive. +--- + Documentation/stg.txt | 2 +- + completion/stgit.zsh | 2 +- + src/cmd/email/format.rs | 2 +- + src/cmd/email/send.rs | 2 +- + src/cmd/import.rs | 6 +++--- + t/t1800-import.sh | 2 +- + t/t1801-import-email.sh | 32 ++++++++++++++++---------------- + 7 files changed, 24 insertions(+), 24 deletions(-) + +diff --git a/Documentation/stg.txt b/Documentation/stg.txt +index fb4c08fb..20b75ce2 100644 +--- a/Documentation/stg.txt ++++ b/Documentation/stg.txt +@@ -302,7 +302,7 @@ N.B. Set 'commit.gpgsign' to determine whether patch commits themselves are GPG + See linkgit:git-config[1] for more information about 'commit.gpgsign'. + + stgit.import.message-id:: +- When set to 'true', create 'Message-Id:' trailer in the patch description of patches ++ When set to 'true', create 'Message-ID:' trailer in the patch description of patches + imported from email using linkstg:import[]. + + stgit.keepoptimized:: +diff --git a/completion/stgit.zsh b/completion/stgit.zsh +index 797d9044..de818242 100644 +--- a/completion/stgit.zsh ++++ b/completion/stgit.zsh +@@ -717,7 +717,7 @@ _stg-import() { + '--replace[replace unapplied patches in series]' + '--reject[leave rejected hunks in .rej files]' + '--keep-cr[do not remove CR from email lines ending with CRLF]' +- '--message-id[create Message-Id trailer from email header]' ++ '--message-id[create Message-ID trailer from email header]' + '(-d --showdiff)'{-d,--showdiff}'[show patch content in editor buffer]' + ':file:_files' + + '(source)' +diff --git a/src/cmd/email/format.rs b/src/cmd/email/format.rs +index f385b48a..b30af9c0 100644 +--- a/src/cmd/email/format.rs ++++ b/src/cmd/email/format.rs +@@ -323,7 +323,7 @@ fn message_options() -> Vec { + .long_help( + "Controls addition of `In-Reply-To` and `References` headers to make \ + the second and subsequent mails appear as replies to the first. Also \ +- controls generation of the `Message-Id` header to reference.\n\ ++ controls generation of the `Message-ID` header to reference.\n\ + \n\ + The optional