Skip to content

Instantly share code, notes, and snippets.

@tpounds
Last active September 22, 2015 23:15
Show Gist options
  • Save tpounds/7bfca4744f592a74606a to your computer and use it in GitHub Desktop.
Save tpounds/7bfca4744f592a74606a to your computer and use it in GitHub Desktop.
Perforce pickaxe script.
#!/bin/sh
DEPOT_PATH=$1
SEARCH_REGEX=$2
p4 changes $DEPOT_PATH | \
awk '{ print $2 }' | \
xargs -l sh -c 'p4 describe -du $0 | \
awk "/^[-+].*'$SEARCH_REGEX'/ { found=1 } // { buf = buf\"\n\"\$0 } END { if(found) print buf }" | \
colordiff'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment