git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 (resend)] ls-remote: fall-back to default remotes when  no remote specified
Date: Fri, 9 Apr 2010 01:10:09 +0800	[thread overview]
Message-ID: <t2mbe6fef0d1004081010sb6dfd0e1l2e73a36ef1af3870@mail.gmail.com> (raw)
In-Reply-To: <20100408071639.GJ30473@coredump.intra.peff.net>

Hi,

On Thu, Apr 8, 2010 at 3:16 PM, Jeff King <peff@peff.net> wrote:
> On Thu, Apr 08, 2010 at 03:07:07PM +0800, Tay Ray Chuan wrote:
>
>>       remote = remote_get(dest);
>> +     if (!remote)
>> +             usage(ls_remote_usage);
>
> I don't see an update to ls_remote_usage, but shouldn't it now be:
>
>  git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>]
>    [repository] [<refs>...]
>
> or something now (while we're at it, maybe we can wrap it better as it's
> larger than 80 characters).

yes. I think

  git ls-remote [--heads] [--tags]  [-u <exec> | --upload-pack <exec>]
                [<repository> [<refs>...]]

would be more accurate.

> But once that is done, shouldn't the (!remote) case say something like
> "you don't have a default remote". The user didn't invoke ls-remote
> incorrectly (as the usage message shows), but rather there was a
> configuration problem.

Noted.

>> +test_expect_success 'use branch.<name>.remote if possible' '
>> +
>> +     # Remove "origin" so that we know that ls-remote is not using it.
>> +     #
>> +     # Ideally, we should test that branch.<name>.remote takes precedence
>> +     # over "origin", but that is another matter altogether.
>> +     #
>> +     git remote rm origin &&
>> +     git config branch.master.remote self &&
>> +     git ls-remote >actual &&
>> +     test_cmp expected.all actual
>> +
>> +'
>
> Wouldn't your "ideally" just be:
>
>  git clone . other-remote &&
>  git push other-remote HEAD:unique-ref &&
>  git config branch.master.remote other-remote &&
>  ...
>
> and check for "unique-ref" in the output?

hmm, upon clone, tracking branches are already created, so we can just
treat them as the "unique refs", without having to create a unique
ref.

-- 
Cheers,
Ray Chuan

  reply	other threads:[~2010-04-08 17:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08  3:58 [PATCH] ls-remote: default to 'origin' when no remote specified Tay Ray Chuan
2010-04-08  4:45 ` Jeff King
2010-04-08  5:35   ` Junio C Hamano
2010-04-08  6:25     ` Jeff King
2010-04-08  6:07   ` Tay Ray Chuan
2010-04-08  6:34     ` Jeff King
2010-04-08  6:44       ` Junio C Hamano
2010-04-08  6:47         ` Jeff King
2010-04-08  5:05 ` Junio C Hamano
2010-04-08  5:58   ` Tay Ray Chuan
2010-04-08  7:05 ` [PATCH v2] ls-remote: fall-back to default remotes " Tay Ray Chuan
2010-04-08  7:07 ` [PATCH v2 (resend)] " Tay Ray Chuan
2010-04-08  7:16   ` Jeff King
2010-04-08 17:10     ` Tay Ray Chuan [this message]
2010-04-08 17:21   ` [PATCH v3] " Tay Ray Chuan
2010-04-08 19:19     ` Jeff King
2010-04-09  8:49     ` Peter Kjellerstedt
2010-04-09  9:15       ` Tay Ray Chuan

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=t2mbe6fef0d1004081010sb6dfd0e1l2e73a36ef1af3870@mail.gmail.com \
    --to=rctay89@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).