git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Second parent for reverts
@ 2007-05-09 19:20 Daniel Barkalow
  2007-05-09 20:07 ` Johannes Schindelin
  2007-05-09 21:54 ` Junio C Hamano
  0 siblings, 2 replies; 53+ messages in thread
From: Daniel Barkalow @ 2007-05-09 19:20 UTC (permalink / raw)
  To: git

The discussion about having a header to specify, for a revert commit, what 
it reverts made me realize that this header *would* be useful, but that we 
don't need a *new* header for it. I think that the right method is to add 
the parent of the reverted commit as a second parent for the revert.

If you have:

a -> b -> c -> d

And you want to revert b, the most exact flow would be:

a -> b -> c -> d -> e
       \         /
        -> a' ---

I.e., you exactly remove the effects of b to generate a commit that has 
the same tree as a, and then you merge.

But a' doesn't actually take anything from b, since it's reverting all of 
b (unless it's only reverting part of b), and, if b isn't there, it 
doesn't need a commit message, either, so it's not different from a. So 
the flow should be:

a -> b -> c -> d -> e
  \              /
   --------------

And this means blame work correctly: lines that b changed will be blamed 
on a (or an ancestor), because e will match a there and be different from 
d. So I think git-revert should simply add in the reverted patch's parent. 
Does this analysis make sense to other people?

	-Daniel
*This .sig left intentionally blank*

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

end of thread, other threads:[~2007-05-29 11:13 UTC | newest]

Thread overview: 53+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-09 19:20 [RFC] Second parent for reverts Daniel Barkalow
2007-05-09 20:07 ` Johannes Schindelin
2007-05-09 20:22   ` Shawn O. Pearce
2007-05-09 22:26     ` Johan Herland
2007-05-09 21:54 ` Junio C Hamano
2007-05-09 22:16   ` Linus Torvalds
2007-05-10 16:35     ` Linus Torvalds
2007-05-10 18:06       ` Johan Herland
2007-05-10 18:22         ` Linus Torvalds
2007-05-27 14:08           ` [PATCH 00/15] git-note: A mechanisim for providing free-form after-the-fact annotations on commits Johan Herland
2007-05-27 14:09             ` [PATCH 01/15] git-note: Add git-note command for adding/listing/deleting git notes Johan Herland
2007-05-27 14:10             ` [PATCH 02/15] git-note: (Documentation) Add git-note manual page Johan Herland
2007-05-27 14:11             ` [PATCH 03/15] git-note: (Administrivia) Add git-note to Makefile, .gitignore, etc Johan Herland
2007-05-27 14:11             ` [PATCH 04/15] git-note: (Plumbing) Add plumbing-level support for git notes Johan Herland
2007-05-27 14:12             ` [PATCH 05/15] git-note: (Plumbing) Add support for git notes to git-rev-parse and git-show-ref Johan Herland
2007-05-27 14:13             ` [PATCH 06/15] git-note: (Documentation) Explain the new '--notes' option " Johan Herland
2007-05-27 14:13             ` [PATCH 07/15] git-note: (Almost plumbing) Add support for git notes to git-pack-refs and git-fsck Johan Herland
2007-05-27 14:14             ` [PATCH 08/15] git-note: (Decorations) Add note decorations to "git-{log,show,whatchanged} --decorate" Johan Herland
2007-05-27 14:14             ` [PATCH 09/15] git-note: (Documentation) Explain new behaviour of --decorate in git-{log,show,whatchanged} Johan Herland
2007-05-27 14:15             ` [PATCH 10/15] git-note: (Transfer) Teach git-clone how to clone notes Johan Herland
2007-05-27 14:15             ` [PATCH 11/15] git-note: (Transfer) Teach git-fetch to auto-follow notes Johan Herland
2007-05-27 14:15             ` [PATCH 12/15] git-note: (Transfer) Teach git-push to push notes when --all or --notes is given Johan Herland
2007-05-27 14:16             ` [PATCH 13/15] git-note: (Documentation) Explain the new --notes option to git-push Johan Herland
2007-05-27 14:16             ` [PATCH 14/15] git-note: (Tests) Add tests for git-note and associated functionality Johan Herland
2007-05-27 14:17             ` [PATCH 15/15] git-note: Add display of notes to gitk Johan Herland
2007-05-27 20:09             ` [PATCH 00/15] git-note: A mechanisim for providing free-form after-the-fact annotations on commits Junio C Hamano
2007-05-28  0:29               ` Johan Herland
2007-05-28  0:59               ` Jakub Narebski
2007-05-28  4:37             ` Linus Torvalds
2007-05-28 10:54               ` Johan Herland
2007-05-28 16:28                 ` Linus Torvalds
2007-05-28 16:40                   ` Johan Herland
2007-05-28 16:58                     ` Linus Torvalds
2007-05-28 17:48                       ` Johan Herland
2007-05-28 20:45                         ` Junio C Hamano
2007-05-28 21:35                           ` Shawn O. Pearce
2007-05-28 23:37                             ` Johannes Schindelin
2007-05-29  3:12                             ` Linus Torvalds
2007-05-29  3:22                               ` Shawn O. Pearce
2007-05-29  7:04                                 ` Jakub Narebski
2007-05-29 11:04                               ` Andy Parkins
2007-05-29 11:12                                 ` Johannes Schindelin
2007-05-29  7:06                           ` Johan Herland
2007-05-29  8:22                             ` Jeff King
2007-05-29  9:23                               ` Johan Herland
2007-05-28 20:45                 ` Junio C Hamano
2007-05-28 21:19                   ` Shawn O. Pearce
2007-05-28 23:46                   ` [PATCH] Add fsck_verify_ref_to_tag_object() to verify that refname matches name stored in tag object Johan Herland
2007-05-28 17:29               ` [PATCH 00/15] git-note: A mechanisim for providing free-form after-the-fact annotations on commits Michael S. Tsirkin
2007-05-28 17:42                 ` Michael S. Tsirkin
2007-05-28 17:58                   ` Johan Herland
2007-05-10 22:33       ` [RFC] Second parent for reverts Martin Langhoff
2007-05-10  1:43   ` Junio C Hamano

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 NNTP newsgroup(s).