From: Johan Herland <johan@herland.net>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH 3/6] push: change `simple` to accommodate triangular workflows
Date: Mon, 24 Jun 2013 10:48:16 +0200 [thread overview]
Message-ID: <CALKQrgfCR10nfP9tVuHyhCPOfe3XVvBzzQayhM7b9Ra5ZDGnMw@mail.gmail.com> (raw)
In-Reply-To: <CALkWK0mAyDb3AjH0s3j2gRRDckx=a2nr9MR+O6gEtwX2MSJrtw@mail.gmail.com>
On Mon, Jun 24, 2013 at 9:46 AM, Ramkumar Ramachandra
<artagnon@gmail.com> wrote:
> Johan Herland wrote:
>>> +static void setup_push_current(struct remote *remote, struct branch *branch)
>>> +{
>>> + if (!branch)
>>> + die(_(message_detached_head_die), remote->name);
>>> + add_refspec(branch->name);
>>
>> Here (and above) we add a refspec to tell Git exactly what to push
>> from the local end, and into what on the remote end.
>
> Nope, we add the refspec "foo", without the :destination part. The
> remote end is unspecified (and defaults to "foo", but that is in the
> transport layer).
Ok, so "foo" is not always semantically equivalent to "foo:foo", and
when adding "foo:bar" it is always considered more specific than (and
superior to) "foo". I think that makes sense.
>> Is it possible to
>> end up with multiple simultaneous refspecs matching the same local
>> ref, but mapping to different remote refs? If so, which will win, and
>> does that make sense?
>
> It is impossible. We either:
>
> - Get an explicit refspec from the user and never run
> setup_default_push_refspecs() to begin with.
>
> - Run setup_push_refspecs() and add *one* refspec depending on the
> push.default value.
Thanks, that's what I wanted to hear. But then, does it make sense to
say that we will only ever have exactly _one_ push refspec in the
current context, and we should therefore replace the "static const
char **refspec;" string array with a single "static const char
*refspec;" string? That would make it obvious that there is no room
for ambiguity with overlapping refspecs.
...Johan
--
Johan Herland, <johan@herland.net>
www.herland.net
next prev parent reply other threads:[~2013-06-24 8:48 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 4:33 [PATCH 0/6] Reroll of rr/triangular-push-fix Junio C Hamano
2013-06-24 4:33 ` [PATCH 1/6] t/t5528-push-default: remove redundant test_config lines Junio C Hamano
2013-06-24 4:33 ` [PATCH 2/6] config doc: rewrite push.default section Junio C Hamano
2013-06-24 4:33 ` [PATCH 3/6] push: change `simple` to accommodate triangular workflows Junio C Hamano
2013-06-24 6:58 ` Johan Herland
2013-06-24 7:43 ` Junio C Hamano
2013-06-24 7:46 ` Ramkumar Ramachandra
2013-06-24 8:48 ` Johan Herland [this message]
2013-06-24 14:13 ` Ramkumar Ramachandra
2013-06-24 7:59 ` Junio C Hamano
2013-06-24 8:48 ` Johan Herland
2013-06-24 4:33 ` [PATCH 4/6] t/t5528-push-default: generalize test_push_* Junio C Hamano
2013-06-24 6:58 ` Johan Herland
2013-06-24 7:28 ` Junio C Hamano
2013-06-24 8:33 ` Johan Herland
2013-06-24 8:44 ` Eric Sunshine
2013-06-24 9:45 ` Johan Herland
2013-06-24 17:21 ` Junio C Hamano
2013-06-24 4:33 ` [PATCH 5/6] t/t5528-push-default: test pushdefault workflows Junio C Hamano
2013-06-24 4:33 ` [PATCH 6/6] push: honor branch.*.push Junio C Hamano
2013-06-24 6:58 ` Johan Herland
2013-06-24 7:47 ` Junio C Hamano
2013-06-24 7:58 ` Ramkumar Ramachandra
2013-06-24 8:17 ` Junio C Hamano
2013-06-24 14:19 ` Ramkumar Ramachandra
2013-06-24 15:23 ` Johan Herland
2013-06-24 16:08 ` Junio C Hamano
2013-06-24 15:41 ` Junio C Hamano
2013-06-24 16:09 ` Ramkumar Ramachandra
2013-06-24 16:53 ` Junio C Hamano
2013-06-24 17:13 ` Ramkumar Ramachandra
2013-06-24 18:19 ` Junio C Hamano
2013-06-24 18:23 ` Ramkumar Ramachandra
2013-06-24 7:21 ` [PATCH 0/6] Reroll of rr/triangular-push-fix Ramkumar Ramachandra
2013-06-24 8:12 ` Junio C Hamano
2013-06-24 13:51 ` Ramkumar Ramachandra
-- strict thread matches above, loose matches on Subject: below --
2013-06-19 11:11 [PATCH 0/6] push.default in the triangular world Ramkumar Ramachandra
2013-06-19 11:11 ` [PATCH 3/6] push: change `simple` to accommodate triangular workflows Ramkumar Ramachandra
2013-06-19 20:00 ` Junio C Hamano
2013-06-20 2:57 ` Junio C Hamano
2013-06-20 10:09 ` Ramkumar Ramachandra
2013-06-20 19:23 ` Junio C Hamano
2013-06-20 20:49 ` Philip Oakley
2013-06-20 21:03 ` Junio C Hamano
2013-06-20 21:22 ` Ramkumar Ramachandra
2013-06-20 21:56 ` Junio C Hamano
2013-06-20 22:05 ` Junio C Hamano
2013-06-20 21:41 ` Junio C Hamano
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=CALKQrgfCR10nfP9tVuHyhCPOfe3XVvBzzQayhM7b9Ra5ZDGnMw@mail.gmail.com \
--to=johan@herland.net \
--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.
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).