Elide version.txt sync when merging develop into nightly #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Before merging develop into
nightly
, syncversion.txt
with develop to avoid a merge conflict; afterward, remove this sync commit.The reason for removing the commit afterward is that we run
update-version.sh
, which rewrites the file as necessary. Sincenightly
merges from bothjdk21u
andjdk21-dev
, butdevelop
only merges from jdk21u, version.txt may be newer innightly
. If we syncversion.txt
withdevelop
and don't remove it, as we do currently, we avoid the merge conflict, but thenupdate-version.sh
(which we treat as authoritative) overwritesversion.txt
, and we have the two mechanisms writing two new commits each time the action is run.Motivation and context
The goal is to avoid merge conflicts in
version.txt
during automated merges between upstream repos and various branches. However, this proves to be slightly complex due to the flow of the code. The current technique of simply copyingversion.txt
fromdevelop
intonightly
can result in an incorrect version of the file being written, which is later corrected byupdate-version.sh
. There may be a cleaner way to avoid the merge conflict than simply copying the file, writing a (possibly empty) commit, doing the merge, and then removing the commit with a rebase before pushing it. If you know of one, please suggest it.How has this been tested?
Tested in a forked repo, as well as on the command line.