git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: git@vger.kernel.org
Subject: Re: my git problem
Date: Sun, 27 Apr 2008 12:44:54 -0700	[thread overview]
Message-ID: <20080427124454.6a606305.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.1.10.0804271204510.3119@woody.linux-foundation.org>

On Sun, 27 Apr 2008 12:15:27 -0700 (PDT) Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Sun, 27 Apr 2008, Andrew Morton wrote:
> > 
> > Now, I want to generate a plain patch against mainline which will add the
> > patches which are in git-ia64 and which aren't in mainline.  ie: when that
> > patch is applied to mainline, we get git-ia64.  Sounds simple.
> > 
> > A naive
> > 
> > 	git-diff origin git-ia64
> 
> Don't do that.
> 
> That will diff between the two branches, and if they both contain stuff 
> (which they obviously do), you'll get all the things that are in origin 
> (but not git-ia64) as a reversed diff.
> 
> What you _want_ is the diff from the last common point, aka the "merge 
> base".
> 
> With git, you could do that as
> 
> 	merge_base=$(git merge-base origin git-ia64)
> 	git diff $merge_base git-ia64
> 
> but there is a convenient shorthand for that, which is to use "a...b" 
> (three dots!), so
> 
> 	git diff -p --stat origin...git-ia64
> 
> should generally get you what you want.

That generates no diff for several trees which I tried it on.  And
afaict from manual inspection, that's correct - they are empty.

git-sched is non-empty:

y:/usr/src/git26> cat .git/branches/git-sched 
git+ssh://master.kernel.org/pub/scm/linux/kernel/git/mingo/linux-2.6-sched-devel.git#for-akpm

and seems to dtrt too.

But I'm pretty sure that the simple solutions were found wanting, but I
don't recall why.  I think it was because of a problem when
git-netdev-all is based on git-net which is based on origin.  I want to
extract the git-net -> git-netdev-all diff, but doing that generates
patches which reapply things which are already applied.

iirc this happens when git-netdev-all is resynced with origin at a
different time from when git-net is resynced with origin.  I get hunks
which reapply (or revert) changes which are in origin.

But I don't presently have any trees which are based on other non-origin
trees so I can't test that.

> I say *generally*, because there might be multiple merge-bases if there 
> are crossing merges between the two branches and there is no well-defined 
> single common point. But that criss-cross case almost never happens for 
> the kernel, because I've been pretty good at trying to teach maintainers 
> to not generate that kind of complex history (it doesn't just obfuscate 
> the above kind of situation, it also makes gitk output harder-to-read than 
> it otherwise would be).
> 
> That said, your script (that does a merge) should have been able to get 
> the diff too, and in fact handle even the criss-cross case. It's written a 
> bit strangely (like having that really old-fashioned way of using git 
> merge, passing in HEAD explicitly etc).

Well.  It is a couple of years old.

I'll try the simple version later, see what happens.  Thanks.

  reply	other threads:[~2008-04-27 19:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27 18:29 my git problem Andrew Morton
2008-04-27 19:15 ` Linus Torvalds
2008-04-27 19:44   ` Andrew Morton [this message]
2008-04-27 20:24     ` Linus Torvalds
2008-04-28 18:45       ` Andrew Morton
2008-04-28 18:49         ` Johannes Schindelin
2008-04-28 19:09           ` Andrew Morton
2008-04-28 19:13             ` Johannes Schindelin
2008-04-28 19:28               ` Linus Torvalds
2008-04-29 17:15                 ` J. Bruce Fields
2008-04-30  8:17                   ` Jakub Narebski
2008-04-28 19:33               ` Andrew Morton
2008-04-28 19:21         ` Linus Torvalds
2008-04-28 19:54           ` Andrew Morton
2008-05-01  6:01           ` Carl Worth
2008-04-28 19:52         ` Daniel Barkalow
2008-04-28 21:35       ` Andrew Morton
2008-04-28 21:47         ` Linus Torvalds
2008-04-28 22:04           ` Johannes Schindelin
2008-04-28 22:14           ` Linus Torvalds
2008-04-29  2:14             ` Andrew Morton

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=20080427124454.6a606305.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).