test patch hunk editing with "commit -p -m"

Add (failing) tests: with commit changing the environment to let hooks
know that no editor will be used (by setting GIT_EDITOR to ":"), the
"edit hunk" functionality does not work (no editor is launched and the
whole hunk is committed).

Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit: fix patch hunk editing with "commit -p -m"

Don't change git environment: move the GIT_EDITOR=":" override to the
hook command subprocess, like it's already done for GIT_INDEX_FILE.

Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge: fix GIT_EDITOR override for commit hook

Don't set GIT_EDITOR to ":" when calling prepare-commit-msg hook if the
editor is going to be called (e.g. with "merge -e").

Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge hook tests: fix and update tests

- update 'no editor' hook test and add 'editor' hook test
- make sure the tree is reset to a clean state after running a test
  (using test_when_finished) so later tests are not impacted

Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command: mark run_hook_with_custom_index as deprecated

Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
test-lib.sh: do not "echo" caller-supplied strings

In some places we "echo" a string that is supplied by the calling
test script and may contain backslash sequences. The echo command
of some shells, most notably "dash", interprets these backslash
sequences (POSIX.1 allows this) which may scramble the test
output.

Signed-off-by: Uwe Storbeck <uwe@ibr.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
add: use struct argv_array in run_add_interactive()

run_add_interactive() in builtin/add.c manually computes array bounds
and allocates a static args array to build the add--interactive command
line, which is error-prone. Use the argv-array helper functions instead.

Signed-off-by: Fabian Ruch <bafain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitk: Document new config file location

User config file location now complies with XDG base directory specification

Signed-off-by: Astril Hayato <astrilhayato@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'tc/commit-dry-run-exit-status-tests' into jch

* tc/commit-dry-run-exit-status-tests:
  demonstrate git-commit --dry-run exit code behaviour
Merge branch 'jk/shallow-update-fix' into jch

Serving objects from a shallow repository needs to write a
temporary file to be used, but the serving upload-pack may not have
write access to the repository which is meant to be read-only.

* jk/shallow-update-fix:
  shallow: verify shallow file after taking lock
  shallow: automatically clean up shallow tempfiles
  shallow: use stat_validity to check for up-to-date file
Merge branch 'cp/am-patch-format-doc' into jch

* cp/am-patch-format-doc:
  Documentation/git-am: typofix
  Documentation/git-am: Document supported --patch-format options

# Conflicts:
# 	Documentation/git-am.txt
Merge branch 'nd/tag-version-sort' into jch

Allow v1.9.0 sorted before v1.10.0 in "git tag --list" output.

* nd/tag-version-sort:
  tag: support --sort=<spec>
Merge branch 'dk/skip-prefix-scan-only-once' into jch

Update implementation of skip_prefix() to scan only once; given
that most "prefix" arguments to the inline function are constant
strings whose strlen() can be determined at the compile time, this
might actually make things worse with a compiler with sufficient
intelligence.

* dk/skip-prefix-scan-only-once:
  skip_prefix(): scan prefix only once
Merge branch 'jc/stash-pop-not-popped' into jch

"stash pop", upon failing to apply the stash, refrains from
discarding the stash to avoid information loss.  Be more explicit
in the error message.

The wording may want to get a bit more bikeshedding.

* jc/stash-pop-not-popped:
  stash pop: mention we did not drop the stash upon failing to apply
Merge branch 'jn/wt-status' into jch

Unify the codepaths that format new/modified/changed sections and
conflicted paths in the "git status" output and make it possible to
properly internationalize their output.

* jn/wt-status:
  wt-status: lift the artificual "at least 20 columns" floor
  wt-status: i18n of section labels
  wt-status: extract the code to compute width for labels
  wt-status: make full label string to be subject to l10n
Merge branch 'nd/upload-pack-shallow' into jch

* nd/upload-pack-shallow:
  upload-pack: send shallow info over stdin to pack-objects

# Conflicts:
# 	t/t5537-fetch-shallow.sh
# 	upload-pack.c
Merge branch 'es/sh-i18n-envsubst' into jch

* es/sh-i18n-envsubst:
  sh-i18n--envsubst: retire unused string_list_member()
Merge branch 'lt/request-pull' into jch

Discard the accumulated "heuristics" to guess from which branch the
result wants to be pulled from and make sure what the end user
specified is not second-guessed by "git request-pull", to avoid
mistakes.

* lt/request-pull:
  request-pull: documentation updates
  request-pull: resurrect "pretty refname" feature
  request-pull: test updates
  request-pull: pick up tag message as before
  request-pull: allow "local:remote" to specify names on both ends
  request-pull: more strictly match local/remote branches
Merge branch 'jk/mv-submodules-fix' into jch

* jk/mv-submodules-fix:
  mv: prevent mismatched data when ignoring errors.
  builtin/mv: fix out of bounds write

# Conflicts:
# 	t/t7001-mv.sh
Merge branch 'nd/indent-fix-connect-c' into jch

* nd/indent-fix-connect-c:
  connect.c: SP after "}", not TAB