Use compat/regex on Cygwin

Cygwin's regex library does not pass git's tests, so don't use it. This
fixes failures in t4018 and t4034.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Cygwin has trustable filemode

The supported Cygwin distribution on supported Windows versions provides
complete support for POSIX filemodes, so enable this by default. git as
distributed by the Cygwin project is configured this way.

This fixes one testsuite failure:
t3300 test 17 (diff-index -M -p with mode change quotes funny filename)

Historical notes: Cygwin version 1.7 supports Windows-XP and newer, thus
dropped support for all OS variants that lack NTFS and/or the full win32
api, and since late 1.5 development, Cygwin maps POSIX modes to NTFS ACLs
by default.  Cygwin 1.5 supported OS variants that used FAT as the native
file system, and had optional methods for providing POSIX file modes on
top of FAT12/16 and NTFS, though not FAT32.  Also, support for POSIX modes
on top of FAT were dropped later in 1.5.  Thus, POSIX filemode support
could not be expected by default on a Cygwin 1.5 installation, but is
expected by default on a 1.7 installation.

Signed-off-by: Mark Levedahl <mlevedahl@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pull: require choice between rebase/merge on non-fast-forward pull

Because it is so easy to let Git handle automatically a trivial
merge with "git pull", a person who is new to Git may not realize
that the project s/he is interacting with may prefer a "rebase"
workflow.

Add a safety valve to fail "git pull" that does not explicitly
specify what branch from which repository to integrate your history
with, when it is neither a fast-forward or "already up-to-date",
until/unless the user expressed her preference between the two ways
of integration.

This can be an irritating backward incompatible change for old
timers, but it can be a one time irritation by doing:

    git config --global pull.rebase false

once to say "I will always --merge", and they'd not even notice.

    http://thread.gmane.org/gmane.comp.version-control.git/225146/focus=225326

for a full discussion.

Helped-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'mm/color-auto-default' into jch

* mm/color-auto-default:
  git add -e: Explicitly specify that patch should have no color
Merge branch 'jc/name-rev-exact-ref' into jch

Corrects the longstanding sloppiness in the implementation of
name-rev that conflated "we take commit-ish" and "differences
between tags and commits do not matter".

* jc/name-rev-exact-ref:
  describe: fix --contains when a tag is given as input
  name-rev: differentiate between tags and commits they point at
  describe: use argv-array
  name-rev: allow converting the exact object name at the tip of a ref
  name-ref: factor out name shortening logic from name_ref()
Merge branch 'tr/fd-gotcha-fixes' into jch

Two places we did not check return value (expected to be a file
descriptor) correctly.

* tr/fd-gotcha-fixes:
  run-command: dup_devnull(): guard against syscalls failing
  git_mkstemps: correctly test return value of open()
Merge branch 'jc/mailmap-case-insensitivity' into jch

The mailmap mechanism unnecessarily downcased the e-mail addresses
in the output, and also ignored the human name when it is a single
character name.

This now has become Eric Sunshine's series, even though it still is
under jc/ hierarchy.

* jc/mailmap-case-insensitivity:
  mailmap: style fixes
  mailmap: debug: avoid passing NULL to fprintf() '%s' conversion specification
  mailmap: debug: eliminate -Wformat field precision type warning
  mailmap: debug: fix malformed fprintf() format conversion specification
  mailmap: debug: fix out-of-order fprintf() arguments
  mailmap: do not downcase mailmap entries
  t4203: demonstrate loss of uppercase characters in canonical email
  mailmap: do not lose single-letter names
  t4203: demonstrate loss of single-character name in mailmap entry
Merge branch 'dw/request-pull-diag' into jch

* dw/request-pull-diag:
  request-pull: improve error message for invalid revision args
Merge branch 'mm/diff-no-patch-synonym-to-s' into jch

"git show -s" was less discoverable than it should be.

* mm/diff-no-patch-synonym-to-s:
  Documentation/git-log.txt: capitalize section names
  Documentation: move description of -s, --no-patch to diff-options.txt
  Documentation/git-show.txt: include common diff options, like git-log.txt
  diff: allow --patch & cie to override -s/--no-patch
  diff: allow --no-patch as synonym for -s
  t4000-diff-format.sh: modernize style
