I know a number of ChangeList of my friend. I want to pass this CL number to a Bash script, which will generate a diff file read for the patch
program (which will recreate the change in the git repo).
So far I have this:
function p4_shelved_cl_to_diff()
{
p4 describe -S -du $1 > p4_diff.patch
}
It generates the diff, but headers are in p4 format:
==== //p4_repo/dir_in_repo/dir/file.cpp#123 (text) ===
whereas they should be in
--- dir/file.cpp
+++ dir/file.cpp
So what I'm looking for is a special p4 syntax (googled extensively, checked p4 manual – little hope) or rather a sed/awk/whatever script that will do the change for me.
Any ideas, or maybe someone has this already written?