git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] completion: avoid ls-remote in certain scenarios
Date: Sun, 2 Jun 2013 17:57:04 -0500	[thread overview]
Message-ID: <CAMP44s0or-wtNc85HPO8hMA47xbcXVOcF0QcWvpLAyay0bB2Ag@mail.gmail.com> (raw)
In-Reply-To: <7vip1wmahf.fsf@alter.siamese.dyndns.org>

On Sun, Jun 2, 2013 at 5:08 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> It's _very_ slow in many cases, and there's really no point in fetching
>> *everything* from the remote just for completion. In many cases it might
>> be faster for the user to type the whole thing.
>
> Besides, if I understand the use of __git_refs correctly, it is
> primarily about completing things like
>
>         git checkout -b topic origin/<TAB>
>
> where you actively want _local_ copies of what you currently have in
> refs/remotes/origin/, not what you would get if you were to fetch
> and then type the command again, so in that sense, using ls-remote
> is a wrong thing to do in the first place.

Yeah, but we wouldn't use ls-remote in those cases, only when __gitdir
is not available. Try 'git checkout <TAB>' outside a git repository.

> This however may need to be made optional if this is also being used
> to complete
>
>         git fetch git://g.k.org/pub/scm/git/git.git/ <TAB>
>
> to list what can be fetched, but I do not think that is a very
> common thing to do (you either know what you want to fetch, in which
> case you do not complete but copy & paste, or more likely you have a
> named remote and fetch the whole thing).

Indeed. And it doesn't make sense to punish the typical use-cases
because of the atypical ones.

Besides:

git fetch git://g.k.org/pub/scm/git/git.git/ refs/<TAB>

Would still complete everything.

-- 
Felipe Contreras

      reply	other threads:[~2013-06-02 22:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29  3:20 [PATCH] completion: avoid ls-remote in certain scenarios Felipe Contreras
2013-05-29  7:44 ` SZEDER Gábor
2013-06-01 13:58   ` Felipe Contreras
2013-06-01 18:25 ` Ramkumar Ramachandra
2013-06-02 22:08 ` Junio C Hamano
2013-06-02 22:57   ` Felipe Contreras [this message]

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=CAMP44s0or-wtNc85HPO8hMA47xbcXVOcF0QcWvpLAyay0bB2Ag@mail.gmail.com \
    --to=felipe.contreras@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).