Thread (41 messages) flat view 41 messages, 4 authors, 2016-06-15

Re: [PATCH v2 2/4] run_builtin(): save "-h" detection result for later use

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:49:50

2010/10/22 Junio C Hamano [off-list ref]:
Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help