git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* Develop a patch series with git?
@ 2020-02-11  9:22 Steve Keller
  2020-02-11 13:40 ` Shourya Shukla
  2020-02-11 20:00 ` Jeff King
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Keller @ 2020-02-11  9:22 UTC (permalink / raw)
  To: git

I wonder how git supports developing a series of small patches.  In my
usual development I go back and forth along a series of patches before
I can commit them all.  I use quilt for that.

Say I want to add feature FOO and start a patch "FOO" editing some
source file.  In the process of doing so I realize that I need an
extension of some function to base my patch on, so I do "quilt pop" to
undo patch FOO and insert a new patch BAR and then re-apply FOO by
calling quilt push.  No I can use the new extension from BAR in my
current patch FOO.  The patch series often contains quite a number of
patches and I push, pop, and edit these patches quite often.  Only
when everything is done I use git commit all the patches into the
repository.

My question is whether there is git functionality to replace quilt.
Or is the combination of quilt and git common?

Steve


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Develop a patch series with git?
  2020-02-11  9:22 Develop a patch series with git? Steve Keller
@ 2020-02-11 13:40 ` Shourya Shukla
  2020-02-11 20:00 ` Jeff King
  1 sibling, 0 replies; 4+ messages in thread
From: Shourya Shukla @ 2020-02-11 13:40 UTC (permalink / raw)
  To: keller.steve; +Cc: git, Shourya Shukla

Hello Steve,

> My question is whether there is git functionality to replace quilt.
> Or is the combination of quilt and git common?

I think we can use interactive rebase[1] as well as 'git am'[2] (am = apply mail)
to apply a series of patches from a mailbox.

In the case of, let's say a dependency missing on your end, you can do an
interactive rebase using 'git rebase -i' to edit your _mini-commits_ which
you will be making on applying the patches to include the dependencies. One
can also 'squash' commits together(i.e. meld multiple commits into one) in
case you want a smaller commit history or you think there is a redundancy in
any of your commits.

BTW, I think that 'git quiltimport' is quite old now right? And maybe even
obsolete?

Best,
Shourya Shukla

[1]: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
[2]: https://git-scm.com/docs/git-am

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Develop a patch series with git?
  2020-02-11  9:22 Develop a patch series with git? Steve Keller
  2020-02-11 13:40 ` Shourya Shukla
@ 2020-02-11 20:00 ` Jeff King
  2020-02-12  9:02   ` Johannes Schindelin
  1 sibling, 1 reply; 4+ messages in thread
From: Jeff King @ 2020-02-11 20:00 UTC (permalink / raw)
  To: Steve Keller; +Cc: git

On Tue, Feb 11, 2020 at 10:22:20AM +0100, Steve Keller wrote:

> I wonder how git supports developing a series of small patches.  In my
> usual development I go back and forth along a series of patches before
> I can commit them all.  I use quilt for that.
> 
> Say I want to add feature FOO and start a patch "FOO" editing some
> source file.  In the process of doing so I realize that I need an
> extension of some function to base my patch on, so I do "quilt pop" to
> undo patch FOO and insert a new patch BAR and then re-apply FOO by
> calling quilt push.  No I can use the new extension from BAR in my
> current patch FOO.  The patch series often contains quite a number of
> patches and I push, pop, and edit these patches quite often.  Only
> when everything is done I use git commit all the patches into the
> repository.
> 
> My question is whether there is git functionality to replace quilt.
> Or is the combination of quilt and git common?

Another responder mentioned "rebase -i", which is the most direct
equivalent. But on a smaller scale, also look at "git add -p", which
lets you selectively stage hunks for commit.

So quite often my flow is something like:

  1. Messy writing and refactoring, while I get a handle on what my
     changes are going to be.

  2. "git add -p" to pull out some hunks related to refactoring, then
     "git commit" to give it a rough commit message.

  3. Repeat step 2 (with maybe some more step 1 in between) as necessary
     until you have a sequence of rough patches.

  4. Revisit each patch individually with "rebase -i", possibly
     re-ordering, fixing bugs, fleshing out commit messages, etc.
     Another useful tool here is:

       git rebase -x "make test"

     which makes sure that the intermediate steps are all correct.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Develop a patch series with git?
  2020-02-11 20:00 ` Jeff King
@ 2020-02-12  9:02   ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2020-02-12  9:02 UTC (permalink / raw)
  To: Jeff King; +Cc: Steve Keller, git

Hi,

On Tue, 11 Feb 2020, Jeff King wrote:

> On Tue, Feb 11, 2020 at 10:22:20AM +0100, Steve Keller wrote:
>
> > I wonder how git supports developing a series of small patches.  In my
> > usual development I go back and forth along a series of patches before
> > I can commit them all.  I use quilt for that.
> >
> > Say I want to add feature FOO and start a patch "FOO" editing some
> > source file.  In the process of doing so I realize that I need an
> > extension of some function to base my patch on, so I do "quilt pop" to
> > undo patch FOO and insert a new patch BAR and then re-apply FOO by
> > calling quilt push.  No I can use the new extension from BAR in my
> > current patch FOO.  The patch series often contains quite a number of
> > patches and I push, pop, and edit these patches quite often.  Only
> > when everything is done I use git commit all the patches into the
> > repository.
> >
> > My question is whether there is git functionality to replace quilt.
> > Or is the combination of quilt and git common?
>
> Another responder mentioned "rebase -i", which is the most direct
> equivalent.

I think the most direct equivalent is `guilt`:
https://repo.or.cz/w/guilt.git

There haven't been any patches since May 2018 which either means that the
project is dead or that it is so robust that no changes are necessary
anymore.

Ciao,
Johannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11  9:22 Develop a patch series with git? Steve Keller
2020-02-11 13:40 ` Shourya Shukla
2020-02-11 20:00 ` Jeff King
2020-02-12  9:02   ` Johannes Schindelin

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git