Skip to content

Instantly share code, notes, and snippets.

@rnewman
Created June 14, 2013 19:58
Show Gist options
  • Save rnewman/5784788 to your computer and use it in GitHub Desktop.
Save rnewman/5784788 to your computer and use it in GitHub Desktop.
Dump an individual git commit.
REPO=~/moz/hg/mozilla-inbound
COMMIT=$1
echo "Processing commit $COMMIT into repo $REPO..."
SUMMARY=$(git show --format="%s" $COMMIT | head -n 1)
FILENAME=$(echo "$SUMMARY" | cut -c 1-24 | sed 's/[^_A-Za-z0-9]/-/g' | tr [A-Z] [a-z])
echo "Summary is \"$SUMMARY\"..."
echo "Filename is \"$FILENAME\"..."
git hgshow $COMMIT | sed 's,src/main/java/org/mozilla/gecko/sync/,mobile/android/base/sync/,g' | sed 's,twinql\.com,mozilla.com,' | hg -R $REPO qimport -g -P -n $FILENAME -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment