Received: from [140.186.70.92] (port=49747 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4YP0-0004uW-Me for qemu-devel@nongnu.org; Sat, 09 Oct 2010 08:19:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4YOw-0005Ck-Fq for qemu-devel@nongnu.org; Sat, 09 Oct 2010 08:19:50 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:59195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4YOv-0005Bq-Vq for qemu-devel@nongnu.org; Sat, 09 Oct 2010 08:19:46 -0400 Received: from smtp05.web.de ( [172.20.4.166]) by fmmailgate03.web.de (Postfix) with ESMTP id C299C1662111B for ; Sat, 9 Oct 2010 14:19:43 +0200 (CEST) Received: from [87.173.102.109] (helo=[10.0.0.4]) by smtp05.web.de with asmtp (TLSv1:AES128-SHA:128) (WEB.DE 4.110 #24) id 1P4YOt-0002eJ-00 for qemu-devel@nongnu.org; Sat, 09 Oct 2010 14:19:43 +0200 Message-Id: <9592B3CC-1185-466B-928B-0135CD0C9275@web.de> From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Qemu-devel] Handling patch queues (was: [STATUS] static instrumentation) Date: Sat, 9 Oct 2010 14:19:22 +0200 References: <8762xdyhha.fsf@ginnungagap.bsc.es> <87mxqpn3m7.fsf@ginnungagap.bsc.es> Sender: andreas.faerber@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Am 08.10.2010 um 18:53 schrieb Blue Swirl: > On Thu, Oct 7, 2010 at 8:34 PM, Llu=EDs wrote: >> Blue Swirl writes: >> >>> The patches there seem to be fixes or small changes to your other >>> patches. This makes any review very difficult. >> >> Sorry, I'm really new to git, so I don't really know how to =20 >> maintain and >> "grow" an organized set of patches for review while I keep =20 >> improving the >> work. > > Some kind of patch queue or stack tool can help, I use StGit > (integrates nicely with QGit) but there are others. > > The workflow should aim for a set of committable patches. This means > that instead of patch sequence > 1 - implement feature A > 2 - fix for feature A > 3 - implement feature B > 4 - more fixes for feature A > 5 - fixes for feature B > > etc, the patches should be perfected, like this: > 1 - implement feature A > 2 - implement feature B > > This can be achieved by working with the patch stack: > 1 - implement feature A > fix for feature A needed: fix, refresh 1 > 2 - implement feature B > more fixes for feature A needed: pop 2, include fixes to 1 > fixes for feature B: push 2, fix and refresh 2 > This also makes keeping up with HEAD simpler (though conflicts need to > be managed anyway): > pop all patches > git pull > push patches one at a time, fix conflicts if needed. git rebase -i origin/master sometimes works for me. Commits can then be selected to be reworked, followed by git rebase --=20= continue. This usually works better than manual `git am` / `patch -p1` since you =20= get a three-way merge. Your last commit can be changed with git commit --amend. Especially =20 handy is -s, which adds the forgotten SOB. ;) I've used the pop-pull-push model with Mercurial's mq and find it =20 really awful (uncomfortable), but that seems a matter of taste. Instead I often use two Git branches per topic, one for (unordered) =20 local work and one queue for upstream. On the latter I (cherry-)pick =20 from the work branch, then rebase the work branch against the queue to =20= slim it down. Updating to HEAD means one rebase against origin for the =20= queue and one rebase -i against the queue. While rebasing becomes =20 slightly more complicated, experimenting when you don't know in =20 advance what you'll change next becomes easier and compilation times =20 stay lower compared to frequent checkout of different file versions. Working with one queue requires some caution, like backing up the =20 branch before reworking (git branch / git format-patch). HTH, Andreas=