Perforce and `p4 diff2' against the origin

Julian Elischer julian at elischer.org
Mon Apr 7 17:06:23 UTC 2008


Mike Meyer wrote:
> On Mon, 7 Apr 2008 10:39:07 -0400 John Baldwin <jhb at freebsd.org> wrote:
> 
>> On Saturday 05 April 2008 10:50:38 am Ed Schouten wrote:
>>> Hello everyone,
>>>
>>> Because my mpsafetty project in Perforce is going quite well, I'm
>>> considering running some kind of cron job to generate nightly diffs, so
>>> other people (interested friends, colleagues and others) to test my
>>> work.
>>>
>>> I've read `p4 help diff2' and it seems you can run the following
>>> command:
>>>
>>> 	p4 diff2 -b mpsafetty
>>>
>>> Unfortunately this command just does a braindead diff against the latest
>>> FreeBSD vendor source, which is not useful in my case. I just want it to
>>> generate a diff against the version I integrated.
>>>
>>> Is it possible to do this with Perforce?
>> Then you can use p4 changes on your branch and find the last IFC and use that 
>> diff like so:
>>
>> p4 diff2 -u -b mybranch @12345 #head
>>
>> I have a script to look in p4 changes of the branch to find the last IFC 
>> commit and figure out the '12345' part automatically like so:
> 
> 
> Perforce has facilities designed specifically to support this kind of
> thing - counters and the "review" command. You can find a brief
> description plus a link to the perforce-standard review daemon here:
> 
> http://www.perforce.com/perforce/loadsupp.html#daemon
> 
> It's designed to send email to perforce user.
> 
> Actually, something similar ought to be running on the repository
> already. If so, and you're not using it, you can 'cheat' by setting up
> the mail list you want and pointing your p4 user Email field at that,
> along with the appropriate Reviews setting for yourself.
> 
>     <mike

I have two scripts that I modify and check into the base of each of my 
trees

look in //repos/user/julian/routing  for the files
update.sh and makediff.pl

they work together.

whenever I update my branch from the vendor (e.g. freebsd) branch,
I use the update script. it does everything needed and when it's
finished, it sets a lable on the vendor branch at the last palce from 
which I updated.. then the makediff.pl perl script generates a diff
from that point. This means that the diff doesn't include any
extraneous junk from later additions in the diff.
It also generates diffs that can be applied correctly by 'patch' which
perforce doesn't do by default.

> 



More information about the freebsd-hackers mailing list