Skip to content

Instantly share code, notes, and snippets.

@kokosing
Created February 7, 2019 21:22
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 kokosing/211aa00616c322c9ce9ea038e69cd0df to your computer and use it in GitHub Desktop.
Save kokosing/211aa00616c322c9ce9ea038e69cd0df to your computer and use it in GitHub Desktop.
manual_merge.sh
#!/usr/bin/env bash
set -xeuo pipefail
other_repo=~/presto-private
pushd "$other_repo"
files="$(git log --name-status -1 | grep '^[AM]\s' | awk '{print $2}')"
popd
for file in $files; do
target_file="$(echo $file | sed 's@com/facebook/presto@io/prestosql@g')"
echo processing $file to $target_file
mkdir -p $(dirname "$target_file")
cp "$other_repo/$file" "$target_file"
sed -i 's/com.facebook.presto/io.prestosql/g' "$target_file"
git add "$target_file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment