how to create v2 patch

10 messages, 8 authors, 2016-06-15 · open the first message on its own page

how to create v2 patch

From: Tilman Schmidt <hidden>
Date: 2016-06-15 22:43:55

Let's say that following the scheme laid out in
http://www.kernel.org/pub/software/scm/git/docs/everyday.html#Individual%20Developer%20(Participant)
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If I just run git-format-patch again, it produces my original
patch plus a second one containing my updates, but what I need
is a single new patch replacing the first one.

Thanks,
Tilman

-- 
Tilman Schmidt                          E-Mail: tilman@imap.cc
Bonn, Germany
Yes, I have searched Google!

Re: how to create v2 patch

From: Pascal Obry <hidden>
Date: 2016-06-15 22:43:55

Tilman Schmidt a écrit :
Let's say that following the scheme laid out in
http://www.kernel.org/pub/software/scm/git/docs/everyday.html#Individual%20Developer%20(Participant)
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If I just run git-format-patch again, it produces my original
patch plus a second one containing my updates, but what I need
is a single new patch replacing the first one.
Can't you merge both of your changes in your local repository? I would
do that with an interactive rebase.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

Re: how to create v2 patch

From: Mike Hommey <hidden>
Date: 2016-06-15 22:43:55

On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:
Tilman Schmidt a écrit :
quoted
Let's say that following the scheme laid out in
http://www.kernel.org/pub/software/scm/git/docs/everyday.html#Individual%20Developer%20(Participant)
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If I just run git-format-patch again, it produces my original
patch plus a second one containing my updates, but what I need
is a single new patch replacing the first one.
Can't you merge both of your changes in your local repository? I would
do that with an interactive rebase.
Or just git commit --amend when committing.

Mike

Re: how to create v2 patch

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:43:55

Tilman Schmidt [off-list ref] writes:
Let's say that following the scheme laid out in
"Everyday GIT ...", chapter "Individual Developer (Participant)".
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If you have original commit and commit with corrections on top of it,
do a squash rebase using "git rebase -i" (interactive), or do a squash
merge.

In the future it would be better to just amend ("git commit --amend")
original commit (or if you are using StGIT, "stg refresh" it).

-- 
Jakub Narebski
Poland

Re: how to create v2 patch

From: Björn Steinbrink <hidden>
Date: 2016-06-15 22:43:55

On 2007.12.01 06:02:23 -0800, Jakub Narebski wrote:
Tilman Schmidt [off-list ref] writes:
quoted
Let's say that following the scheme laid out in
"Everyday GIT ...", chapter "Individual Developer (Participant)".
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If you have original commit and commit with corrections on top of it,
do a squash rebase using "git rebase -i" (interactive), or do a squash
merge.

In the future it would be better to just amend ("git commit --amend")
original commit (or if you are using StGIT, "stg refresh" it).
For completeness:
To use "git commit --amend" for any but the latest commit, you use
rebase -i, too. Just change the "pick" for the commit you want to amend
to "edit". Rebasing will stop _after_ applying that commit and you can
amend it.

Björn

Re: how to create v2 patch

From: Tilman Schmidt <hidden>
Date: 2016-06-15 22:43:56

Am 01.12.2007 14:43 schrieb Mike Hommey:
On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:
quoted
Tilman Schmidt a écrit :
quoted
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If I just run git-format-patch again, it produces my original
patch plus a second one containing my updates, but what I need
is a single new patch replacing the first one.
Can't you merge both of your changes in your local repository? I would
do that with an interactive rebase.
Or just git commit --amend when committing.
Hmm. But wouldn't each of these approaches lead to my original
commit being removed from my git repository? And isn't removing
commits that have already been published strongly discouraged?

Thx
T.

-- 
Tilman Schmidt                          E-Mail: tilman@imap.cc
Bonn, Germany
Yes, I have searched Google!

Re: how to create v2 patch

From: Jan Hudec <hidden>
Date: 2016-06-15 22:43:56

On Thu, Dec 06, 2007 at 21:04:38 +0100, Tilman Schmidt wrote:
Am 01.12.2007 14:43 schrieb Mike Hommey:
quoted
On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:
quoted
Tilman Schmidt a écrit :
quoted
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If I just run git-format-patch again, it produces my original
patch plus a second one containing my updates, but what I need
is a single new patch replacing the first one.
Can't you merge both of your changes in your local repository? I would
do that with an interactive rebase.
Or just git commit --amend when committing.
Hmm. But wouldn't each of these approaches lead to my original
commit being removed from my git repository? And isn't removing
commits that have already been published strongly discouraged?
Removing commits that you already published is strongly discouraged. But
patch is not a commit. A v2 (short for 'second version') patch means a patch,
that should be applied /instead/ of the previous. The previous patch -- and
the commit it was generated from as well as any commit generated by applying
it -- should indeed be replaced by the new version.

-- 
						 Jan 'Bulb' Hudec [off-list ref]

Re: how to create v2 patch

From: Pascal Obry <hidden>
Date: 2016-06-15 22:43:56

Tilman Schmidt a écrit :
Hmm. But wouldn't each of these approaches lead to my original
commit being removed from my git repository? And isn't removing
commits that have already been published strongly discouraged?
They won't be removed, just changed/merged... and that's what you were
looking for or I did not understand your question! This is not bad
practice as it is done on YOUR repository. Of course this should never
be done on a pushed/published changeset.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

Re: how to create v2 patch

From: Andreas Ericsson <hidden>
Date: 2016-06-15 22:43:56

Tilman Schmidt wrote:
Am 01.12.2007 14:43 schrieb Mike Hommey:
quoted
On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:
quoted
Tilman Schmidt a écrit :
quoted
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If I just run git-format-patch again, it produces my original
patch plus a second one containing my updates, but what I need
is a single new patch replacing the first one.
Can't you merge both of your changes in your local repository? I would
do that with an interactive rebase.
Or just git commit --amend when committing.
Hmm. But wouldn't each of these approaches lead to my original
commit being removed from my git repository? And isn't removing
commits that have already been published strongly discouraged?
The term "published" means different things for different projects.
For the Linux kernel, "published" is when your commit ends up in a
repository that Linus pulls from.

So long as you're getting suggestions to fix up your patch, it's
safe to assume it hasn't been accepted into one of those repos, and
you can safely --amend the offending commit(s).

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Re: how to create v2 patch

From: Wincent Colaiuta <hidden>
Date: 2016-06-15 22:43:57

El 6/12/2007, a las 21:04, Tilman Schmidt escribió:
Am 01.12.2007 14:43 schrieb Mike Hommey:
quoted
On Sat, Dec 01, 2007 at 02:17:39PM +0100, Pascal Obry wrote:
quoted
Tilman Schmidt a écrit :
quoted
I have produced a patch, submitted it to LKML, received a few
comments, committed appropriate changes to my local git tree,
and now want to submit a revised patch. How do I do that?
If I just run git-format-patch again, it produces my original
patch plus a second one containing my updates, but what I need
is a single new patch replacing the first one.
Can't you merge both of your changes in your local repository? I  
would
do that with an interactive rebase.
Or just git commit --amend when committing.
Hmm. But wouldn't each of these approaches lead to my original
commit being removed from my git repository?
Not immediately, but eventually. Let's say you have a history like this:

A--B--C--D

And you amend commit D to become D':

A--B--C--D'
        \
         D

You effectively have two "branches" now, but one of them (the original  
D) is unreferenced and will eventually be garbage collected. In other  
words, your ongoing development will look like this:

A--B--C--D'-E--F--G
        \
         D

At this point the only thing which references commit D will be your  
reflog, and with default settings that means that the commit will hang  
around for at least 90 more days before being pruned during garbage  
collection.
And isn't removing
commits that have already been published strongly discouraged?
Yes, normally that statement is true (because someone else may have  
based work on top of "D" and if you delete "D" then you just pulled  
the rug out from under them). But as others have pointed out, posting  
a PATCH to a mailing list isn't the same thing as "publishing a  
commit", so I won't repeat what's already been explained.

If, however, you really had *published* the commit (ie. pushed it out  
to an accessible repository) then you'd want to use "git revert"  
rather than "git commit --amend".

A--B--C--D--D'--E--F

Reverting doesn't delete any commits at all; instead it introduces a  
new commit (D') which undoes the change introduced in D. So you're  
undoing the *effect* of D without actually "undoing" the fact that you  
committed and published it.

Cheers,
Wincent
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help