git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Daniel Barkalow <barkalow@iabervon.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: Patch (apply) vs. Pull
Date: Wed, 22 Jun 2005 17:54:01 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.21.0506221654550.30848-100000@iabervon.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0506221315201.2353@ppc970.osdl.org>

On Wed, 22 Jun 2005, Linus Torvalds wrote:

> I do realize that people use patch ID's inside various companies already, 
> because it's a nice way to track things. But the fact is, especially with 
> the patch going outside the SCM (which is the whole _point_ here, after 
> all), any modifications will make that ID be dubious.

If this were done within the system, the maintainer would merge a commit
from the author, commit, fix up the whitespace, commit, and push out the
result. The developer then sees that the head was merged, and that
whitespace changes were applied on top of that.

The benefit to an ID that doesn't get changed is that the developer (or
the developer's scripts) can tell that the patch is an ancestor of the new
base tree, which is really important information about maintainer
intent: the remnant in this case is a revert of the maintainer's
changes to the patch, not an independant but conflicting patch.

> And if it _isn't_ modified, then the ID is pointless - you might as well 
> use the SHA1 of the patch itself as its ID, ie not use an explicit ID at 
> all.

My thought was actually to use the hash as the ID, and add headers for
"this patch is a descendant of <other-ID>" as it gets tweaked.

But even in the case where the patch is not modified, the developer can't
retrieve the hash of the applied patch, because it may have applied with
fuzz, in which case diffing the parent's tree with the tree wouldn't
generate a byte-for-byte identical patch. So it would be worth having the
commit store the hash of the submitted patch in a header anyway.

> So I think introducing extra ID's in the process only creates the
> possibility for more confusion. Either the patch is unmodified (and the ID
> is not needed in the first place) or the patch is modified (and the ID
> doesn't convey that).

Do you actually modify patches before applying them, rather than applying
them and the fixing the resulting files? I've never managed to modify
content in a patch (aside from dropping hunks) without upsetting patch. If
you apply them and then fix things, the ID (and for that matter, the 
hash) will be safely conveyed from my system to yours and available for
the commit to mention.

> Which of course is ok, but it's _not_ what I'm interested in if we're
> discussing trying to make git itself have some support for "end-developer
> merges" (re-write history) as opposed to "maintainer merges" (merge
> history).

I believe there are separate issues here: 

 1. pure history rewriting: maintainer merges a developer's
    intermediate head; developer generates a new history in which
    everything later is based on the new mainline.
 2. patches: changes are transferred as diffs over SMTP instead of trees
    inside git.
 3. cherry-picking: maintainer applies some set of changes from a
    developer which is not merging a head the developer created.

I think (1) is easily handled as a merge script that goes through a series
of commits and makes a new series out of merging each of them, rather than
merging the last of them only.

I think (2) should be as transparent as possible, and, in cases where
there was no cherry-picking, be equivalent in the system's behavior to the
result of pull and merge (with the possibility for various cleanup 
happening on top of or along with the merge in either method).

The tricky part is (3), which is currently only possible by going outside
of git. But I think that this is something to tackle separately from
(1) and (2) (where (2) does not involve doing (3)).

	-Daniel
*This .sig left intentionally blank*


  reply	other threads:[~2005-06-22 21:57 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20 16:19 Patch (apply) vs. Pull Darrin Thompson
2005-06-20 17:22 ` Junio C Hamano
2005-06-20 23:01   ` Darrin Thompson
2005-06-21 18:02     ` Daniel Barkalow
2005-06-22  8:47       ` Junio C Hamano
2005-06-22  9:56       ` Catalin Marinas
2005-06-21 22:09   ` Linus Torvalds
2005-06-22  9:08     ` Junio C Hamano
2005-06-22 17:21       ` Linus Torvalds
2005-06-22 20:08         ` Daniel Barkalow
2005-06-22 20:22           ` Linus Torvalds
2005-06-22 21:54             ` Daniel Barkalow [this message]
2005-06-22 22:21               ` Linus Torvalds
2005-06-23  3:32                 ` Daniel Barkalow
2005-06-23  4:23                   ` Linus Torvalds
2005-06-23  5:15                     ` Daniel Barkalow
2005-06-23  6:09                       ` Linus Torvalds
2005-06-23 16:45                         ` Daniel Barkalow
2005-06-23 18:43                           ` Linus Torvalds
2005-06-23 19:59                             ` Daniel Barkalow
2005-06-23 22:20                               ` Linus Torvalds
2005-06-23 22:49                                 ` Linus Torvalds
2005-06-23 12:10                       ` Catalin Marinas
2005-06-23 17:05                         ` Daniel Barkalow
2005-06-24 13:41                           ` Catalin Marinas
2005-06-23  8:47                 ` Martin Langhoff
2005-06-22 16:23     ` Darrin Thompson
2005-06-23  8:36     ` Martin Langhoff
2005-06-23 23:21     ` [PATCH 0/3] Rebasing for "individual developer" usage Junio C Hamano
2005-06-23 23:27       ` [PATCH 1/3] git-commit-script: get commit message from an existing one Junio C Hamano
2005-06-23 23:28       ` [PATCH 2/3] git-cherry: find commits not merged upstream Junio C Hamano
2005-06-23 23:29       ` [PATCH 3/3] git-rebase-script: rebase local commits to new upstream head Junio C Hamano
2005-06-22 17:04   ` Patch (apply) vs. Pull Catalin Marinas

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=Pine.LNX.4.21.0506221654550.30848-100000@iabervon.org \
    --to=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=torvalds@osdl.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.
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).