From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 8 14:26:56 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9BCB106566B for ; Tue, 8 Apr 2008 14:26:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 989618FC1A for ; Tue, 8 Apr 2008 14:26:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by elvis.mu.org (Postfix) with ESMTP id 023181A4D8B; Tue, 8 Apr 2008 07:26:56 -0700 (PDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Tue, 8 Apr 2008 10:07:17 -0400 User-Agent: KMail/1.9.7 References: <20080405145038.GE5934@hoeg.nl> <20080407183159.GP5934@hoeg.nl> In-Reply-To: <20080407183159.GP5934@hoeg.nl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200804081007.17874.jhb@freebsd.org> Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Cc: Ed Schouten Subject: Re: Perforce and `p4 diff2' against the origin X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2008 14:26:56 -0000 On Monday 07 April 2008 02:31:59 pm Ed Schouten wrote: > Thanks everyone for your replies. I think I should spend some time at > the office trying the solutions to see what's the easiest way. > > I'm just a little bit disappointed by the fact that p4 doesn't have some > kind of switch for diff2 to do this by default. It should already keep a > list of such relations internally to make integrations and such work. > > Is there a way for us to submit feature requests at Perforce? Well, it's not quite that simple because p4 lets you do things like cherry pick revisions (I want to merge revisions 1-4 and 7 into foo.c but not 5 and 6 yet.. in that case, what should it diff against, #4? #7? #7 with #5 and #6 backed out somehow (what if that has conflicts?)?) and merge from different paths into the same file. So for example if I had this: //depot/foo.c //depot/bar.c //depot/baz.c and I merged foo.c#1-#2 into bar.c and foo.c#1 into baz.c. Then suppose I merge bar.c into baz.c (thus carrying the changes in foo.c#2 into baz.c). If I diff foo.c against baz.c should it diff against #1 or #2? The reason you have a good answer for what to merge in your case is because it is a degenerate case and while that one may seem obvious a general purpose solution is not as obvious. The other thing to recall is that if you were just using p4 w/o HEAD in CVS you wouldn't generate patches in the first place. Instead, you would use 'p4 integ -r' to merge changes from your branches up into HEAD. I do this at work where all out stuff lives in p4 and don't really use patches much anymore except to review before a submit (so I would do 'p4 integ -r -b foo_feature; p4 resolve -a; p4 diff -du ... | less; p4 submit'). Thus, we use p4 in a bit of an odd way since HEAD is in CVS and if you use it as it is designed to be used patches aren't all that important, hence they aren't going to focus as much effort on it. -- John Baldwin