Merge branch 'tr/do-not-call-submodules-subprojects' into jch

* tr/do-not-call-submodules-subprojects:
  show-branch: fix description of --date-order
  apply, entry: speak of submodules instead of subprojects

# Conflicts:
# 	builtin/show-branch.c
Merge branch 'sb/parse-object-buffer-eaten' into jch

* sb/parse-object-buffer-eaten:
  parse_object_buffer: correct freeing the buffer
Merge branch 'tr/protect-low-3-fds' into jch

When "git" is spawned in such a way that any of the low 3 file
descriptors is closed, our first open() may yield file descriptor 2,
and writing error message to it would screw things up in a big way.

* tr/protect-low-3-fds:
  git: ensure 0/1/2 are open in main()
  daemon/shell: refactor redirection of 0/1/2 from /dev/null
Merge branch 'jx/clean-interactive' into jch

Add "interactive" mode to "git clean".

The early part to refactor relative path related helper functions
looked sensible.

* jx/clean-interactive:
  test: run testcases with POSIX absolute paths on Windows
  test: add t7301 for git-clean--interactive
  git-clean: add documentation for interactive git-clean
  git-clean: add ask each interactive action
  git-clean: add select by numbers interactive action
  git-clean: add filter by pattern interactive action
  git-clean: use a git-add-interactive compatible UI
  git-clean: add colors to interactive git-clean
  git-clean: show items of del_list in columns
  git-clean: add support for -i/--interactive
  git-clean: refactor git-clean into two phases
  write_name{_quoted_relative,}(): remove redundant parameters
  quote_path_relative(): remove redundant parameter
  quote.c: substitute path_relative with relative_path
  path.c: refactor relative_path(), not only strip prefix
  test: add test cases for relative_path
Merge branch 'es/blame-L-breakage' into jch

The refactoring made for parsing "-L" option recently to support
"git log -L" seems to have broken "git blame -L X,-5" to show 5
lines leading to X.

* es/blame-L-breakage:
  blame-options.txt: explain that -L <start> and <end> are optional
  blame-options.txt: place each -L option variation on its own line
  t8001/t8002 (blame): add blame -L :funcname tests
  t8001/t8002 (blame): add blame -L tests
  t8001/t8002 (blame): modernize style
  line-range: fix "blame -L X,-N" regression
Merge branch 'db/show-ref-head' into jch

The "--head" option to "git show-ref" was only to add "HEAD" to the
list of candidate refs to be filtered by the usual rules
(e.g. "--heads" that only show refs under refs/heads).  Change the
meaning of the option to always show "HEAD" regardless of what
filtering will be applied to any other ref (this is a backward
incompatible change, so I may need to add an entry to the Release
Notes).

* db/show-ref-head:
  show-ref: make --head always show the HEAD ref
Merge branch 'jk/gcc-function-attributes' into jch

Use the function attributes extension to catch mistakes in use of
our own variadic functions that use NULL sentinel at the end
(i.e. like execl(3)) and format strings (i.e. like printf(3)).

* jk/gcc-function-attributes:
  Add the LAST_ARG_MUST_BE_NULL macro
  wt-status: use "format" function attribute for status_printf
  use "sentinel" function attribute for variadic lists
  add missing "format" function attributes
Merge branch 'km/svn-1.8-serf-only' into jch

Subversion 1.8.0 that was recently released breaks older subversion
clients coming over http/https in various ways.

* km/svn-1.8-serf-only:
  Git.pm: revert _temp_cache use of temp_is_locked
  git-svn: allow git-svn fetching to work using serf
  Git.pm: add new temp_is_locked function
Merge branch 'nd/const-struct-cache-entry' into jch

* nd/const-struct-cache-entry:
  Convert "struct cache_entry *" to "const ..." wherever possible
Merge branch 'jk/t0008-sigpipe-fix' into jch

Fix for recent test breakage on 'master'.

* jk/t0008-sigpipe-fix:
  t0008: avoid SIGPIPE race condition on fifo
Merge branch 'mk/upload-pack-off-by-one-dead-code-removal' into jch

* mk/upload-pack-off-by-one-dead-code-removal:
  upload-pack: remove a piece of dead code