git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Steve Keller <keller.steve@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: Develop a patch series with git?
Date: Tue, 11 Feb 2020 15:00:44 -0500	[thread overview]
Message-ID: <20200211200044.GG2127797@coredump.intra.peff.net> (raw)
In-Reply-To: <trinity-f39d7ed5-e4c9-45fe-944c-b5cb101cfdcd-1581412940557@3c-app-gmx-bap62>

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

  parent reply	other threads:[~2020-02-11 20:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-02-12  9:02   ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20200211200044.GG2127797@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=keller.steve@gmx.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).