git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-completion.bash: Silence not a valid object errors
@ 2013-01-11  8:06 Dylan Smith
  2013-01-11 15:27 ` Jeff King
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dylan Smith @ 2013-01-11  8:06 UTC (permalink / raw)
  To: git

Trying to complete the command

  git show master:./file

would cause a "Not a valid object name" error to be output on standard
error. Silence the error so it won't appear on the command line.

Signed-off-by: Dylan Smith <dylan.ah.smith@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 0b77eb1..d4c7bfe 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -397,7 +397,7 @@ __git_complete_revlist_file ()
 		*)   pfx="$ref:$pfx" ;;
 		esac
 
-		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" \
+		__gitcomp_nl "$(git --git-dir="$(__gitdir)" ls-tree "$ls" 2>/dev/null \
 				| sed '/^100... blob /{
 				           s,^.*	,,
 				           s,$, ,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-11 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-11  8:06 [PATCH] git-completion.bash: Silence not a valid object errors Dylan Smith
2013-01-11 15:27 ` Jeff King
2013-01-11 16:45 ` Junio C Hamano
2013-01-11 21:12 ` Manlio Perillo

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).