combine_diff: simplify intersect_paths() further

Linus once said:

    I actually wish more people understood the really core low-level
    kind of coding. Not big, complex stuff like the lockless name
    lookup, but simply good use of pointers-to-pointers etc. For
    example, I've seen too many people who delete a singly-linked
    list entry by keeping track of the "prev" entry, and then to
    delete the entry, doing something like

	if (prev)
	    prev->next = entry->next;
	else
	    list_head = entry->next;

    and whenever I see code like that, I just go "This person
    doesn't understand pointers". And it's sadly quite common.

    People who understand pointers just use a "pointer to the entry
    pointer", and initialize that with the address of the
    list_head. And then as they traverse the list, they can remove
    the entry without using any conditionals, by just doing a "*pp =
    entry->next".

Applying that simplification lets us lose 7 lines from this function
even while adding 2 lines of comment.

I was tempted to squash this into the original commit, but because
the benchmarking described in the commit log is without this
simplification, I decided to keep it a separate follow-up patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'ks/diff-c-with-diff-order' into jch

Teach combine-diff to honour the path-output-order imposed by
diffcore-order.

* ks/diff-c-with-diff-order:
  combine_diff: simplify intersect_paths() further
  combine-diff: combine_diff_path.len is not needed anymore
  combine-diff: optimize combine_diff_path sets intersection
  diff test: add tests for combine-diff with orderfile
  diffcore-order: export generic ordering interface
Merge branch 'lt/request-pull' into jch

* lt/request-pull:
  pull-request: test updates
  Make request-pull able to take a refspec of form local:remote
  Make 'git request-pull' more strict about matching
Merge branch 'jk/repack-honor-pack-keep' into jch

Optionally allow "git repack" to include objects that exist in kept
packs in newly created packfiles.

* jk/repack-honor-pack-keep:
  repack: add `repack.honorpackkeep` config var
Merge branch 'jk/color-for-more-pagers' into pu

'more' implementation of BSD wants to be told with MORE=R
environment before it shows colored output, while 'more' on some
other platforms will die when seeing MORE=R environment.

It appears that we are coming to the consensus that trying to be
too intimately knowledgeable about quirks of various pager
implementations on different platforms is a losing proposition.

* jk/color-for-more-pagers:
  pager: disable colors for some known-bad configurations
  DONOTMERGE: needs matching change to git-sh-setup
  setup_pager: set MORE=R
  setup_pager: refactor LESS/LV environment setting
Merge branch 'cc/interpret-trailers' into pu

* cc/interpret-trailers:
  Documentation: add documentation for 'git interpret-trailers'
  trailer: add tests for commands using env variables
  trailer: set author and committer env variables
  trailer: add tests for trailer command
  trailer: execute command from 'trailer.<name>.command'
  strbuf: add strbuf_replace()
  trailer: add new_trailer_item() function
  trailer: if no input file is passed, read from stdin
  trailer: add tests for "git interpret-trailers"
  trailer: add interpret-trailers command
  trailer: put all the processing together and print
  trailer: parse trailers from input file
  strbuf: add strbuf_isspace()
  trailer: process command line trailer arguments
  trailer: read and process config information
  trailer: process trailers from file and arguments
  Add data structures and basic functions for commit trailers
Merge branch 'jl/submodule-recursive-checkout' into pu

* jl/submodule-recursive-checkout:
  Teach checkout to recursively checkout submodules
  submodule: teach unpack_trees() to update submodules
  submodule: teach unpack_trees() to repopulate submodules
  submodule: teach unpack_trees() to remove submodule contents
  submodule: prepare for recursive checkout of submodules
Merge branch 'hv/submodule-ignore-fix' into pu

Teach "git add" to be consistent with "git status" when changes to
submodules are set to be ignored, to avoid surprises after checking
with "git status" to see there isn't any change to be further added
and then see that "git add ." adds changes to them.

I think a reroll is coming, so this may need to be replaced, but I
needed some practice with heavy conflict resolution.  It conflicts
with two changes to "git add" that have been scheduled for Git 2.0
quite badly, and I think I got the resolution right this time.

* hv/submodule-ignore-fix:
  disable complete ignorance of submodules for index <-> HEAD diff
  always show committed submodules in summary after commit
  teach add -f option for ignored submodules
  fix 'git add' to skip submodules configured as ignored
Merge branch 'kb/fast-hashmap' into pu

