git-remote-mediawiki: allow stop/start-ing the test server

Previously, the user had to launch a complete re-install after a lighttpd
stop (e.g. a reboot).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-remote-mediawiki: fix encoding issue for UTF-8 media files

When a media file contains valid UTF-8, git-remote-mediawiki tried to be
too clever about the encoding, and the call to utf8::downgrade() on the
downloaded content was failing with

  Wide character in subroutine entry at git-remote-mediawiki line 583.

Instead, use $response->decode() to apply decoding linked to the
Content-Encoding: header, and return the content without attempting any
charset decoding.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
mergetool: document the default for --[no-]prompt

The original motivation of using the prompt was to confirm to run a
tool on this particular (as opposed to another) path, but the user
can also take the prompt as to confirm to run this (as opposed to
some other) tool.  The latter of which of course is irritating for
those who told which exact tool to use, which is the reason why we
are flipping the default.

During the review discussion of the patch, many people (including
the maintainer) missed that a user can find the prompt useful way to
skip running the tool on particular paths.  Clarify it by adding a
brief half-sentence to the description.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
patch-id: make it stable against hunk reordering

Patch id changes if users reorder file diffs that make up a patch.

As the result is functionally equivalent, a different patch id is
surprising to many users.
In particular, reordering files using diff -O is helpful to make patches
more readable (e.g. API header diff before implementation diff).

Add an option to change patch-id behaviour making it stable against
these kinds of patch change:
calculate SHA1 hash for each hunk separately and sum all hashes
(using a symmetrical sum) to get patch id

We use a 20byte sum and not xor - since xor would give 0 output
for patches that have two identical diffs, which isn't all that
unlikely (e.g. append the same line in two places).

The new behaviour is enabled
- when patchid.stable is true
- when --stable flag is present

Using a new flag --unstable or setting patchid.stable to false force
the historical behaviour.

In the documentation, clarify that patch ID can now be a sum of hashes,
not a hash.
Document how command line and config options affect the
behaviour.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
test: add test_write_lines helper

API and implementation as suggested by Junio.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
patch-id-test: test stable and unstable behaviour

Verify that patch ID supports an algorithm
that is stable against diff split and reordering.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
patch-id: change default to stable

--stable has been the default in 'next' for a few weeks with no ill
effects.
Change the default to that so that users don't have to remember to
enable it.

Update documentation to match behaviour change.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t4204-patch-id.sh: default is now stable

update test to match behaviour change

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'mk/doc-git-gui-display-untracked'

* mk/doc-git-gui-display-untracked:
  Documentation: git-gui: describe gui.displayuntracked
Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname'

* rh/prompt-pcmode-avoid-eval-on-refname:
  git-prompt.sh: don't put unsanitized branch names in $PS1
Merge branch 'km/git-svn-workaround-older-getopt-long'

* km/git-svn-workaround-older-getopt-long:
  t9117: use --prefix "" instead of --prefix=""
Merge branch 'mw/symlinks'

A finishing touch fix to a new change already in 'master'.

* mw/symlinks:
  setup: fix windows path buffer over-stepping
Git 2.0-rc2
Sync with 2.0-rc2

* master:
  Git 2.0-rc2
Merge branch 'fc/mergetool-prompt' into next

* fc/mergetool-prompt:
  mergetool: document the default for --[no-]prompt
Merge branch 'mm/mediawiki-encoding-fix' into next

* mm/mediawiki-encoding-fix:
  git-remote-mediawiki: fix encoding issue for UTF-8 media files
  git-remote-mediawiki: allow stop/start-ing the test server
Merge branch 'mt/patch-id-stable' (early part) into next

The first phase to introduce patch-id that is stable with use of
"diff -O<orderfile>", which is unfortunately incompatible with the
existing versions of Git.

* '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' into next

The second phase to make patch-id that is stable with use of "diff
-O<orderfile>", which is unfortunately incompatible with the
existing versions of Git, the default.

* mt/patch-id-stable:
  t4204-patch-id.sh: default is now stable
  patch-id: change default to stable