diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2011-08-30 10:29:42 +0200 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2011-08-30 10:31:20 +0200 |
commit | 36dd42a030f31bc281a8027bd947bbe226a0ea7a (patch) | |
tree | 65bdb66c11424904244bd01bb3b4abe00c9259ea | |
parent | 9678164d274412e06ab8a5650cfae0b6e044ac5d (diff) |
import-foreign-git.sh: added interactive patch fixing
If patch fails, let caller resolve it manually before continuing. Can
happen if the imported history includes branches and merges with merge
conflicts.
-rwxr-xr-x | build/import-foreign-git.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/build/import-foreign-git.sh b/build/import-foreign-git.sh index 22dace63..61555aa7 100755 --- a/build/import-foreign-git.sh +++ b/build/import-foreign-git.sh @@ -52,7 +52,15 @@ while [ $i -le $count ]; do # get just the commit message (cd "$FOREIGN" && git log --max-count=1 --skip=`expr $count - $i` $revisions -- $SOURCE) >$MSG # apply patch to file: enter directory and skip pathname from patch - (cd $TARGET_DIR && patch -p`expr $SOURCE_LEVELS + 1` <$PATCH) + if ! (cd $TARGET_DIR && patch -p`expr $SOURCE_LEVELS + 1` <$PATCH); then + echo "patch failed in $TARGET_DIR: patch -p`expr $SOURCE_LEVELS + 1` <$PATCH" + echo "continue? yes/no [no]" + read yesno + if [ "$yesno" != "yes" ]; then + exit 1 + fi + fi + # now commit it (can't use commit because we want to preserve date): # - add to index for t in $TARGET; do |