checkout: record full target ref in reflog

This simplifies parsing later on because the parser does not need to
do dwim on the target (and later dwim may be ambiguous if new refs are
added).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wt-status: split wt_status_state parsing function out

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wt-status: move wt_status_get_state() out to wt_status_print()

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
status: show the ref that is checked out, even if it's detached

When a remote ref or a tag is checked out, HEAD is automatically
detached. There is no user friendly way to find out what ref is
checked out in this case. This patch digs in reflog for this
information and shows "Detached from origin/master" or "Detached from
v1.8.0" instead of "Currently not on any branch".

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch: show more information when HEAD is detached

This prints more helpful info when HEAD is detached: is it detached
because of bisect or rebase? What is the original branch name in those
cases? Is it detached because the user checks out a remote ref or a
tag (and which one)?

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
show 'git help <guide>' usage, with examples

The git(1) man page must be accessed via 'git help git' on Git for Windows
as it has no 'man' command. And it prompts users to read the git(1) page,
rather than hoping they follow a subsidiary link within another
documentation page. The 'tutorial' is an obvious guide to suggest.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
help.c: use OPT_COUNTUP

rename deprecated option in preparation for 'git help --guides'.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
help.c: add --guide option

Logic, but no actions, included.

The --all commands option, if given, will display first.
The --guide option's list 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>
help.c: add list_common_guides_help() function

Re-use list_common_cmds_help but simply change the array name.
Candidate for future refactoring to pass a pointer to the array.

The common-guides.h list was generated with a simple variant of the
generate-cmdlist.sh and command-list.txt.

Do not list User-manual and Everday Git which not follow the naming
convention, nor gitrepository-layout which doesn't fit within the
name field size.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
help doc: include --guide option description

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>
Merge branch 'mg/qnx6' into pu

Still under discussion.
Not ready for inclusion.

* mg/qnx6:
  QNX: newer QNX 6.x.x is not so crippled
Merge branch 'jn/shell-disable-interactive' into pu

Expecting a reroll.
$gmane/216229

* jn/shell-disable-interactive:
  shell: pay attention to exit status from 'help' command
  shell doc: emphasize purpose and security model
Merge branch 'nd/branch-show-rebase-bisect-state' into pu

Expecting a reroll.
$gmane/215771

* nd/branch-show-rebase-bisect-state:
  branch: show more information when HEAD is detached
  status: show the ref that is checked out, even if it's detached
  wt-status: move wt_status_get_state() out to wt_status_print()
  wt-status: split wt_status_state parsing function out
  checkout: record full target ref in reflog
Merge branch 'mb/gitweb-highlight-link-target' into pu

Expecting a reroll.
$gmane/211935

* mb/gitweb-highlight-link-target:
  Highlight the link target line in Gitweb using CSS
Merge branch 'mb/remote-default-nn-origin' into pu

When the user does not specify what remote to interact with, we
often attempt to use 'origin'.  This can now be customized via a
configuration variable.

Expecting a reroll.
$gmane/210151

"The first remote becomes the default" bit is better done as a
separate step.

* mb/remote-default-nn-origin:
  Teach get_default_remote to respect remote.default.
  Test that plain "git fetch" uses remote.default when on a detached HEAD.
  Teach clone to set remote.default.
  Teach "git remote" about remote.default.
  Teach remote.c about the remote.default configuration setting.
  Rename remote.c's default_remote_name static variables.

Conflicts:
	builtin/remote.c
	t/t5505-remote.sh
Merge branch 'mg/unsigned-time-t' into pu

A few workarounds for systems with unsigned time_t.

* mg/unsigned-time-t:
  Fix time offset calculation in case of unsigned time_t
  date.c: fix unsigned time_t comparison
Merge branch 'hv/config-from-strbuf' into pu

* hv/config-from-strbuf:
  teach config parsing to read from strbuf
  config: make parsing stack struct independent from actual data source
  config: drop file pointer validity check in get_next_char()
  config: factor out config file stack management
Merge branch 'tr/line-log' into pu

* tr/line-log:
  log -L: :pattern:file syntax to find by funcname
  Implement line-history search (git log -L)
  Export rewrite_parents() for 'log -L'
  blame: introduce $ as "end of file" in -L syntax
  Refactor parse_loc

Conflicts:
	log-tree.c
Merge branch 'pc/subtree-add-before-fetch' into pu

Comments?

* pc/subtree-add-before-fetch:
  contrib/subtree: allow addition of remote branch with name not locally present
Merge branch 'gp/forbid-describe-all-match' into pu

"describe --match=<pattern> --all <commit>" ought to mean "use refs
that match <pattern> to describe <commit>; you do not have to limit
yourself to annotated tags."  But it doesn't.  Disable the
combination.

We may want to discard this if jc/describe topic turns out to be a
better idea.

* gp/forbid-describe-all-match:
  describe: make --all and --match=PATTERN mutually incompatible