All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ben Boeckel <mathstuf@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3] remote: add get-url subcommand
Date: Wed, 05 Aug 2015 14:39:23 -0700	[thread overview]
Message-ID: <xmqq1tfh2z5g.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150805213358.GA2592@megas.kitware.com> (Ben Boeckel's message of "Wed, 5 Aug 2015 17:33:58 -0400")

Ben Boeckel <mathstuf@gmail.com> writes:

> On Wed, Aug 05, 2015 at 13:34:18 -0700, Junio C Hamano wrote:
>> Changes to these two files look reasonable.
>> 
>> Don't you want to protect this feature from future breakage by
>> others by adding a couple of tests, though, to t/t5505?
>
> Thanks, I've done so locally. It actually brings up this case:
>
>     $ git remote add someremote foo
>     $ git remote get-url --push someremote
>     fatal: no URLs configured for remote 'someremote'
>
> Is it better to use:
>
>     remote = remote_get(remotename);
>     remote->pushurl;
>
>     if (remote->pushurl_nr)
>         remote->pushurl;
>     else
>         remote->url;
>
> or:
>
>     remote = pushremote_get(remotename);
>     remote->pushurl;
>
> ? What is the actual difference between the two?

You tell me ;-)

The default remote based on the current branch is computed
differently based on the direction of the transfer, I think.

        struct remote *remote_get(const char *name)
        {
                return remote_get_1(name, remote_for_branch);
        }

        struct remote *pushremote_get(const char *name)
        {
                return remote_get_1(name, pushremote_for_branch);
        }

When you are not giving name explicitly, the second parameter to _1 
function is used to determine the name.

  reply	other threads:[~2015-08-05 21:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 17:38 [PATCH] add ls-remote --get-push-url option Ben Boeckel
2015-07-31 17:38 ` [PATCH] ls-remote: add " Ben Boeckel
2015-07-31 18:40 ` [PATCH] add ls-remote " Junio C Hamano
2015-07-31 18:56   ` Ben Boeckel
2015-07-31 19:02     ` Junio C Hamano
2015-07-31 19:04       ` Ben Boeckel
2015-07-31 19:16         ` Junio C Hamano
2015-07-31 20:51           ` Ben Boeckel
2015-08-03 21:00 ` [PATCH v2] add git-url subcommand Ben Boeckel
2015-08-03 21:00 ` [PATCH v2] remote: add get-url subcommand Ben Boeckel
2015-08-03 23:38   ` Eric Sunshine
2015-08-04  0:16     ` Ben Boeckel
2015-08-04  0:45       ` Eric Sunshine
2015-08-04 14:56 ` [PATCH v3] " Ben Boeckel
2015-08-05 20:34   ` Junio C Hamano
2015-08-05 21:33     ` Ben Boeckel
2015-08-05 21:39       ` Junio C Hamano [this message]
2015-09-04 14:30 ` [PATCH v4] " Ben Boeckel
2015-09-04 22:40   ` Junio C Hamano
2015-09-16  1:53 ` [PATCH v5] " Ben Boeckel
2015-09-16 22:51   ` Junio C Hamano
2015-09-17  0:19 ` [PATCH v6] " Ben Boeckel

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=xmqq1tfh2z5g.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mathstuf@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.