Re: [PATCH v2 (resend)] ls-remote: fall-back to default remotes when no remote specified

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Apr 8, 2010 at 3:16 PM, Jeff King <peff@xxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]