All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Josh Triplett <josh@joshtriplett.org>,
	David Howells <dhowells@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Christoph Lameter <cl@linux.com>,
	"ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [ANNOUNCE] git-series: track changes to a patch series over time
Date: Thu, 04 Aug 2016 15:44:00 +0300	[thread overview]
Message-ID: <87twf0oga7.fsf@intel.com> (raw)
In-Reply-To: <20160730050241.xyxkhztigh7j5jbe@x>

On Sat, 30 Jul 2016, Josh Triplett <josh@joshtriplett.org> wrote:
> On Fri, Jul 29, 2016 at 09:13:58PM +0100, David Howells wrote:
>> James Bottomley <James.Bottomley@HansenPartnership.com> wrote:
>> 
>> > I do this too, but I also work with the diff when moving hunks.  What I
>> > do is:
>> > 
>> > git checkout <removal commit>
>> > git show <removal commit> > 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 <add commit>
>> > 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

  parent reply	other threads:[~2016-08-04 12:44 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  7:50 [Ksummit-discuss] [ANNOUNCE] git-series: track changes to a patch series over time Josh Triplett
2016-07-29 12:20 ` David Howells
2016-07-29 13:11   ` Josh Triplett
2016-08-04 22:46     ` Catalin Marinas
2016-08-04 23:07       ` Michael S. Tsirkin
2016-08-08 17:27         ` Catalin Marinas
2016-08-15 23:44           ` Michael S. Tsirkin
2016-08-04 23:46       ` Josh Triplett
2016-08-08 17:37         ` Catalin Marinas
2016-07-29 14:06   ` David Howells
2016-07-29 14:21     ` Christoph Lameter
2016-07-29 14:37       ` Josh Triplett
2016-07-29 15:00       ` Daniel Vetter
2016-07-29 15:18         ` Josh Triplett
2016-07-29 15:40           ` Daniel Vetter
2016-07-29 16:21             ` Josh Triplett
2016-07-29 16:31               ` Luis R. Rodriguez
2016-07-29 17:52       ` Bird, Timothy
2016-07-29 17:57         ` James Bottomley
2016-07-29 21:59           ` James Hogan
2016-07-30  2:55           ` Steven Rostedt
2016-07-29 20:13         ` David Howells
2016-07-30  5:02           ` Josh Triplett
2016-07-30  8:43             ` Arnd Bergmann
2016-08-04 12:44             ` Jani Nikula [this message]
2016-07-29 14:34     ` Josh Triplett
2016-07-29 14:37     ` David Howells
2016-07-29 14:56       ` Josh Triplett
2016-07-29 14:55 ` James Bottomley
2016-07-29 15:05   ` Josh Triplett
2016-08-09  0:10     ` Paul E. McKenney
2016-07-29 15:26 ` James Hogan
2016-08-04 23:52 ` Michael S. Tsirkin
2016-08-05 20:26   ` Josh Triplett
2016-08-15 13:20     ` James Hogan
2016-08-15 16:14       ` Josh Triplett
2016-08-15 23:42     ` Michael S. Tsirkin
2016-08-15 12:53 ` James Hogan
2016-08-15 16:34   ` Josh Triplett
2016-08-15 18:46     ` James Hogan
2016-08-15 21:35       ` Josh Triplett
2016-08-15 22:06         ` James Hogan
2016-08-15 23:59           ` Josh Triplett
2016-08-16  2:38             ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87twf0oga7.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=cl@linux.com \
    --cc=dhowells@redhat.com \
    --cc=josh@joshtriplett.org \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.