From ca16356ce81b0ba1ba46e66e94538bdfad49a48f Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Fri, 13 Feb 2026 12:19:56 +0800 Subject: [PATCH] unstableGitUpdater: pass --print-changes to update-source-version This enables git commit message customization when writing a thin-wrapper around unstableGitUpdater with "commit" in supportedFeatures. Passing --print-changes unconditionally is consistent with other updaters such as genericUpdater, which is used by many updaters. We also redirect all non-json stdout to stderr so that the whole stdout contains a valid json. --- pkgs/common-updater/unstable-updater.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/common-updater/unstable-updater.nix b/pkgs/common-updater/unstable-updater.nix index 8897e93616a3..efd4de49378e 100644 --- a/pkgs/common-updater/unstable-updater.nix +++ b/pkgs/common-updater/unstable-updater.nix @@ -107,7 +107,7 @@ let git describe --tags --abbrev=0 --match "''${tag_format}" 2> /dev/null || true } - pushd "$tmpdir" + pushd "$tmpdir" >&2 commit_date="$(git show -s --pretty='format:%cs')" commit_sha="$(git show -s --pretty='format:%H')" last_tag="" @@ -135,11 +135,11 @@ let last_tag="0" fi if [[ -n "$tag_prefix" ]]; then - echo "Stripping prefix '$tag_prefix' from tag '$last_tag'" + echo "Stripping prefix '$tag_prefix' from tag '$last_tag'" >&2 last_tag="''${last_tag#"''${tag_prefix}"}" fi if [[ -n "$tag_converter" ]]; then - echo "Running '$last_tag' through: $tag_converter" + echo "Running '$last_tag' through: $tag_converter" >&2 last_tag="$(echo "''${last_tag}" | ''${tag_converter})" fi else @@ -150,14 +150,15 @@ let exit 1 fi new_version="$last_tag-unstable-$commit_date" - popd + popd >&2 # rm -rf "$tmpdir" # update the nix expression update-source-version \ "$UPDATE_NIX_ATTR_PATH" \ "$new_version" \ - --rev="$commit_sha" + --rev="$commit_sha" \ + --print-changes ''; };