Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ OPTIONS
VERSION
Last update:
Eat-Me-App version:
Sharg version: 1.2.0
Sharg version: 1.2.1-rc.1
```
<!-- MARKDOWN-AUTO-DOCS:END -->

Expand Down
4 changes: 2 additions & 2 deletions include/sharg/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
//!\brief The minor version as MACRO.
#define SHARG_VERSION_MINOR 2
//!\brief The patch version as MACRO.
#define SHARG_VERSION_PATCH 0
#define SHARG_VERSION_PATCH 1
//!\brief The release candidate number. 0 means stable release, >= 1 means release candidate.
#define SHARG_RELEASE_CANDIDATE 0
#define SHARG_RELEASE_CANDIDATE 1

//!\brief The full version as MACRO (number).
#define SHARG_VERSION (SHARG_VERSION_MAJOR * 10000 + SHARG_VERSION_MINOR * 100 + SHARG_VERSION_PATCH)
Expand Down
50 changes: 50 additions & 0 deletions test/api_stability/1.2.0/0001-NOAPI-Bump-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 7353a6da25516f7532339b0b647d5a767e4ccad4 Mon Sep 17 00:00:00 2001
From: Enrico Seiler <enrico.seiler@hotmail.de>
Date: Thu, 15 Jan 2026 20:25:02 +0100
Subject: [PATCH] [NOAPI] Bump version

---
test/snippet/readme_sneak_peek.out | 2 +-
test/unit/detail/format_ctd_test.cpp | 2 +-
test/unit/detail/format_cwl_test.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/snippet/readme_sneak_peek.out b/test/snippet/readme_sneak_peek.out
index e51f728..1e30290 100644
--- a/test/snippet/readme_sneak_peek.out
+++ b/test/snippet/readme_sneak_peek.out
@@ -28,4 +28,4 @@ OPTIONS
VERSION
Last update:
Eat-Me-App version:
- Sharg version: 1.2.0
+ Sharg version: 1.2.1-rc.1
diff --git a/test/unit/detail/format_ctd_test.cpp b/test/unit/detail/format_ctd_test.cpp
index 320119b..b8d8523 100644
--- a/test/unit/detail/format_ctd_test.cpp
+++ b/test/unit/detail/format_ctd_test.cpp
@@ -114,7 +114,7 @@ TEST_F(format_ctd_test, empty_information)
// Create the dummy parser.
auto parser = get_parser("--export-help", "ctd");
parser.info.date = "December 01, 1994";
- parser.info.version = "1.2.0";
+ parser.info.version = "1.2.1-rc.1";
parser.info.man_page_title = "default_man_page_title";
parser.info.short_description = "A short description here.";

diff --git a/test/unit/detail/format_cwl_test.cpp b/test/unit/detail/format_cwl_test.cpp
index dece1f7..990ea66 100644
--- a/test/unit/detail/format_cwl_test.cpp
+++ b/test/unit/detail/format_cwl_test.cpp
@@ -21,7 +21,7 @@ TEST_F(format_cwl_test, empty_information)
// Create the dummy parser.
auto parser = get_parser("--export-help", "cwl");
parser.info.date = "December 01, 1994";
- parser.info.version = "1.2.0";
+ parser.info.version = "1.2.1-rc.1";
parser.info.man_page_title = "default_man_page_title";
parser.info.short_description = "A short description here.";

--
2.47.3

4 changes: 2 additions & 2 deletions test/api_stability/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ find_package (Git)
include (../sharg-test.cmake)

include (ExternalProject)
set (SHARG_LAST_STABLE_VERSION "1.1.1")
set (SHARG_LAST_STABLE_VERSION "1.2.0")
set (SHARG_LAST_STABLE_SOURCE_URL
"https://github.com/seqan/sharg-parser/releases/download/${SHARG_LAST_STABLE_VERSION}/sharg-${SHARG_LAST_STABLE_VERSION}-Source.tar.xz"
)
set (SHARG_LAST_STABLE_SOURCE_SHA256 "7330f06501718e7871e55e5fd70d0e41472cc8b34bd0e3519f8c5547510c671c")
set (SHARG_LAST_STABLE_SOURCE_SHA256 "aac491bbde0d4d5446277c7c1f6cb4b814b2b4793b14b77f9838f139d50ae29f")

set (SHARG_API_STABILITY_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSHARG_DISABLE_DEPRECATED_WARNINGS=1")

Expand Down
52 changes: 40 additions & 12 deletions test/api_stability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ CMAKE_BUILD_PARALLEL_LEVEL=40 cmake --build .

### How does this work?

In the following we will use `1.1.1` as the latest stable release (LSR).
In the following we will use `1.2.0` as the latest stable release (LSR).

The workflow entails these steps:
1. Download and unzip the LSR.
2. Remove everything from the LSR except the tests in `<sharg_lsr_source>/test/`.
3. Apply patches from the current git version on the LSR, i.e., patches found in
`<sharg_git_source>/test/api_stability/1.1.1`.
`<sharg_git_source>/test/api_stability/1.2.0`.
* These patches will only apply changes on the tests.
* This step is necessary as some of our tests also test non-public / non-stable API.
3. Use the current version of `find_package (Sharg)` found in `<sharg_git_source>/cmake`.
Expand Down Expand Up @@ -84,25 +84,50 @@ There are two categories of API changes that are reflected in the patches (prefi

### How to create patches?

In the following, we will use `1.1.1` as the latest stable release (LSR).
<details><summary>Click for tl;dr<summary>

Create a new branch based on the LSR and apply all existing patches in `<sharg_git_source>/test/api_stability/1.1.1`.
```bash
git update-ref -d refs/heads/api-stability-patches
mkdir -p /tmp/sharg-api-stability-patches
cp -u=all test/api_stability/1.2.0/*.patch /tmp/sharg-api-stability-patches
git checkout -b api-stability-patches 1.2.0
git am --keep-non-patch /tmp/sharg-api-stability-patches/*.patch
rm -f /tmp/sharg-api-stability-patches/*.patch

git cherry-pick <commit>

git format-patch 1.2.0
mv *.patch /tmp/sharg-api-stability-patches
git checkout -
cp -u /tmp/sharg-api-stability-patches/*.patch test/api_stability/1.2.0/
rm -rf /tmp/sharg-api-stability-patches
git branch -D api-stability-patches

git add test/api_stability/1.2.0/
git commit
```

</details>

In the following, we will use `1.2.0` as the latest stable release (LSR).

Create a new branch based on the LSR and apply all existing patches in `<sharg_git_source>/test/api_stability/1.2.0`.

```
cd <sharg_git_source>

# copy over patches to a tmp directory (`git am` seems to not support applying patches onto a different branch)
mkdir -p /tmp/sharg-api-stability-patches
cp test/api_stability/1.1.1/*.patch /tmp/sharg-api-stability-patches
cp test/api_stability/1.2.0/*.patch /tmp/sharg-api-stability-patches

# create a new branch based on the LSR and switch to it
git checkout -b api-stability-patches 1.1.1
git checkout -b api-stability-patches 1.2.0

# apply all patches onto 1.1.1 (--keep-non-patch will keep `[NOAPI]` tags in the commit message)
# apply all patches onto 1.2.0 (--keep-non-patch will keep `[NOAPI]` tags in the commit message)
git am --keep-non-patch /tmp/sharg-api-stability-patches/*.patch

# clean up applied patches
rm /tmp/sharg-api-stability-patches/*.patch
rm -f /tmp/sharg-api-stability-patches/*.patch
```

Now re-apply the commit(s) that changed the API.
Expand All @@ -129,8 +154,8 @@ It is also important that you double check if the patch only contains changes th
After that, we can export all patches.

```
# export all patches since 1.1.1
git format-patch 1.1.1
# export all patches since 1.2.0
git format-patch 1.2.0

# move them to tmp directory
mv *.patch /tmp/sharg-api-stability-patches
Expand All @@ -141,15 +166,18 @@ Now change to your branch that you were working on and check-in the patches.
```
git checkout -

cp /tmp/sharg-api-stability-patches/*.patch test/api_stability/1.1.1/
cp -u /tmp/sharg-api-stability-patches/*.patch test/api_stability/1.2.0/

rm -rf /tmp/sharg-api-stability-patches

# add new patches
git add test/api_stability/1.1.1/
git add test/api_stability/1.2.0/

# commit changes
git commit

# delete local branch
git branch -D api-stability-patches
```

Before pushing, try whether the patches work as intended.
2 changes: 1 addition & 1 deletion test/snippet/readme_sneak_peek.out
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ OPTIONS
VERSION
Last update:
Eat-Me-App version:
Sharg version: 1.2.0
Sharg version: 1.2.1-rc.1
2 changes: 1 addition & 1 deletion test/unit/detail/format_ctd_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ TEST_F(format_ctd_test, empty_information)
// Create the dummy parser.
auto parser = get_parser("--export-help", "ctd");
parser.info.date = "December 01, 1994";
parser.info.version = "1.2.0";
parser.info.version = "1.2.1-rc.1";
parser.info.man_page_title = "default_man_page_title";
parser.info.short_description = "A short description here.";

Expand Down
2 changes: 1 addition & 1 deletion test/unit/detail/format_cwl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TEST_F(format_cwl_test, empty_information)
// Create the dummy parser.
auto parser = get_parser("--export-help", "cwl");
parser.info.date = "December 01, 1994";
parser.info.version = "1.2.0";
parser.info.version = "1.2.1-rc.1";
parser.info.man_page_title = "default_man_page_title";
parser.info.short_description = "A short description here.";

Expand Down