Merge branch 'jn/fast-import-doc' into next

Will merge to 'next'.

By Jonathan Nieder
* jn/fast-import-doc:
  fast-import doc: cat-blob and ls responses need to be consumed quickly
Merge branch 'zj/upstream-error-message' into next

Will merge to 'next'.

By Zbigniew Jędrzejewski-Szmek
* zj/upstream-error-message:
  i18n: mark @{upstream} error messages for translation
  Be more specific if upstream branch is not tracked
  Provide better message for barnhc_wiht_tpyo@{u}
  Provide branch name in error message when using @{u}
  t1507: add tests to document @{upstream} behaviour
Merge branch 'jm/maint-strncpy-diff-no-index' into next

Will merge to 'next'.

By Jim Meyering
* jm/maint-strncpy-diff-no-index:
  diff: avoid stack-buffer-read-overrun for very long name
Merge branch 'bw/test-fix-grep-gnuism' into next

Fix two places that were the only place in the test suite that gave "a\+"
to platform grep and expected it to mean one or more "a", which is a
blatant GNUism.

Will merge to 'next'.

* bw/test-fix-grep-gnuism:
  t9400: fix gnuism in grep
Merge branch 'mb/fetch-call-a-non-branch-a-ref' into next

Replacement to use the origin side to paint the message broke badly.

By Marc Branchaud
* mb/fetch-call-a-non-branch-a-ref:
  fetch: describe new refs based on where it came from
  fetch: Give remote_ref to update_local_ref() as well

Conflicts:
	builtin/fetch.c
Merge branch 'rj/mingw-isguid' into next

By Ramsay Jones
* rj/mingw-isguid:
  compat/mingw.h: Set S_ISUID to prevent a fast-import test failure
Merge branch 'rj/sh-setup-mswin-pwd' into next

By Ramsay Jones
* rj/sh-setup-mswin-pwd:
  git-sh-setup.sh: Add an pwd() function for MinGW
Merge branch 'rj/submodule-mswin-path' into next

By Ramsay Jones
* rj/submodule-mswin-path:
  git-submodule.sh: Don't use $path variable in eval_gettext string

Conflicts:
	git-submodule.sh
Merge branch 'jk/repack-no-explode-objects-from-old-pack' into next

By Jeff King
* jk/repack-no-explode-objects-from-old-pack:
  gc: use argv-array for sub-commands
  argv-array: add a new "pushl" method
  argv-array: refactor empty_argv initialization
revert: add missing va_end

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tests: add tests for the __gitcomp() completion helper function

These tests check that trailing space, prefix, and suffix are added
correctly.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
completion: simplify __gitcomp_1

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
completion: simplify by using $prev

cword-1 is the previous word ($prev).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
completion: add missing general options

And add relevant tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
completion: avoid trailing space for --exec-path

"--exec-path" looks to the completion script like an unambiguous
successful completion, but it is wrong to emit a SP after it as if
declaring that we are done with completion; the user could be trying
to do

	git --exec-path; # print name of helper directory

or

	git --exec-path=/path/to/alternative/helper/dir <subcommand>

so the most helpful thing to do is to leave out the trailing space and
leave it to the operator to type an equal sign or carriage return
according to the situation.

[fc: added tests]

Cc: Andreas Schwab <schwab@linux-m68k.org>
Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
completion: fix completion after 'git --option <TAB>'

The bash completion doesn't work when certain options to git itself are
specified, e.g. 'git --no-pager <TAB>' errors out with

    error: invalid key: alias.--no-pager

The main _git() completion function finds out the git command name by
looping through all the words on the command line and searching for
the first word that is not a known option for the git command.

Unfortunately the list of known git options was not updated in a long
time, and newer options are not skipped but mistaken for a git command.
Such a misrecognized "command" is then passed to __git_aliased_command(),
which in turn passes it to a 'git config' query, hence the error.

Currently the following options are misrecognized for a git command:

  -c --no-pager --exec-path --html-path --man-path --info-path
  --no-replace-objects --work-tree= --namespace=

To fix this we could just update the list of options to be skipped,
but the same issue will likely arise, if the git command learns a new
option in the future.  Therefore, to make it more future proof against
new options, this patch changes that loop to skip all option-looking
words, i.e. words starting with a dash.

We also have to handle the '-c' option specially, because it takes a
configutation parameter in a separate word, which must be skipped,
too.

[fc: added tests]

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile: feed all header files to xgettext

Translation markers may be present in header files too. Make sure we
don't miss any.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
difftool: teach difftool to handle directory diffs

When 'difftool' is called to compare a range of commits that modify
more than one file, it opens a separate instance of the diff tool for
each file that changed.

The new '--dir-diff' option copies all the modified files to a temporary
location and runs a directory diff on them in a single instance of the
diff tool.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
difftool: print list of valid tools with '--tool-help'

Since bc7a96a (mergetool--lib: Refactor tools into separate files,
2011-08-18), it is possible to add a new diff tool by creating a simple
script in the '$(git --exec-path)/mergetools' directory.  Updating the
difftool help text is still a manual process, and the documentation can
easily go out of sync.

This commit teaches difftool the '--tool-help' option, which:
  - Reads the list of valid tools from 'mergetools/*'
  - Determines which of them are actually installed
  - Determines which are capable of diffing (i.e. not just a merge tool)
  - Prints the resulting list for the user

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jk/rebase-i-submodule-conflict-only'

Giving "--continue" to a conflicted "rebase -i" session skipped a commit
that only results in changes to submodules.

By John Keeping
* jk/rebase-i-submodule-conflict-only:
  rebase -i continue: don't skip commits that only change submodules