run-command: add new check_command helper

And persistent_waitpid() to recover the information from the last run.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport-helper: check if remote helper is alive

Otherwise transport-helper will continue checking for refs and other
things what will confuse the user more.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'fc/transport-helper-waitpid' into pu

* fc/transport-helper-waitpid:
  transport-helper: check if remote helper is alive
  run-command: add new check_command helper
Merge branch 'jk/diffcore-break-divzero' into pu

* jk/diffcore-break-divzero:
  diffcore-break: don't divide by zero
Merge branch 'jk/bisect-prn-unsigned' into pu

* jk/bisect-prn-unsigned:
  bisect: avoid signed integer overflow
Merge branch 'jk/set-upstream-error-cases' into pu

* jk/set-upstream-error-cases:
  branch: give advice when tracking start-point is missing
  branch: mention start_name in set-upstream error messages
  branch: improve error message for missing --set-upstream-to ref
  branch: factor out "upstream is not a branch" error messages
  t3200: test --set-upstream-to with bogus refs
builtin/help.c: split "-a" processing into two

"help -a" (help all) gives the list of available commands and then
further gives hints on the use of "git help".   Separate these into
two steps, because we will add "help -g" (help guides) that want to
also show the overall hints after it is done.

While at it, change the definition of the "-a" option to use OPT_BOOL,
not the deprecated OPT_BOOLEAN.  We do not behave differently when
the user gives the "-a" option multiple times, e.g. "git help -a -a".

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/help.c: add --guide option

Logic, but no actions, included.

The --all commands option, if given, will display the list of
available commands.

The --guide option's list of guides will then be displayed.

The common commands list is only displayed if neither option, nor a
command or guide name, is given.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/help.c: add list_common_guides_help() function

This implements what "help -g" introduced in the previous step does.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
help: mention -a and -g option, and 'git help <concept>' usage.

Reword the overall help given at the end of "git help -a/-g" to
mention how to get help on individual commands and concepts.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
doc: include --guide option description for "git help"

Note that the ability to display an individual guide was always
possible. Include this in the update.

Also tell readers how git(1) can be accessed, especially for Git for
Windows users who do not have the 'man' command.  Likewise include a
commentary on how to access this page (Catch 22).

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'po/help-guides' into pu

* po/help-guides:
  doc: include --guide option description for "git help"
  help: mention -a and -g option, and 'git help <concept>' usage.
  builtin/help.c: add list_common_guides_help() function
  builtin/help.c: add --guide option
  builtin/help.c: split "-a" processing into two