run-command: be more informative about what failed

While debugging an error with verify_signed_buffer() the error
messages from run-command weren't very useful:

 error: cannot create pipe for gpg: Too many open files
 error: could not run gpg.

because they didn't indicate *which* pipe couldn't be created.

Print which pipe failed to be created in the error message so we
can more easily debug similar problems in the future.

For example, the above error now prints:

 error: cannot create standard error pipe for gpg: Too many open files
 error: could not run gpg.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rename {git- => git}remote-helpers.txt

When looking up a topic via "git help <topic>", git-help prepends "git-"
to topics that are the names of commands (either builtin or found on the
path) and "git" (no hyphen) to any other topic name.

"git-remote-helpers" is not the name of a command, so "git help
remote-helpers" looks for "gitremote-helpers" and does not find it.

Fix this by renaming "git-remote-helpers.txt" to
"gitremote-helpers.txt".

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mergetools: teach tortoisemerge to handle filenames with SP correctly

TortoiseGitMerge, unlike TortoiseMerge, can be told to handle paths
with spaces in them by using -option "$FILE" (not -option:"$FILE",
which does not work for such paths) syntax.

This change was necessary because of MSYS path mangling [1], the ":"
after the "base" etc. arguments to TortoiseMerge caused the whole
argument instead of just the file name to be quoted in case of file
names with spaces. So TortoiseMerge was passed

    "-base:new file.txt"

instead of

    -base:"new file.txt"

(including the quotes). To work around this, TortoiseGitMerge does not
require the ":" after the arguments anymore which fixes handling file
names with spaces [2] (as written above).

[1] http://www.mingw.org/wiki/Posix_path_conversion
[2] https://github.com/msysgit/msysgit/issues/57

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Reported-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile: explicitly set target name for autogenerated dependencies

"gcc -MF depfile -MMD -MP -c -o path/to/file.o" produces a makefile
snippet named "depfile" describing what files are needed to build the
target given by "-o".  When ccache versions before v3.0pre0~187 (Fix
handling of the -MD and -MDD options, 2009-11-01) run, they execute

	gcc -MF depfile -MMD -MP -E

instead to get the final content for hashing.  Notice that the "-c -o"
combination is replaced by "-E".  The result is a target name without
a leading path.

Thus when building git with such versions of ccache with
COMPUTE_HEADER_DEPENDENCIES enabled, the generated makefile snippets
define dependencies for the wrong target:

	$ make builtin/add.o
	GIT_VERSION = 1.7.8.rc3
	    * new build flags or prefix
	    CC builtin/add.o
	$ head -1 builtin/.depend/add.o.d
	add.o: builtin/add.c cache.h git-compat-util.h compat/bswap.h strbuf.h \

After a change in a header file, object files in a subdirectory are
not automatically rebuilt by "make":

	$ touch cache.h
	$ make builtin/add.o
	$

Luckily we can prevent trouble by explicitly supplying the name of the
target to ccache and gcc, using the -MQ option.  Do so.

Reported-and-tested-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reported-by: : 허종만 <jongman.heo@samsung.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'ss/mergetools-tortoise' into jch

Update mergetools to work better with newer merge helper tortoise ships.

Will merge to 'next'.

* ss/mergetools-tortoise:
  mergetools: teach tortoisemerge to handle filenames with SP correctly
  mergetools: support TortoiseGitMerge
Merge branch 'jn/auto-depend-workaround-buggy-ccache' into jch

* jn/auto-depend-workaround-buggy-ccache:
  Makefile: explicitly set target name for autogenerated dependencies
Merge branch 'ft/transport-report-segv' into jch

A failure to push due to non-ff while on an unborn branch
dereferenced a NULL pointer while showing an error message.

Will merge to 'next'.

* ft/transport-report-segv:
  push: fix segfault when HEAD points nowhere

Conflicts:
	transport.c
Merge branch 'ab/gitweb-use-same-scheme' into jch

Avoid mixed contents on a page coming via http and https when
gitweb is hosted on a https server.

Will merge to 'next'.

* ab/gitweb-use-same-scheme:
  gitweb: refer to picon/gravatar images over the same scheme
Merge branch 'nd/branch-error-cases' into jch

Fix various error messages and conditions in "git branch", e.g. we
advertised "branch -d/-D" to remove one or more branches but actually
implemented removal of zero or more branches---request to remove no
branches was not rejected.

Will merge to 'next'.

* nd/branch-error-cases:
  branch: let branch filters imply --list
  docs: clarify git-branch --list behavior
  branch: mark more strings for translation
  branch: give a more helpful message on redundant arguments
  branch: reject -D/-d without branch name
Merge branch 'sb/gpg-plug-fd-leak' into jch

