All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: Matt Korostoff <mkorostoff@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH] contrib/completion: suppress stderror in bash
Date: Tue, 10 Feb 2015 10:31:11 -0800	[thread overview]
Message-ID: <xmqqegpxwrdc.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150210031008.Horde.1WYJ_81O2E96Rgv2xrVmqw1@webmail.informatik.kit.edu> ("SZEDER Gábor"'s message of "Tue, 10 Feb 2015 03:10:08 +0100")

SZEDER Gábor <szeder@ira.uka.de> writes:

>>> @@ -412,7 +412,7 @@ __git_refs_remotes ()
>>>  __git_remotes ()
>>>  {
>>>  	local i IFS=$'\n' d="$(__gitdir)"
>>> -	test -d "$d/remotes" && ls -1 "$d/remotes"
>>> +	test -d "$d/remotes" && ls -1 "$d/remotes" 2>/dev/null
>>>  	for i in $(git --git-dir="$d" config --get-regexp
>>> 'remote\..*\.url' 2>/dev/null); do
>>>  		i="${i#remote.}"
>>>  		echo "${i/.url*/}"
>
> Do I smell some bitrotting here?
>
> This function just lists all the defined remotes, first by listing the  
> directories under refs/remotes to get the "legacy" remotes and then  
> loops over 'git config's output to get the "modern" ones.  This  
> predates the arrival of the 'git remote' command in January 2007, so  
> it was really a long time ago.
>
> We should just run 'git remote' instead, shouldn't we?

Perhaps.  Is it sufficient to just make __git_remotes() a thin
wrapper around, i.e.

	__git_remotes ()
	{
		git remotes
	}

or do we need to munge its output further (I didn't look)?

  parent reply	other threads:[~2015-02-10 18:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 20:58 [PATCH] contrib/completion: suppress stderror in bash completion of git remotes Matt Korostoff
2015-02-09 21:00 ` Matt Korostoff
2015-02-09 21:09 ` Junio C Hamano
2015-02-10  0:08   ` Matt Korostoff
2015-02-10  2:10   ` [PATCH] contrib/completion: suppress stderror in bash SZEDER Gábor
2015-02-10 15:25     ` [PATCH] contrib/completion: deprecate __git_remotes in bash completion Matt Korostoff
2015-02-10 18:31     ` Junio C Hamano [this message]
2015-02-10 19:16       ` [PATCH] contrib/completion: suppress stderror in bash SZEDER Gábor
2015-03-04 14:04         ` SZEDER Gábor
2015-03-04 14:10           ` [PATCH 1/2] completion: add a test for __git_remotes() helper function SZEDER Gábor
2015-03-04 14:10             ` [PATCH 2/2] completion: simplify __git_remotes() SZEDER Gábor

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=xmqqegpxwrdc.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mkorostoff@gmail.com \
    --cc=szeder@ira.uka.de \
    /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.