All of lore.kernel.org
 help / color / mirror / Atom feed
* git-am and workflow question
@ 2007-02-08  0:34 Kumar Gala
  2007-02-08  7:27 ` Junio C Hamano
  2007-02-08  8:34 ` Jakub Narebski
  0 siblings, 2 replies; 7+ messages in thread
From: Kumar Gala @ 2007-02-08  0:34 UTC (permalink / raw)
  To: git

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).

thanks

- kumar

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

* Re: git-am and workflow question
  2007-02-08  0:34 git-am and workflow question Kumar Gala
@ 2007-02-08  7:27 ` Junio C Hamano
  2007-02-08 16:07   ` Kumar Gala
  2007-02-10 22:18   ` Michael S. Tsirkin
  2007-02-08  8:34 ` Jakub Narebski
  1 sibling, 2 replies; 7+ messages in thread
From: Junio C Hamano @ 2007-02-08  7:27 UTC (permalink / raw)
  To: Kumar Gala; +Cc: git

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".

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

* Re: git-am and workflow question
  2007-02-08  0:34 git-am and workflow question Kumar Gala
  2007-02-08  7:27 ` Junio C Hamano
@ 2007-02-08  8:34 ` Jakub Narebski
  1 sibling, 0 replies; 7+ messages in thread
From: Jakub Narebski @ 2007-02-08  8:34 UTC (permalink / raw)
  To: git

[Cc: git@vger.kernel.org]

Kumar Gala wrote:

> 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).

Both git-am and git-applymbox have interactive mode, although I'm not
sure how extensively interactive this mode is.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

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

* Re: git-am and workflow question
  2007-02-08  7:27 ` Junio C Hamano
@ 2007-02-08 16:07   ` Kumar Gala
  2007-02-08 22:49     ` Junio C Hamano
  2007-02-10 22:18   ` Michael S. Tsirkin
  1 sibling, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2007-02-08 16:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git


On Feb 8, 2007, at 1:27 AM, Junio C Hamano wrote:

> 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".

Thanks.  Have there been any thoughts on having git-am apply the  
patch and then let the user do some modifications before the commit?   
I kinda did this by hand by doing the following:

git-am -i ...
< suspend >
patch -p1 < .dotest/patch
< modify >
git-diff > .dotest/patch
< cleanup >
< resume >

- k

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

* Re: git-am and workflow question
  2007-02-08 16:07   ` Kumar Gala
@ 2007-02-08 22:49     ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2007-02-08 22:49 UTC (permalink / raw)
  To: Kumar Gala; +Cc: git

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

> Thanks.  Have there been any thoughts on having git-am apply the patch
> and then let the user do some modifications before the commit?   I
> kinda did this by hand by doing the following:
>
> git-am -i ...
> < suspend >
> patch -p1 < .dotest/patch
> < modify >
> git-diff > .dotest/patch
> < cleanup >
> < resume >

If you are using "am -i", I think the above is already there (I
mean, you should not have to do ^Z where you write <suspend>).
When you get the interactive prompt:

	Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all 

I think you can edit $dotest/patch in whatever way.

However, if I were to do bulk application _with_ incremental
fixup (which I think is a combination that would not work very
well for the way I work, though), I would probably have two
windows (I work inside "screen", so I would use two screens),
and run "am -i" in one and run shell in the other.  Normally I
would just say 'y' to the prompt, and after applying something I
might want to do fixups, I would go to the shell, do fixups and
"commit --amend", come back and let "am -i" to continue with the
next patch.

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

* Re: git-am and workflow question
  2007-02-08  7:27 ` Junio C Hamano
  2007-02-08 16:07   ` Kumar Gala
@ 2007-02-10 22:18   ` Michael S. Tsirkin
  2007-02-11  6:45     ` Junio C Hamano
  1 sibling, 1 reply; 7+ messages in thread
From: Michael S. Tsirkin @ 2007-02-10 22:18 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Kumar Gala, git

> 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".

git-commit --amend seems to rewrite the commit author which is
annoying if you only want to modify the log message a little. As a
work-around I copy the author info from the log and passing --author
explicitly, but is there an easier way?


-- 
MST

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

* Re: git-am and workflow question
  2007-02-10 22:18   ` Michael S. Tsirkin
@ 2007-02-11  6:45     ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2007-02-11  6:45 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: Kumar Gala, git

"Michael S. Tsirkin" <mst@mellanox.co.il> writes:

>> 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".
>
> git-commit --amend seems to rewrite the commit author which is
> annoying if you only want to modify the log message a little. As a
> work-around I copy the author info from the log and passing --author
> explicitly, but is there an easier way?

I am puzzled about this comment.  You should not have to do
anything funky at all.

"commit --amend" changes the committer information (because you
are now committing something different and at a different time
from what was recorded in the original commit object), but does
not touch the author information at all.

We _might_ have had a bug in an ancient version but I even doubt
it.

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

end of thread, other threads:[~2007-02-11  6:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-08  0:34 git-am and workflow question Kumar Gala
2007-02-08  7:27 ` Junio C Hamano
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

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.