git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [RFC/PATCH 3/3] push: add separate 'downstream' branch
Date: Thu, 16 May 2013 04:05:49 -0500	[thread overview]
Message-ID: <CAMP44s3fPsGW_9aBbcsu8cJAagz8JEWV2HM=XRH3Rw4=SXdL7Q@mail.gmail.com> (raw)
In-Reply-To: <CALkWK0nTS6Vh7GfnrLWAK5VeevQyGN5N7xT43c+uqBQ5oM5tww@mail.gmail.com>

On Thu, May 16, 2013 at 3:21 AM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> Felipe Contreras wrote:
>>   [branch "master"]
>>           remote = origin
>>           merge = refs/heads/master
>>           pushremote = github
>>           push = refs/heads/master
>
> Hm.  Some thoughts:
>
> fetch and push aren't symmetric.  By default fetches are batched: when
> you say 'git fetch', it fetches all the refs and uses the
> remote.<name>.fetch refspec to update the refs on your side.  Now, I
> would argue that this is the correct design, because I rarely want to
> fetch just one ref (and that is broken, by the way: refs on my side
> aren't updated for some weird reason).  The other reason this is
> correct is because fetching has nothing to do with local branches: how
> you _merge_ your remote branches to your local branches is entirely
> orthogonal to the issue (and that is controlled by
> branch.<name>.merge).
>
> Now, push is a different ball game altogether.  There are people who
> do batched pushes (push.default = matching has been the default for 8
> years now).

And is going to change soon.

> However, the support for a batched push in a triangular
> workflow is very limited: I can't say git push master hot-branch
> pickaxe-doc, and expect them to go to the right remotes (this idea has
> already been discussed and rejected).  Back to your patch: if you want
> to support batched pushes to map refs correctly, you should write a
> patch for remote.<name>.push.  It has a very valid usecase too: there
> are people who use Gerrit and they shouldn't have to do git push
> <name>:refs/for/<name> every single time.  Neither should they have to
> configure each branch.<name>.push.  The ref-mapping is an inherent
> property of the remote, not of the local branch.  And
> branch.<name>.merge is entirely orthogonal to ref-mapping, as I
> already explained.
>
> That said, I think the concept of a downstream can be useful.  I have
> branch.hot-branch.remote set to origin, and
> branch.hot-branch.pushremote set to ram.  Now, I push some changes: my
> prompt still says > (indicating unpushed changes), and this is very
> annoying.  I would definitely like git to be able to recognize that
> I'm ahead of upstream, but in-sync with my downstream.  So, your
> branch.<name>.push should probably be named
> branch.<name>.downstreamref and be used only for informational
> purposes (@{d} and git status)?

That makes absolutely no sense.

[branch "master"]
          remote = origin
          merge = refs/heads/master
          pushremote = github
          downstreamref = refs/heads/whaaa:refs/heads/master

What is the point of 'refs/heads/whaaa'?

> Wait, why do we need it at all?  Is
> there something that we cannot infer from a proposed
> remote.<name>.push?  Why will we ever need to override that refspec
> mapping with a local branch configuration?

[branch "master"]
          remote = origin
          merge = refs/heads/master
          pushremote = github
          push = refs/heads/fc/master

[branch "fc/old-remote/hg"]
          remote = .
          merge = refs/heads/master
          pushremote = github
          push = refs/heads/fc/remote/hg

Tell me how you express that without 'remote.branch.push'.

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2013-05-16  9:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16  3:43 [RFC/PATCH 0/3] New kind of upstream branch: downstream branch Felipe Contreras
2013-05-16  3:43 ` [RFC/PATCH 1/3] remote: don't override default if cur head remote is '.' Felipe Contreras
2013-05-16  3:43 ` [RFC/PATCH 2/3] pull: trivial cleanups Felipe Contreras
2013-05-16  8:29   ` Ramkumar Ramachandra
2013-05-16  8:56     ` Felipe Contreras
2013-05-16  9:34       ` Ramkumar Ramachandra
2013-05-16  9:36         ` Felipe Contreras
2013-05-16  9:54           ` Ramkumar Ramachandra
2013-05-16 10:15             ` Felipe Contreras
2013-05-16 10:18               ` Ramkumar Ramachandra
2013-05-16 10:24                 ` Felipe Contreras
2013-05-16 11:54           ` Antoine Pelisse
2013-05-16 13:36             ` Felipe Contreras
2013-05-16  3:43 ` [RFC/PATCH 3/3] push: add separate 'downstream' branch Felipe Contreras
2013-05-16  5:36   ` Junio C Hamano
2013-05-16  6:00     ` Felipe Contreras
2013-05-16  6:14       ` Junio C Hamano
2013-05-16 15:24     ` Junio C Hamano
2013-05-16  8:21   ` Ramkumar Ramachandra
2013-05-16  9:05     ` Felipe Contreras [this message]
2013-05-16  9:20       ` Ramkumar Ramachandra
2013-05-16  9:33         ` Felipe Contreras
2013-05-16 10:06           ` Ramkumar Ramachandra
2013-05-16 10:22             ` Felipe Contreras
2013-05-16 11:31               ` Ramkumar Ramachandra
2013-05-16 13:32                 ` Felipe Contreras
2013-05-16 13:52                   ` Ramkumar Ramachandra
2013-05-16 14:53                     ` Felipe Contreras

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='CAMP44s3fPsGW_9aBbcsu8cJAagz8JEWV2HM=XRH3Rw4=SXdL7Q@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).