Created
October 7, 2021 17:09
-
-
Save iUltimateLP/389f71307482d647817cabeb8e34ab04 to your computer and use it in GitHub Desktop.
Gource Perforce Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put your P4 credentials here! | |
P4_IP="some.domain.com:1666" | |
P4_USER=John | |
P4_PASS=johndoe1234 | |
rm -rf gource.log | |
p4 -p $P4_IP -u $P4_USER -P $P4_PASS changes |awk '{print $2}'|p4 -p $P4_IP -u $P4_USER -P $P4_PASS -x - describe -s|awk '(/^Change / || /^... /) {if ($1 == "Change") {u=substr($4,1,index($4,"@")-1); t = $(NF-1) " " $NF; gsub("/"," ",t); gsub(":"," ",t);time=mktime(t);} else {if ($NF=="add") {c="A";} else if ($NF=="delete") {c="D";} else {c="M";};f=substr($2,3,index($2,"#")-3);print time "|" u "|" c "|" f;}}'|sort -n > gource.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment