git-submodule.sh: avoid "test <cond> -a/-o <cond>"

The construct is error-prone; "test" being built-in in most modern
shells, the reason to avoid "test <cond> && test <cond>" spawning
one extra process by using a single "test <cond> -a <cond>" no
longer exists.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SQUASH: misconversion breakage fix

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh: avoid "echo" path-like values

SysV-derived implementation of "echo" interprets some backslash
sequences as special instruction, e.g. "echo 'ab\c'" shows an
incomplete line with 'a' and 'b' on it.  Avoid using it when showing
a path-like values in the script.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t9001: avoid non-portable '\n' with sed

t9001 used a '\n' in a sed expression to split one line into two
lines, but the usage of '\n' in the "replacement string" is not
portable.

The '\n' can be used to match a newline in the "pattern space",
but otherwise the meaning of '\n' is unspecified in POSIX.

- Gnu versions of sed will treat '\n' as a newline character.
- Other versions of sed (like /usr/bin/sed under Mac OS X)
  simply ignore the '\' before the 'n', treating '\n' as 'n'.

For reference see:
pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html
http://www.gnu.org/software/sed/manual/sed.html

As the test already requires perl as a prerequisite, use perl
instead of sed.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'mt/patch-id-stable' (early part) into jch

* 'mt/patch-id-stable' (early part):
  patch-id-test: test stable and unstable behaviour
  test: add test_write_lines helper
  patch-id: make it stable against hunk reordering
Merge branch 'mt/patch-id-stable' (early part) into jch

* 'mt/patch-id-stable' (early part):
  t4204-patch-id.sh: default is now stable
  patch-id: change default to stable
Merge branch 'mt/patch-id-stable' into jch

Introduce a new way to compute patch-id for a patch that is not
affected by the order of the paths that appear in the input.

* mt/patch-id-stable:
  test doc: test_write_lines does not split its arguments
Merge branch 'cb/byte-order' into jch

Compatibility enhancement for Solaris.

* cb/byte-order:
  compat/bswap.h: fix endianness detection
  compat/bswap.h: restore preference __BIG_ENDIAN over BIG_ENDIAN
  compat/bswap.h: detect endianness on more platforms that don't use BYTE_ORDER
Merge branch 'cc/replace-edit' into jch

"git replace" learns a new "--edit" option.

* cc/replace-edit:
  Documentation: replace: describe new --edit option
  replace: add --edit to usage string
  replace: add tests for --edit
  replace: die early if replace ref already exists
  replace: refactor checking ref validity
  replace: make sure --edit results in a different object
  replace: add --edit option
  replace: factor object resolution out of replace_object
  replace: use OPT_CMDMODE to handle modes
  replace: refactor command-mode determination
Merge branch 'mt/send-email-cover-to-cc' (early part) into jch

* 'mt/send-email-cover-to-cc' (early part):
  test/send-email: to-cover, cc-cover tests
  git-send-email: two new options: to-cover, cc-cover
Merge branch 'jk/do-not-run-httpd-tests-as-root' into jch

* jk/do-not-run-httpd-tests-as-root:
  t/lib-httpd: require SANITY prereq
Merge branch 'sk/wincred' into jch

* sk/wincred:
  wincred: avoid overwriting configured variables
  wincred: add install target
Merge branch 'jk/argv-array-for-child-process' into jch

* jk/argv-array-for-child-process:
  argv-array: drop "detach" code
  get_importer: use run-command's internal argv_array
  get_exporter: use argv_array
  get_helper: use run-command's internal argv_array
  git_connect: use argv_array
  run_column_filter: use argv_array
  run-command: store an optional argv_array
Merge branch 'jk/diff-files-assume-unchanged' into jch

* jk/diff-files-assume-unchanged:
  run_diff_files: do not look at uninitialized stat data
Merge branch 'jk/report-fail-to-read-objects-better' into jch

* jk/report-fail-to-read-objects-better:
  open_sha1_file: report "most interesting" errno
Merge branch 'rr/rebase-autostash-fix' into jch

* rr/rebase-autostash-fix:
  rebase -i: test "Nothing to do" case with autostash
  rebase -i: handle "Nothing to do" case with autostash
Merge branch 'sk/windows-unc-path' into jch

* sk/windows-unc-path:
  Windows: Allow using UNC path for git repository
Merge branch 'as/pretty-truncate' into jch

* as/pretty-truncate:
  pretty.c: format string with truncate respects logOutputEncoding
  t4205, t6006: add tests that fail with i18n.logOutputEncoding set
  t4205 (log-pretty-format): use `tformat` rather than `format`
  t4041, t4205, t6006, t7102: don't hardcode tested encoding value
  t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
Merge branch 'jk/diff-follow-must-take-one-pathspec' into jch

* jk/diff-follow-must-take-one-pathspec:
  move "--follow needs one pathspec" rule to diff_setup_done

# Conflicts:
# 	diff.c
Merge branch 'jk/daemon-tolower' into jch

* jk/daemon-tolower:
  daemon/config: factor out duplicate xstrdup_tolower