git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tay Ray Chuan <rctay89@gmail.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v2] ls-remote: print URL when no repo is specified
Date: Sat, 15 May 2010 17:56:20 +0800	[thread overview]
Message-ID: <AANLkTimTKiGxpVelj9rVV_BV-f8NiKlQHpov38ojlfFq@mail.gmail.com> (raw)
In-Reply-To: <20100514161743.GA1957@progeny.tock>

On Sat, May 15, 2010 at 12:17 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Tay Ray Chuan wrote:
>> On Wed, May 12, 2010 at 1:50 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>>> I cannot convince myself that this is a good change, as I've always
>>> thought "ls-remote" output as something people want to let their scripts
>>> read and parse.  9c00de5 may have given an enhancement to these scripts in
>>> the sense that they can now respond to an empty input from the end user,
>>> but this patch forces them to change the way they parse the output from
>>> the command.
>
> Would 9c00de5 be so useful for scripts?  I suspect the typical script
> does
>
>  git ls-remote "$remote"
>
> so to use the new default it would need adjusting.

Right, existing scripts that use git-ls-remote are unlikely to be
affected by 9c00de5, or this patch, for that matter.

>> in this patch, the remote url is printed to stderr, instead of stdout,
>> so existing scripts should be safe.
>>
>>> I also think this patch is solving a wrong problem.
>>>
>>> When an end user does not know which remote ls-remote would be talking to
>>> by default, what else does he *not* know?  Probably which remote "pull"
>>> would be fetching from
> [...]
>
> I think I see what you are saying, and for scripts, that really would
> be the most useful thing.  Then the script could use something like
>
>  if test -z "$remote"
>  then
>        remote=$(git branch --get-remote --current)
>  fi
>  git ls-remote "$remote"

Just curious - when did git-branch learn "--get-remote"? Or "--current"?

-- 
Cheers,
Ray Chuan

  reply	other threads:[~2010-05-15  9:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-09 14:42 [PATCH] ls-remote: print URL when no repo is specified Tay Ray Chuan
2010-05-09 22:01 ` Jonathan Nieder
2010-05-11 17:20 ` [PATCH v2] " Tay Ray Chuan
2010-05-12  5:50   ` Junio C Hamano
2010-05-14  3:07     ` Tay Ray Chuan
2010-05-14 16:17       ` Jonathan Nieder
2010-05-15  9:56         ` Tay Ray Chuan [this message]
2010-05-15 16:20           ` Jonathan Nieder
2010-05-20 13:27             ` Junio C Hamano
2010-05-16  2:14       ` Geert Bosch
2010-05-16 10:36         ` Sverre Rabbelier
2010-05-16 17:27           ` Geert Bosch

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=AANLkTimTKiGxpVelj9rVV_BV-f8NiKlQHpov38ojlfFq@mail.gmail.com \
    --to=rctay89@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@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 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).