git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH 1/4] completion: squelch stray errors in sparse-checkout completion
Date: Fri, 24 Nov 2023 12:05:02 -0800	[thread overview]
Message-ID: <CABPp-BGn0YT4e_ScWVR5riiuZ5kDd7X41WV-xMe91BGeuQ5xPQ@mail.gmail.com> (raw)
In-Reply-To: <20231124183938.GB11157@szeder.dev>

On Fri, Nov 24, 2023 at 10:39 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
>
> On Thu, Nov 23, 2023 at 05:44:05PM +0000, Elijah Newren via GitGitGadget wrote:
> > From: Elijah Newren <newren@gmail.com>
> >
> > If, in the root of a project, one types
> >
> >     git sparse-checkout set --cone ../<TAB>
> >
> > then an error message of the form
> >
> >     fatal: ../: '../' is outside repository at '/home/newren/floss/git'
> >
> > is written to stderr, which munges the users view of their own command.
> > Squelch such messages.
> >
> > Signed-off-by: Elijah Newren <newren@gmail.com>
> > ---
> >  contrib/completion/git-completion.bash | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
> > index ba5c395d2d8..6fced40d04c 100644
> > --- a/contrib/completion/git-completion.bash
> > +++ b/contrib/completion/git-completion.bash
> > @@ -3014,7 +3014,7 @@ __gitcomp_directories ()
> >                       COMPREPLY+=("$c/")
> >                       _found=1
> >               fi
> > -     done < <(git ls-tree -z -d --name-only HEAD $_tmp_dir)
> > +     done < <(git ls-tree -z -d --name-only HEAD $_tmp_dir 2>/dev/null)
>
> It would be better to use the __git wrapper instead, like the wast
> majority of git invocations in our completion script, because it not
> only takes care of squelching standard error, but also takes into
> account any -C dir and/or --git-dir options present on the command
> line.
>
> e15098a314 (completion: consolidate silencing errors from git
> commands, 2017-02-03)

Ooh, nice!  Thanks for the pointer, I was unaware.  I'll make that change.

  reply	other threads:[~2023-11-24 20:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23 17:44 [PATCH 0/4] Sparse checkout completion fixes Elijah Newren via GitGitGadget
2023-11-23 17:44 ` [PATCH 1/4] completion: squelch stray errors in sparse-checkout completion Elijah Newren via GitGitGadget
2023-11-24 18:39   ` SZEDER Gábor
2023-11-24 20:05     ` Elijah Newren [this message]
2023-11-23 17:44 ` [PATCH 2/4] completion: fix logic for determining whether cone mode is active Elijah Newren via GitGitGadget
2023-11-23 17:44 ` [PATCH 3/4] completion: avoid misleading completions in cone mode Elijah Newren via GitGitGadget
2023-11-23 17:44 ` [PATCH 4/4] completion: avoid user confusion in non-cone mode Elijah Newren via GitGitGadget
2023-11-24  1:19   ` Junio C Hamano
2023-11-24 15:28     ` Elijah Newren
2023-11-27  1:39       ` Junio C Hamano
2023-12-03  5:57         ` Elijah Newren
2023-11-26  7:51 ` [PATCH v2 0/4] Sparse checkout completion fixes Elijah Newren via GitGitGadget
2023-11-26  7:51   ` [PATCH v2 1/4] completion: squelch stray errors in sparse-checkout completion Elijah Newren via GitGitGadget
2023-11-26  7:51   ` [PATCH v2 2/4] completion: fix logic for determining whether cone mode is active Elijah Newren via GitGitGadget
2023-11-26  7:51   ` [PATCH v2 3/4] completion: avoid misleading completions in cone mode Elijah Newren via GitGitGadget
2023-11-26  7:51   ` [PATCH v2 4/4] completion: avoid user confusion in non-cone mode Elijah Newren via GitGitGadget
2023-12-03  5:57   ` [PATCH v3 0/4] Sparse checkout completion fixes Elijah Newren via GitGitGadget
2023-12-03  5:57     ` [PATCH v3 1/4] completion: squelch stray errors in sparse-checkout completion Elijah Newren via GitGitGadget
2023-12-03  5:57     ` [PATCH v3 2/4] completion: fix logic for determining whether cone mode is active Elijah Newren via GitGitGadget
2023-12-03  5:57     ` [PATCH v3 3/4] completion: avoid misleading completions in cone mode Elijah Newren via GitGitGadget
2023-12-03  5:57     ` [PATCH v3 4/4] completion: avoid user confusion in non-cone mode Elijah Newren via GitGitGadget
2023-12-03 13:15       ` Junio C Hamano

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=CABPp-BGn0YT4e_ScWVR5riiuZ5kDd7X41WV-xMe91BGeuQ5xPQ@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=szeder.dev@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).