scripts icon indicating copy to clipboard operation
scripts copied to clipboard

changelog: add missing link

Open tormath1 opened this issue 1 month ago • 3 comments

Everything is in the title.

tormath1 avatar Nov 24 '25 14:11 tormath1

I thought it was done by git history, but the show-changes script is hard to understand. Point still stands though. Sorry for missing the link, but I think adding it now might just be more confusing.

chewi avatar Nov 25 '25 09:11 chewi

Looked the part up again (the end of the script does the actual work):

      git -C "${NEWREPOPATH}" difftool --no-prompt --extcmd='sh -c "cat \"$REMOTE\"" --' "${OLDREF}..${NEWREF}" -- "${NEWPREPEND}changelog/${section}/" | sort || { echo "Error: git difftool failed" ; exit 1 ; }
    fi
    # The -x 'sh -c "cat \"$REMOTE\"" --' command assumes that new changes have their own changelog files,
    # and thus ignores the LOCAL file (which is the empty /dev/null) and prints out the REMOTE completly.
    # If an existing file got changed, we assume that this is just a correction for the old change but
    # shouldn't be included in the release notes again.

Reading my comment there I think it's not fully true when the file exists in both and thus LOCAL and REMOTE exist because cat will still print out the contents of the file again and not ignore it. Maybe we could make it a bit more clever with if [ \"$LOCAL\" = /dev/null ]; then cat … ; fi so that it only prints the changelog entry if it's a new one.

pothos avatar Nov 25 '25 10:11 pothos

Opened a PR with a fix: https://github.com/flatcar/flatcar-build-scripts/pull/178

pothos avatar Nov 25 '25 10:11 pothos

cherry-picked to:

  • flatcar-4515
  • flatcar-4459

tormath1 avatar Nov 28 '25 09:11 tormath1