Make 'git merge' simplify parents earlier

.. and then we can use that simplified parent list to check whether the
merge is a fast-forward or not.

This makes us do proper fast-forward merges even for octopus merges,
which could otherwise result in "merge commit" that only had one actual
parent, and should have been a fast-forward.

Odd-case-triggered-by: James Morris <jmorris@namei.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
tests: add initial bash completion tests

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'jk/rebase-i-submodule-conflict-only' into jch

Giving "--continue" to a conflicted "rebase -i" session skipped a commit
that only results in changes to submodules.

Will merge to 'next'.

By John Keeping
* jk/rebase-i-submodule-conflict-only:
  rebase -i continue: don't skip commits that only change submodules
Merge branch 'ms/remote-usage-string' into jch

As an independent follow-up, we may want to rethink how the overall usage
string and subcommand usage strings are maintained.

Will merge to 'next'.

By Michael Schubert
* ms/remote-usage-string:
  remote: update builtin usage
Merge branch 'pw/git-p4' into jch

Will merge to 'next'.

By Pete Wyckoff
* pw/git-p4:
  git p4: use "git p4" directly in tests
  git p4: update name in script
  git-p4: move to toplevel
Merge branch 'jn/debian-customizes-default-editor' into jch

Will merge to 'next'.

By Jonathan Nieder
* jn/debian-customizes-default-editor:
  var doc: advertise current DEFAULT_PAGER and DEFAULT_EDITOR settings
  var doc: default editor and pager are configurable at build time
Merge branch 'rl/show-empty-prefix' into jch

Will merge to 'next'.

By Ross Lagerwall
* rl/show-empty-prefix:
  rev-parse --show-prefix: add in trailing newline
Merge branch 'it/fetch-pack-many-refs' into jch

Will merge to 'next'.

By Ivan Todoroski
* it/fetch-pack-many-refs:
  remote-curl: main test case for the OS command line overflow
  fetch-pack: test cases for the new --stdin option
  remote-curl: send the refs to fetch-pack on stdin
  fetch-pack: new --stdin option to read refs from stdin

Conflicts:
	t/t5500-fetch-pack.sh
Merge branch 'sl/test-wc-l-line-count' into jch

Will merge to 'next'.

By Stefano Lattarini
* sl/test-wc-l-line-count:
  tests: modernise style: more uses of test_line_count
Merge branch 'mh/ref-api' into jch

Allows walking only a sub-hierarchy in refs/*.

Will merge to 'next'.

By Michael Haggerty
* mh/ref-api:
  do_for_each_ref(): only iterate over the subtree that was requested
  refs: store references hierarchically
  sort_ref_dir(): simplify logic
  refs.c: rename ref_array -> ref_dir
  struct ref_entry: nest the value part in a union
  check_refname_component(): return 0 for zero-length components
  free_ref_entry(): new function
  names_conflict(): simplify implementation
  repack_without_ref(): reimplement using do_for_each_ref_in_array()
  do_for_each_ref_in_arrays(): new function
  do_for_each_ref_in_array(): new function
  refs: manage current_ref within do_one_ref()
  refs.c: reorder definitions more logically
Merge branch 'rs/commit-list-sort-in-batch' into jch

Will merge to 'next'.

By René Scharfe
* rs/commit-list-sort-in-batch:
  revision: insert unsorted, then sort in prepare_revision_walk()
  commit: use mergesort() in commit_list_sort_by_date()
  add mergesort() for linked lists
Merge branch 'jc/maint-blame-minimal' into jch

"git blame" started missing quite a few changes from the origin since we
stopped using the diff minimalization by default in v1.7.2 era.

Will merge to 'next'.

* jc/maint-blame-minimal:
  blame: accept --need-minimal
Merge branch 'ld/git-p4-tags-and-labels' into jch

By Luke Diamand
* ld/git-p4-tags-and-labels:
  git p4: import/export of labels to/from p4
  git p4: Fixing script editor checks
Merge branch 'jk/repack-no-explode-objects-from-old-pack' into jch

Will merge to 'next'.

By Jeff King
* jk/repack-no-explode-objects-from-old-pack:
  gc: do not explode objects which will be immediately pruned
Merge branch 'jh/apply-free-patch' into jch

Valgrind reports quite a lot of discarded memory inside apply.

Will merge to 'next'.

By Junio C Hamano (8) and Jared Hance (1)
* jh/apply-free-patch:
  apply: document buffer ownership rules across functions
  apply: tighten constness of line buffer
  apply: drop unused macro
  apply: free unused fragments for submodule patch
  apply: free patch->result
  apply: release memory for fn_table
  apply: free patch->{def,old,new}_name fields
  apply: rename free_patch() to free_patch_list()
  apply: do not leak patches and fragments
Merge branch 'fc/completion-tests' into jch

Will merge to 'next'.

By Felipe Contreras
* fc/completion-tests:
  tests: add initial bash completion tests
fixup? 6e17b8c
Merge branch 'hv/submodule-recurse-push' into pu

Will merge to 'next'.

By Heiko Voigt
* hv/submodule-recurse-push:
  push: teach --recurse-submodules the on-demand option
  Refactor submodule push check to use string list instead of integer
  Teach revision walking machinery to walk multiple times sequencially

Conflicts:
	transport.h
Merge branch 'mk/gitweb-diff-hl' into pu

Will merge to 'next'.

By Michał Kiedrowicz (7) and Jakub Narębski (1)
* mk/gitweb-diff-hl:
  gitweb: Refinement highlightning in combined diffs
  gitweb: Highlight interesting parts of diff
  gitweb: Push formatting diff lines to print_diff_chunk()
  gitweb: Use print_diff_chunk() for both side-by-side and inline diffs
  gitweb: Extract print_sidebyside_diff_lines()
  gitweb: Pass esc_html_hl_regions() options to esc_html()
  gitweb: esc_html_hl_regions(): Don't create empty <span> elements
  gitweb: Use descriptive names in esc_html_hl_regions()
Merge branch 'pw/fast-import-dataref-parsing' into pu

Will merge to 'next'.

By Pete Wyckoff
* pw/fast-import-dataref-parsing:
  fast-import: tighten parsing of datarefs