diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-09-17 00:21:13 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-09-18 13:00:46 +0430 |
commit | 46b8a4cda3fc6680ef444d53a77577d5dd8a4689 (patch) | |
tree | 6f9caaa0aecd9906d5b3420a8b5981d850c15937 /Ports | |
parent | c1dc8c9ccbcdb9b6029a293497ffc12a7aa02e49 (diff) | |
download | serenity-46b8a4cda3fc6680ef444d53a77577d5dd8a4689.zip |
Ports: Only regenerate patches if there are actual changed commits
We were previously comparing the hash against the hash after the initial
import, which caused us to regenerate patches every time as long as we
did have patches (even if they haven't changed at all) and the script
entirely missing that it should remove patches if the current commit is
the "import" commit.
Diffstat (limited to 'Ports')
-rwxr-xr-x | Ports/.port_include.sh | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 7b21a89fd6..0494a0458e 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -813,19 +813,18 @@ do_dev() { exit 1 } - local first_hash="$(git -C "$workdir" rev-list --max-parents=0 HEAD)" - pushd "$workdir" launch_user_shell popd >/dev/null 2>&1 + local original_hash="$(git -C "$workdir" rev-parse refs/tags/original)" local current_hash="$(git -C "$workdir" rev-parse HEAD)" - # If the hashes are the same, we have no patches, otherwise generate patches - if [ "$first_hash" != "$current_hash" ]; then - >&2 echo "Note: Regenerating patches as there are some commits in the port repo (started at $first_hash, now is $current_hash)" + # If the hashes are the same, we have no changes, otherwise generate patches + if [ "$original_hash" != "$current_hash" ]; then + >&2 echo "Note: Regenerating patches as there are changed commits in the port repo (started at $original_hash, now is $current_hash)" rm -fr "${PORT_META_DIR}"/patches/*.patch - git -C "$workdir" format-patch --no-numbered --zero-commit --no-signature --full-index "$first_hash" -o "$(realpath "${PORT_META_DIR}/patches")" + git -C "$workdir" format-patch --no-numbered --zero-commit --no-signature --full-index refs/tags/import -o "$(realpath "${PORT_META_DIR}/patches")" do_generate_patch_readme fi } |