From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 1A10A83D for ; Thu, 4 Aug 2016 12:44:04 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 133D514E for ; Thu, 4 Aug 2016 12:44:03 +0000 (UTC) From: Jani Nikula To: Josh Triplett , David Howells In-Reply-To: <20160730050241.xyxkhztigh7j5jbe@x> References: <1469815046.2330.13.camel@HansenPartnership.com> <20160729131151.GF4340@x> <20160729075039.GA26402@x> <30809.1469794812@warthog.procyon.org.uk> <1596.1469801212@warthog.procyon.org.uk> <11641.1469823238@warthog.procyon.org.uk> <20160730050241.xyxkhztigh7j5jbe@x> Date: Thu, 04 Aug 2016 15:44:00 +0300 Message-ID: <87twf0oga7.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Cc: James Bottomley , Christoph Lameter , "ksummit-discuss@lists.linuxfoundation.org" Subject: Re: [Ksummit-discuss] [ANNOUNCE] git-series: track changes to a patch series over time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Sat, 30 Jul 2016, Josh Triplett wrote: > On Fri, Jul 29, 2016 at 09:13:58PM +0100, David Howells wrote: >> James Bottomley wrote: >> >> > I do this too, but I also work with the diff when moving hunks. What I >> > do is: >> > >> > git checkout >> > git show > tmp.diff >> > vi tmp.diff so it only has the hunks I want to remove >> > patch -p1 -R < ~/tmp.diff >> > git commit --amend -a >> > git checkout >> > patch -p1 < ~/tmp.diff >> > git commit --amend -a >> > >> > It's a bit cumbersome, but you can script it. If there are better ways >> > to do it, I'm interested. >> >> One of the reasons I use stgit is when it comes to excising changes into a >> separate patch, it makes it a lot easier: >> >> stg show >tmp.diff # Export contents of current patch >> emacs tmp.diff # Edit so it only has the hunks I want to remove >> stg pop # Pop the patch I want to remove part of >> stg new foo # Create a new patch >> stg fold tmp.diff # ... and apply the patch created above >> emacs ... # Fix up any bits >> stg refresh # ... and make a commit out of it >> stg push # Push the patch I wanted to remove from > > Typically, I'd do the same thing by using `git rebase -i` (or `git > series rebase -i`), marking the patch I want to split as 'e' for edit to > stop with that patch on top of the stack, resetting it, and using add -p > and committing bits incrementally into multiple commits. (I can grab > bits of the commit message from ORIG_HEAD as needed.) Same here. Very powerful, and saves you from editing diffs directly. It's also sometimes useful to combine this with temporary reverts of other commits for cleanly moving conflicting hunks earlier in the series. It may conflict later anyway, but at least the reordering doesn't have to conflict every step of the way. BR, Jani. -- Jani Nikula, Intel Open Source Technology Center