1*43003dfeSmillert#!/bin/sh 2*43003dfeSmillert 3*43003dfeSmillert# this script creates a tag for every p4raw-id 4*43003dfeSmillert# the output can be appended to .git/packed-refs, but make sure to back up 5*43003dfeSmillert# first 6*43003dfeSmillert 7*43003dfeSmillert# then you can do: 8*43003dfeSmillert 9*43003dfeSmillert# git show perl@1234 where 1234 is a perforce change, and 'perl' is the p4 10*43003dfeSmillert# depot 11*43003dfeSmillert 12*43003dfeSmillertgit log -z -F --grep='p4raw-id:' --pretty='format:%H %b' | \ 13*43003dfeSmillertperl -0ne 'chomp; if ( @t = m{([a-f0-9]{40}).*?p4raw-id: //depot/(.*?\@\d+)}s ) { print "@t\n" }' 14