cache-tree: create/update cache-tree on checkout

When git checkout checks out a branch, create or update the
cache-tree so that subsequent operations are faster.

update_main_cache_tree learned a new flag, WRITE_TREE_REPAIR.  When
WRITE_TREE_REPAIR is set, portions of the cache-tree which do not
correspond to existing tree objects are invalidated (and portions which
do are marked as valid).  No new tree objects are created.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
test-dump-cache-tree: invalid trees are not errors

Do not treat known-invalid trees as errors even when their count is
incorrect.  Because git already knows that these trees are invalid,
nothing depends on the count field.

Add a couple of comments.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree: subdirectory tests

Add tests to confirm that invalidation of subdirectories nether over-
nor under-invalidates.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree: write updated cache-tree after commit

During the commit process, update the cache-tree. Write this updated
cache-tree so that it's ready for subsequent commands.

Add test code which demonstrates that git commit now writes the cache
tree.  Make all tests test the entire cache-tree, not just the root
level.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SQUASH???
Merge branch 'dt/cache-tree-repair' into pu

* dt/cache-tree-repair:
  SQUASH???
  cache-tree: write updated cache-tree after commit
  cache-tree: subdirectory tests
  test-dump-cache-tree: invalid trees are not errors
  cache-tree: create/update cache-tree on checkout

Conflicts:
	builtin/checkout.c
	builtin/commit.c

One hunk of this interacts badly in builtins/commit.c with Duy's
split index series. I've punted on that in the meantime to skip
cache-tree regeneration after interactive process spawned during
"commit -i" returns the control to the main process.
Merge branch 'ak/profile-feedback-build' into pu

* ak/profile-feedback-build:
  Fix profile feedback with -jN and add profile-fast
  Run the perf test suite for profile feedback too
  Don't define away __attribute__ on gcc
  Use BASIC_FLAGS for profile feedback
Merge branch 'rh/prompt-tests' into pu

to be broken with older zsh that are still in the field ($gmane/251231).

* rh/prompt-tests:
  t9904: new __git_ps1 tests for Zsh
  test-lib: make it possible to override how test code is eval'd
  lib-prompt-tests.sh: add variable for string that encodes percent in PS1
  lib-prompt-tests.sh: put all tests inside a function
  t9903: move prompt tests to a new lib-prompt-tests.sh file
  t9903: move PS1 color code variable definitions to lib-bash.sh
  t9903: include "Bash" in test names via new $shellname var
  t9903: run pc mode tests again with PS1 expansion disabled
  t9903: move test name prefix to a separate variable
  t9903: put the Bash pc mode prompt test cases in a function
  t9903: remove Zsh test from the suite of Bash prompt tests
Merge branch 'mh/lockfile' into pu

Refactor and fix corner-case bugs in the lockfile API, all looked
sensible.

* mh/lockfile: (25 commits)
  trim_last_path_elm(): replace last_path_elm()
  resolve_symlink(): take a strbuf parameter
  resolve_symlink(): use a strbuf for internal scratch space
  change lock_file::filename into a strbuf
  commit_lock_file(): use a strbuf to manage temporary space
  try_merge_strategy(): use a statically-allocated lock_file object
  try_merge_strategy(): remove redundant lock_file allocation
  struct lock_file: declare some fields volatile
  lockfile: avoid transitory invalid states
  commit_lock_file(): die() if called for unlocked lockfile object
  commit_lock_file(): inline temporary variable
  remove_lock_file(): call rollback_lock_file()
  lock_file(): exit early if lockfile cannot be opened
  write_packed_entry_fn(): convert cb_data into a (const int *)
  prepare_index(): declare return value to be (const char *)
  delete_ref_loose(): don't muck around in the lock_file's filename
  cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN
  lockfile.c: document the various states of lock_file objects
  lock_file(): always add lock_file object to lock_file_list
  hold_lock_file_for_append(): release lock on errors
  ...
Merge branch 'bg/rebase-off-of-previous-branch' into pu

Teach "git rebase -" to report the concrete name of the branch
(i.e. the previous one).

But it stops short and does not do the same for "git rebase @{-1}".

* bg/rebase-off-of-previous-branch:
  git-rebase: print name of rev when using shorthand
Merge branch 'po/everyday-doc' into pu

This may make the said command to emit something, but the source is
not meant to be formatted into a manual pages to begin with, and
also its contents are a bit stale.  It may be a good first step in
the right direction, but needs more work to at least get the
mark-up right before public consumption.

Will hold.

* po/everyday-doc:
  Make 'git help everyday' work

# Conflicts:
# 	Documentation/Makefile
Merge branch 'rb/merge-prepare-commit-msg-hook' into pu

Expose more merge states (e.g. $GIT_DIR/MERGE_MODE) to hooks that
run during "git merge".  The log message stresses too much on one
hook, prepare-commit-msg, but it would equally apply to other hooks
like post-merge, I think.

* rb/merge-prepare-commit-msg-hook:
  merge: drop unused arg from abort_commit method signature
  merge: make prepare_to_commit responsible for write_merge_state
  t7505: ensure cleanup after hook blocks merge
  t7505: add missing &&

# Conflicts:
# 	builtin/merge.c
# 	t/t7505-prepare-commit-msg-hook.sh
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
Merge branch 'tr/merge-recursive-index-only' into pu

* 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 'jh/submodule-tests' into pu

More or less abandoned.  Will drop.

* jh/submodule-tests:
  t7410: 210 tests for various 'git submodule update' scenarios
Merge branch 'ab/add-interactive-show-diff-func-name' into pu

* ab/add-interactive-show-diff-func-name:
  SQUASH??? git-add--interactive: Preserve diff heading when splitting hunks
  git-add--interactive: Preserve diff heading when splitting hunks
Merge branch 'ss/userdiff-update-csharp-java' into pu

Reviews sent; waiting for a response.

* ss/userdiff-update-csharp-java:
  userdiff: support Java try keyword
  userdiff: support C# async methods and correct C# keywords
Merge branch 'jn/gitweb-utf8-in-links' into pu

$gmane/250758?

* jn/gitweb-utf8-in-links:
  gitweb: Harden UTF-8 handling in generated links
### broken or came too late for the day's cycle