Skip to content

Instantly share code, notes, and snippets.

@karkhaz
Last active November 30, 2016 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karkhaz/d11efa611a1bde23490c2773dc0da60d to your computer and use it in GitHub Desktop.
Save karkhaz/d11efa611a1bde23490c2773dc0da60d to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Generates a patchset from Gábor Horvath's ctu-master branch, ignoring
# all patches that are merged in from upstream master---i.e., generates
# only those patches authored by Gábor and his team.
#
# https://github.com/dkrupp/clang/tree/ctu-master
#
# Current as of 1bb3636.
# The ranges of commits that we want to generate patches from. The first
# range is the oldest. Within each range, the first commit is the
# oldest. The range is EXCLUSIVE of the first commit and INCLUSIVE of
# the second, i.e. we apply every commit from the child of the first
# commit up to and including the second commit.
RANGES=""
# Start just before Daniel Krupp's first commit.
RANGES="$RANGES 46257d7..7b737c4"
# 78f799e (Kareem's support for Atomic nodes) already merged upstream.
RANGES="$RANGES 4e3d949..02cbe96"
# Skip upstream 1f062cd - c30dc1c
# Don't replay be5fc19 - 1be9584
RANGES="$RANGES 1be9584..13e359a"
# Skip upstream b9a1fd1 - dde9099
RANGES="$RANGES 1b4ff45..a14e547"
# Single commit on different branch by Gábor
RANGES="$RANGES 1b4ff45..c107200"
# Skip merge 205326c
RANGES="$RANGES 205326c..1bb3636"
OUT_DIR=patches
START_NUMBER=0
mkdir -p $OUT_DIR
rm -r $OUT_DIR/*
for range in $RANGES; do
echo $range
git format-patch --start-number $START_NUMBER -o $OUT_DIR $range
START_NUMBER=$(ls $OUT_DIR | tail -n 1 | awk -F - '{print $1 + 1}' | bc)
done
## Alternative version. This sequence generates a new branch with all the
## commits. It's a bit slower.
#
#git checkout old-master
#git checkout -B gabor-squash
#for range in $RANGES; do
# git cherry-pick $range
#done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment