forked from MatmaRex/patchdemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplypatch.sh
executable file
·29 lines (25 loc) · 909 Bytes
/
applypatch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -ex
cd $PATCHDEMO/wikis/$NAME/$REPO
git fetch origin $REF
# Apply $HASH and its parent commits up to $BASE on top of current HEAD.
#
# Consider the following situation: we've been asked to apply the patch 'rewrite-stuff' (with
# dependencies), which is based on 'master', onto the 'wmf/1.69.0-wmf.42' branch.
#
# (I hope you like ASCII-art inspired by Git's man pages)
#
# ---A---B---C---D---E master ($BASE)
# \ \
# \ X---Y rewrite-stuff ($HASH)
# \
# P---Q wmf/1.69.0-wmf.42 (HEAD)
#
# The trick in this command is to pick up commits X and Y, but not B through D, to achieve:
#
# ---A---B---C---D---E master
# \ \
# \ X---Y rewrite-stuff
# \
# P---Q---X'--Y' HEAD
git -c user.email="[email protected]" -c user.name="Patch Demo" rebase --onto HEAD $BASE $HASH