git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>, git@vger.kernel.org
Subject: Re: [PATCH] Fall back to three-way merge when applying a patch.
Date: Thu, 06 Oct 2005 00:33:56 -0700	[thread overview]
Message-ID: <7vmzln9k0r.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0510051909390.31407@g5.osdl.org> (Linus Torvalds's message of "Wed, 5 Oct 2005 19:18:41 -0700 (PDT)")

Linus Torvalds <torvalds@osdl.org> writes:

> ... But I doubt it works very well to rely on 
> commit-level SHA1's - it's more likely to work if you try the "last few 
> tagged releases etc", since patches that don't apply are often against the 
> previous release (and if they don't apply there either, then it's probably 
> not worth fighting over anyway).

Yes.  That is the current heuristics git-applypatch in the
proposed updates branch tries to attempt.  Recorded tree if
exists (which is not very interesting), last few commits, and
then tagged releases.

Ideally, if we had the path following git-rev-list you talked
about, we could first ask git-apply the set of paths the patch
touches, and instead of trying every commits from the HEAD, try
only commits that touch one (or more) of the given paths.

Another possible git-rev-list enhancement that might be useful
is to pop commits not based on time but based on the depth from
branch heads.  Then we could:

    git-rev-list --depth-order --max-count=$N --all \
    	$(git-apply --show-files $patch | sed -e 's/^[^ ]* [^ ]* //p')

to obtain list of last few commits that touch the paths
involved, in the order that is closer-to-tip first.  This would
give us set of more useful commits than the current behaviour.

      parent reply	other threads:[~2005-10-06  7:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-05  0:46 [PATCH] Fall back to three-way merge when applying a patch Junio C Hamano
2005-10-05  4:56 ` Linus Torvalds
2005-10-05  6:58   ` Junio C Hamano
2005-10-05 14:30     ` Linus Torvalds
2005-10-06  0:03       ` Junio C Hamano
2005-10-06  1:59         ` Eric W. Biederman
2005-10-06  2:18           ` Linus Torvalds
2005-10-06  4:17             ` Junio C Hamano
2005-10-06  5:25             ` Eric W. Biederman
2005-10-06 14:35               ` Linus Torvalds
2005-10-06 14:52                 ` Eric W. Biederman
2005-10-06 14:59                   ` Linus Torvalds
2005-10-06 17:07                     ` Eric W. Biederman
2005-10-07  2:33                     ` [PATCH] Show original and resulting blob object info in diff output Junio C Hamano
2005-10-07  4:47                       ` Linus Torvalds
2005-10-07  5:16                         ` Junio C Hamano
2005-10-06  7:33             ` Junio C Hamano [this message]

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=7vmzln9k0r.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=ebiederm@xmission.com \
    --cc=git@vger.kernel.org \
    --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.
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).