Will merge to 'next'.

* sb/gpg-plug-fd-leak:
  gpg: close stderr once finished with it in verify_signed_buffer()
Merge branch 'sb/gpg-i18n' into jch

Will merge to 'next'.

* sb/gpg-i18n:
  gpg: allow translation of more error messages
Merge branch 'jk/python-styles' into jch

Will merge to 'next'.

* jk/python-styles:
  CodingGuidelines: add Python coding guidelines
###
Merge branch 'sp/smart-http-content-type-check' into jch

The smart HTTP clients forgot to verify the content-type that comes
back from the server side to make sure that the request is being
handled properly.

Will merge to 'next'.

* sp/smart-http-content-type-check:
  Verify Content-Type from smart HTTP servers
Merge branch 'ta/doc-no-small-caps' into jch

Update documentation to change "GIT" which was a poor-man's small
caps to "Git" which was the intended spelling.  Also change "git"
spelled in all-lowercase to "Git" when it refers to the system as
the whole or the concept it embodies, as opposed to the command the
end users would type.

Will merge to 'next'.

* ta/doc-no-small-caps:
  Documentation: StGit is the right spelling, not StGIT
  Documentation: describe the "repository" in repository-layout
  Documentation: add a description for 'gitfile' to glossary
  Documentation: do not use undefined terms git-dir and git-file
  Documentation: the name of the system is 'Git', not 'git'
  Documentation: avoid poor-man's small caps GIT

Conflicts:
	Documentation/git-cvsimport.txt
	Documentation/howto/maintain-git.txt
Merge branch 'jk/mergetool' into jch

Cleans up mergetool/difftool combo.

This is looking ready for 'next'.

* jk/mergetool:
  mergetools: simplify how we handle "vim" and "defaults"
  mergetool--lib: don't call "exit" in setup_tool
  mergetool--lib: improve show_tool_help() output
  mergetools/vim: remove redundant diff command
  git-difftool: use git-mergetool--lib for "--tool-help"
  git-mergetool: don't hardcode 'mergetool' in show_tool_help
  git-mergetool: remove redundant assignment
  git-mergetool: move show_tool_help to mergetool--lib
Merge branch 'da/mergetool-docs' into jch

Build on top of the clean-up done by jk/mergetool and automatically
generate the list of mergetool and difftool backends the build
supports to be included in the documentation.

Will merge to 'next'.

* da/mergetool-docs:
  doc: generate a list of valid merge tools
  mergetool--lib: list user configured tools in '--tool-help'
  fixup! doc: generate a list of valid merge tools
  fixup! mergetool--lib: add functions for finding available tools
  mergetool--lib: add functions for finding available tools
  mergetool--lib: improve the help text in guess_merge_tool()
  mergetool--lib: simplify command expressions

Conflicts:
	Documentation/Makefile
Merge branch 'sb/run-command-fd-error-reporting' into jch

Will merge to 'next'.

* sb/run-command-fd-error-reporting:
  run-command: be more informative about what failed
Merge branch 'bc/append-signed-off-by' into jch

Waiting for the final round of reroll before merging to 'next'.
After that we will go incremental.

* bc/append-signed-off-by:
  Unify appending signoff in format-patch, commit and sequencer
  format-patch: update append_signoff prototype
  t4014: more tests about appending s-o-b lines
  sequencer.c: teach append_signoff to avoid adding a duplicate newline
  sequencer.c: teach append_signoff how to detect duplicate s-o-b
  sequencer.c: always separate "(cherry picked from" from commit body
  sequencer.c: recognize "(cherry picked from ..." as part of s-o-b footer
  t/t3511: add some tests of 'cherry-pick -s' functionality
  t/test-lib-functions.sh: allow to specify the tag name to test_commit
  commit, cherry-pick -s: remove broken support for multiline rfc2822 fields
  sequencer.c: rework search for start of footer to improve clarity

Conflicts:
	builtin/log.c
	t/t4014-format-patch.sh
Merge branch 'jc/hidden-refs' into jch

Allow the server side to unclutter the refs/ namespace it shows to
the client.  Optionally allow requests for histories leading to the
tips of hidden refs by updated clients.

* jc/hidden-refs:
  WIP: receive.allowupdatestohidden
  fetch: fetch objects by their exact SHA-1 object names
  upload-pack: optionally allow fetching from the tips of hidden refs
  fetch: use struct ref to represent refs to be fetched
  parse_fetch_refspec(): clarify the codeflow a bit
  upload/receive-pack: allow hiding ref hierarchies
  upload-pack: simplify request validation
  upload-pack: share more code

Conflicts:
	builtin/receive-pack.c
	cache.h