[p4] p4patch tool?

Kaelin Colclasure kaelin at acm.org
Thu Jul 12 11:52:34 PDT 2001


Steve Cogorno wrote:

> Kaelin Colclasure said:
> 
>> I am contemplating trying to keep a Linux kernel tree in Perforce in 
>> sync with the latest kernel releases from kernel.org. When a new kernel 
>> comes out, a patch is prepared against the previous version of the 
>> kernel. I am wondering if anyone has perhaps built a Perforce-aware 
>> version of `patch'?
>> 
>> Such a tool would:
>> 
>>   * `p4 edit' files updated by the patch
>>   * `p4 add' files introduced by the patch
>>   * `p4 delete' files obsoleted by the patch (if indeed you can delete a 
>> file in a patch)
>> 
>> I'm thinking this would be considerably less error-prone than the 
>> alternative of using `p4 diff -se', etc. to try to figure out everything 
>> the patch did *after* the fact...
> 
> 
> Actually, p4 diff is the way to go.  I have a simple shell script that
> compares a client against the depot.  I'll paste it below.  Use the -update
> flag to issue the p4 commands.  If you don't use -update, then the program
> merely reports the difference.

Steve,

The problem with this approach for a beast like a Linux source tree is 
that there's a high likelyhood of ``exteraneous files'' lying about in 
the directory structure. Yes, yes... a `make clean' (or some variation 
thereof) *should* take care of all that -- but who is going to whip all 
those kernel hackers and device driver authors into conformance... :-)

Thanks for the suggestion, though.

-- Kaelin




More information about the perforce-user mailing list