Skip to content

Instantly share code, notes, and snippets.

@gsnedders
Last active April 22, 2022 21:18
Show Gist options
  • Save gsnedders/1c6d6612c15e489e386a9028aae4cf21 to your computer and use it in GitHub Desktop.
Save gsnedders/1c6d6612c15e489e386a9028aae4cf21 to your computer and use it in GitHub Desktop.
more WebKit history
#!/bin/bash
set -ex
# git clone https://github.com/WebKit/WebKit.git
# cd WebKit
git fetch --no-tags https://invent.kde.org/unmaintained/kdelibs.git refs/tags/*:refs/tags/kdelibs/* 3324ba050e98b031f3e60d711448577e18a376f8:refs/tags/kdelibs/v3.0.0-beta2-ish
declare -A replacements
replacements[b33f06b05b1e58d5d9f177065e71f8878395ac70]=v2.2.0
replacements[b828c7fdb0b11fb70c7f1145bc1bc0190a7cbafc]=v2.2.0
replacements[73509ba116b483fbde43c5561858b2583e3733d3]=v2.2.0
replacements[8255947165eb151bdd178b67939ed312adef1099]=v2.2.1
replacements[9491afaacd12b6bf4db25278b9f0657f3874d12f]=3324ba050e98b031f3e60d711448577e18a376f8 # c. KDE 3 beta 2
# this commit message is a lie, it's very much a partial import of new code so
# we just ignore it to avoid confusing git
# replacements[131ed97500ad3d8fe77ffaec43ae0ed9c389972a]=3324ba050e98b031f3e60d711448577e18a376f8
replacements[b923c2f4eb7804aae65d67b4c3061d6435acb10d]=v3.0.0
replacements[d320738e7a70efda10ccf1962c0bc5d2d692b4be]=v3.0.1
replacements[4aa607907a62eb11eef3f1581cfe1f7e1aea01b5]=v3.0.2
for key in "${!replacements[@]}"
do
if [ "${replacements[$key]}" == "v2.2.0" ]; then
# for the initial imports, treat graft replacement as the 1st parent
git replace --graft "$key" $( git rev-list -n 1 "${replacements[$key]}" ) $( git rev-list -n 1 "$key^" )
else
git replace --graft "$key" $( git rev-list -n 1 "$key^" ) $( git rev-list -n 1 "${replacements[$key]}" )
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment