From: Nguyen Thai Ngoc Duy Date: Fri, 22 Oct 2010 01:47:31 GMT Subject: Re: [PATCH v2 2/4] run_builtin(): save "-h" detection result for later use Message-ID: In-Reply-To: <7vsjzzrw6d.fsf@alter.siamese.dyndns.org> 2010/10/22 Junio C Hamano : > Nguyễn Thái Ngọc Duy writes: > >> When run_builtin() sees "-h" as the first argument, it assumes: >> >>  - this is the call for help usage >>  - the real git command will only print help usage then exit >> >> So it skips all setup in this case.  Unfortunately, some commands do >> other things before calling parse_options(), which is often where the >> help usage is printed.  Some of those things may try to access the >> repository unnecessarily. If a repository is broken, the command may >> die() before it prints help usage, not really helpful. > > What does die() message say in that case?  If it says "your repository is > broken", that may be more useful than giving a help message.  I dunno. I should have written "if repository access is broken" (i.e. .git has not been found, then somewhere access to .git is requested and .git is set up automatically). But I'm chasing a ghost here. And the impact to "-h" is probably nothing (how can accessing a wrong .git impacts a static help string?). I'll take the series back. There are more important things to work on than this. -- Duy