All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: git@vger.kernel.org
Subject: Re: git-am and workflow question
Date: Wed, 07 Feb 2007 23:27:44 -0800	[thread overview]
Message-ID: <7vodo5153j.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <FA0FC64E-75D2-4722-8BD9-F7E6C8C9AFA7@kernel.crashing.org> (Kumar Gala's message of "Wed, 7 Feb 2007 18:34:05 -0600")

Kumar Gala <galak@kernel.crashing.org> writes:

> I poked around the docs and mailing lists but didn't find an answer to
> my question some simple searches so I figured it might be easier  to
> just post a query to the list.
>
> So my problem is that I'm applying some patches from a mbox and want
> to be able to do some slight modifications before actually committing
> the change.  I was wondering how people solve this problem (if at all).

I am one of the two people who have been applying e-mailed
patches to a repository using git for the longest time, so I am
probably qualified to comment.  The other person is obviously
Linus, but our workflows are a bit different.

Linus's first pass is to read his mails in his usual e-mail
client; he saves potentially worthy patches in a separate
mailbox for later review.  In the second pass, he opens the
saved mailbox in an editor, while fixing up bits in the commit
messages and diff text.  Then after making another pass for the
final review, he applies them in a single batch.

I tend to work more incrementally.  My "first pass" is to read
mails and fire off kibitzing responses without doing anything
other than marking potentially worthy patches for later review.
My second pass is actually applying the patch by piping each
e-mail message from my e-mail client to "git am -3 -s", and if I
do not like something in the patch, I make corrections and then
run "git commit --amend".  My final pass is "git log -p", and if
I find something I want to fix, I do "git format-patch -$N" and
"git reset --hard HEAD~$N", fix it up in the editor by editing
the commit message and the diff text, and "git am" to rebind the
branch.

In short, there are two different approaches:

 - If a fix is something trivial, and if you are comfortable
   editing diff text in your editor, then edit it before
   applying.

 - If a fix is more involved, you are probably better off
   stopping immediately after applying the patch you want to fix
   up, make the fix in your working tree, and commit it with
   "git commit --amend".

  reply	other threads:[~2007-02-08  7:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08  0:34 git-am and workflow question Kumar Gala
2007-02-08  7:27 ` Junio C Hamano [this message]
2007-02-08 16:07   ` Kumar Gala
2007-02-08 22:49     ` Junio C Hamano
2007-02-10 22:18   ` Michael S. Tsirkin
2007-02-11  6:45     ` Junio C Hamano
2007-02-08  8:34 ` Jakub Narebski

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=7vodo5153j.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=galak@kernel.crashing.org \
    --cc=git@vger.kernel.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.