Improvements to our hash table to get it to meet the needs of the
msysgit fscache project, with some nice performance improvements.

The tip one does not seem to have reached concensus (yet).

Will hold.

* kb/fast-hashmap:
  hashmap.h: make sure map entries are tightly packed
Merge branch 'rv/send-email-cache-generated-mid' into pu

* rv/send-email-cache-generated-mid:
  git-send-email: Cache generated message-ids, use them when prompting
  git-send-email: add optional 'choices' parameter to the ask sub
Merge branch 'jk/gitweb-utf8' into pu

Various fixes to gitweb.

Drew Northup volunteered to take a look into this.
$gmane/226216

* jk/gitweb-utf8:
  gitweb: Fix broken blob action parameters on blob/commitdiff pages
  gitweb: Don't append ';js=(0|1)' to external links
  gitweb: Make feed title valid utf8
  gitweb: Fix utf8 encoding for blob_plain, blobdiff_plain, commitdiff_plain, and patch
Merge branch 'jc/format-patch' into pu

A new option to send a single patch to the standard output to be
appended at the bottom of a message.  I personally have no need for
this, but it was easy enough to cobble together.  Tests, docs and
stripping out more MIMEy stuff are left as exercises to interested
parties.

* jc/format-patch:
  format-patch: --inline-single
  format-patch: rename "no_inline" field

# Conflicts:
# 	builtin/log.c
# 	log-tree.c
# 	pretty.c
Merge branch 'jc/show-branch' into pu

* jc/show-branch:
  show-branch: use commit slab to represent bitflags of arbitrary width
  show-branch.c: remove "all_mask"
  show-branch.c: abstract out "flags" operation
  show-branch.c: lift all_mask/all_revs to a global static
  show-branch.c: update comment style

# Conflicts:
# 	builtin/show-branch.c
Merge branch 'rj/read-default-config-in-show-ref-pack-refs' into pu

The changes themselves are probably good, but it is unclear what
basic setting needs to be read for which exact operation.

$gmane/228294

* rj/read-default-config-in-show-ref-pack-refs:
  ### DONTMERGE: needs better explanation on what config they need
  pack-refs.c: Add missing call to git_config()
  show-ref.c: Add missing call to git_config()
Merge branch 'tr/merge-recursive-index-only' into pu

Will hold.

* tr/merge-recursive-index-only:
  merge-recursive: -Xindex-only to leave worktree unchanged
  merge-recursive: internal flag to avoid touching the worktree
  merge-recursive: remove dead conditional in update_stages()
Merge branch 'tg/perf-lib-test-perf-cleanup' into pu

Add test_perf_cleanup shell function to the perf suite, that allows
the script writers to define a test with a clean-up action.

Will hold.

* tg/perf-lib-test-perf-cleanup:
  perf-lib: add test_perf_cleanup target
  perf-lib: split starting the test from the execution
Merge branch 'yt/shortened-rename' into pu

Attempts to give more weight on the fact that a filepair represents
a rename than showing substring of the actual path when diffstat
lines are not wide enough.

I am not sure if that is solving a right problem, though.

* yt/shortened-rename:
  SQUASH??? style fixes and s/omit/shorten/ where appropriate
  diff.c: keep arrow(=>) on show_stats()'s shortened filename part to make rename visible
Merge branch 'jt/commit-fixes-footer' into pu

There is an ongoing discussion around this topic; in general I am
fairly negative on a new feature that is too narrow and prefer a
more generic solution that can be tailored for specific needs, as
many people stated in the thread.

cc/interpret-trailers could be such a generic solution (although
there don't seem to be much concensus yet).

* jt/commit-fixes-footer:
  commit: Add -f, --fixes <commit> option to add Fixes: line
Merge branch 'jc/create-directories-microopt' into pu

Of unknown value until tested on non-Linux platforms (especially
Windows).

Will hold.

* jc/create-directories-microopt:
  checkout: most of the time we have good leading directories
Merge branch 'bl/blame-full-history' into pu

By disabling the tree-same optimization (which is consistent with
the default behaviour of "git log"-family of commands), make "git
blame" sometimes produce different result from the original code.

Because the "git blame" output can give result for each line from
only one lineage of the history, however, this can be only useful
when you are lucky---unlike "--full-history" of "git log"-family,
where we can show commits from both lineages of histories with an
equal weight.  See $gmane/240392 for more detailed discussion.

* bl/blame-full-history:
  blame: new option --prefer-first to better handle merged cherry-picks