Follow upstream changes -- rest
[git-darcs-import.git] / scripts / update-upstream
blob80ea4714724e9427fd89cf59c26bab93c6369bef
1 #! /bin/sh
3 # pull from a darcs repository and create a new git commit from it; put
4 # instructions for reproducing this commit with darcs into the commit message
6 # Author: Bertram Felgenhauer <int-e@gmx.de>
9 git checkout darcs || exit 1
11 darcs pull -a
12 # extract the hash of the latest commit
13 HASH="$(darcs changes --last=1 --xml-output | grep '^<patch ' | sed 's/^.* hash=.\(.*\).gz.>$/\1/')"
15 darcs show files --no-directories | git update-index --add --stdin
16 git commit -a -F- <<EOF
17 pull from upstream repository
19 darcs pull -a
20 darcs unpull --from-match=\"hash $HASH\" -a
21 darcs pull --matches=\"hash $HASH\" -a
22 EOF
24 git checkout master