git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Junio C Hamano <junkio@cox.net>
Cc: Alex Riesen <raa.lkml@gmail.com>, git@vger.kernel.org
Subject: Re: 'upstream' branches.
Date: Mon, 07 May 2007 09:51:01 +0100	[thread overview]
Message-ID: <1178527861.11851.110.camel@pmac.infradead.org> (raw)
In-Reply-To: <7vabwh8m5e.fsf@assigned-by-dhcp.cox.net>

On Sun, 2007-05-06 at 18:20 -0700, Junio C Hamano wrote:
> Of course not.  Why are you even _PUBLISHING_ what your
> upstreams' origins are to begin with? 

I have the master mtd-2.6.git tree on the server, of course. 
I have a bunch of clones of that, on various computers I might be
sitting in front of. On each of those, I might pull from the upstream
tree (directly or indirectly) and push to my server. On each of those, I
might pull from my server and then set about pushing stuff to linus,
which starts with 'git-diff linus..' to vet it for sanity and 'git-log
linus..' to create a pull request.

I don't _care_ how commits from Linus' tree get into my tree. I just
want to know which is the latest commit in my tree that came from
upstream. How it got there is an implementation detail.

The other thing it's used for is excluding upstream commits from being
sent to the MTD commits list. Anything in the 'linus' branch won't get
sent. I _do_ have a fallback which also excludes any commits in the
local mirror of upstream -- but that mirror is pulled by git:// and only
daily, while my merges are usually from ssh://master.kernel.org/... so
when I merge and push to the server, the 'linus' branch may be many
commits ahead of the local mirror of upstream.

> By this, you are effectively getting the origin as seen by other
> people, and taking the most advanced one as the union of the
> origins.
> 
> But step back and think about the reason why you would even want
> to know about the origin of each of your buddies 

I don't. Except when I've pulled from them, and they've pulled from
Linus since I did. When I prepare for a merge to Linus, I don't _care_
about the last time _I_ pulled from upstream. I just care about the
latest commit which came from upstream, by whatever route.

Likewise, when I'm working on the OLPC git tree and I want to see what
we've got outstanding from Linus' tree.

> ... On the other hand, the earlier "diff" now needs to be written like
> this:
> 
> 	$ git diff $(git merge-base linus A)..A
> 
> Because this is the right thing to do in regular cases anyway,
> we even have a short-hand for that in the "three dot" form:
> 
> 	$ git diff linus...A
> 
> I think you already know these two things: "git-log linus..A is
> the right way to ask what A did relative to Linus, even when
> 'linus' is ahead of what A based his work on" and "the three-dot
> notation linus...A is the right thing to use when 'linus' could
> be ahead of what A is based on". 

OK, that works for much of the local tracking stuff -- I wasn't
previously aware of the 'linus...A' notation.

So I can just 'git-fetch linus; git-log linus...' when preparing to
merge upstream, instead of trying to keep track of the merge-base across
many repositories. Thanks.

It doesn't solve the problem of what to exclude from the commits list. 
But it does at least reduce the scope of the problem -- I only need to
handle that on my own trees, and it _will_ only ever go forward (because
I only ever do 'git-pull linus' in my clone of the mtd tree if it's
going to be immediately followed by 'git-push origin'.

-- 
dwmw2

  reply	other threads:[~2007-05-07  8:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-05 12:29 'upstream' branches David Woodhouse
2007-05-05 17:44 ` Alex Riesen
2007-05-05 17:50   ` David Woodhouse
2007-05-05 22:52     ` Alex Riesen
2007-05-06  6:36       ` Junio C Hamano
2007-05-06  7:35         ` David Woodhouse
2007-05-06  8:00           ` Junio C Hamano
2007-05-06  8:39             ` David Woodhouse
2007-05-07  1:20               ` Junio C Hamano
2007-05-07  8:51                 ` David Woodhouse [this message]
2007-05-06  9:21             ` Alex Riesen
2007-05-07  7:40               ` Junio C Hamano
2007-05-07  8:39                 ` Alex Riesen

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=1178527861.11851.110.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=raa.lkml@gmail.com \
    /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).