I often use git log -p <file>
or git log -p <directory>
to get a comprehensive summary of the changes in a file or set of files. It outputs a history of the commits affecting the files, together with a unified diff of each commit.
Using Perforce I can do p4 changes <file>
or p4 changes <directory>/...
to get a list of commits. But there does not seem to be an option to show the corresponding diffs.
Is there a Perforce equivalent I could use? If shell scripting is necessary, a fully working function would be nice.
If you want to know why I miss the feature, here are a few things that git log -p
lets me do extremely quickly:
- what was the last
.cpp
file to be modified? - find all commits where the string
FOO
has been added to a file. - a function just got deprecated; what did other developers replace it with?
- in general, just know what happened recently in a given directory.