Re: [PATCH 10/19] completion: use bash builtins to search for repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 9, 2012, 19:52 UTC
- Message-ID
- <7v62c5rv1q.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1336524290-30023-11-git-send-email-szeder@ira.uka.de>
SZEDER Gábor <szeder@ira.uka.de> writes:
Show 8 quoted lines
> ..., this > search is not that thorough either, as it doesn't check whether the > found '.git' directory or the directory pointed to by a gitfile is a > valid '.git' repository. > ... > Of course, stat()ing in C is much faster than in bash, so there is a > point when bash builtins will be slower than '$(git rev-parse > --git-dir)' despite all the fork()s+exec() overhead.
I'd feel safer if this new logic were an opt-in feature, at least in the beginning, with these pros-and-cons summarized near the beginning of the file to let the users choose if they want to use "exactly matches the command the prompt script is trying to help" version (i.e. rev-parse) vs "matches most of the time and faster under these conditions" version (i.e. the new logic).
Thanks.