log: properly handle decorations with chained tags

git log did not correctly handle decorations when a tag object referenced
another tag object that was no longer a ref, such as when the second tag was
deleted.  The commit would not be decorated correctly because parse_object had
not been called on the second tag and therefore its tagged field had not been
filled in, resulting in none of the tags being associated with the relevant
commit.

Call parse_object to fill in this field if it is absent so that the chain of
tags can be dereferenced and the commit can be properly decorated.  Include
tests as well to prevent future regressions.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SQUASH???

Signed-off-by: Junio C Hamano <gitster@pobox.com>
hashmap.h: Use 'unsigned int' for hash-codes everywhere

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
hashmap.h: make sure map entries are tightly packed

Extending 'struct hashmap_entry' with an int-sized member shouldn't waste
memory on 64-bit systems. This is already documented in api-hashmap.txt,
but needs '__attribute__((__packed__))' to work.

Reduces e.g.

 struct name_entry {
     struct hashmap_entry ent;
     int namelen;
     char *name;
 };

from 32 to 24 bytes.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
docs: add filter-branch notes on The BFG

The BFG is a tool specifically designed for the task of removing
unwanted data from Git repository history - a common use-case for which
git-filter-branch has been the traditional workhorse.

It's beneficial to let users know that filter-branch has an alternative
here:

* speed : The BFG is 10-50x faster
  http://rtyley.github.io/bfg-repo-cleaner/#speed
* complexity of configuration : filter-branch is a very flexible tool,
  but demands very careful usage in order to get the desired results
  http://rtyley.github.io/bfg-repo-cleaner/#examples

Obviously, filter-branch has it's advantages too - it permits very
complex rewrites, and doesn't require a JVM - but for the common
use-case of deleting unwanted data, it's helpful to users to be aware
that an alternative exists.

The BFG was released under the GPL in February 2013, and has since seen
widespread production use (The Guardian, RedHat, Google, UK Government
Digital Service), been tested against large repos (~300K commits, ~5GB
packfiles) and received significant positive feedback from users:

http://rtyley.github.io/bfg-repo-cleaner/#feedback

Signed-off-by: Roberto Tyley <roberto.tyley@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
get_max_fd_limit(): fall back to OPEN_MAX upon getrlimit/sysconf failure

On broken systems where RLIMIT_NOFILE is visible by the compliers
but underlying getrlimit() system call does not behave, we used to
simply die() when we are trying to decide how many file descriptors
to allocate for keeping packfiles open.  Instead, allow the fallback
codepath to take over when we get such a failure from getrlimit().

The same issue exists with _SC_OPEN_MAX and sysconf(); restructure
the code in a similar way to prepare for a broken sysconf() as well.

Noticed-by: Joey Hess <joey@kitenet.net>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'kb/fast-hashmap' into jch

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).

* kb/fast-hashmap:
  hashmap.h: make sure map entries are tightly packed
  hashmap.h: Use 'unsigned int' for hash-codes everywhere
builtin/prune.c: use strbuf to avoid having to worry about PATH_MAX

While at it, rename prune_tmp_object(), which used to be a helper to
remove temporary files that were created to become loose object
files, to prune_tmp_file(), as the function is also used to remove
any random cruft whose name begins with tmp_ directly in .git/object
or .git/object/pack directories these days.

Noticed-by:  Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'mh/path-max' into jch

* mh/path-max:
  builtin/prune.c: use strbuf to avoid having to worry about PATH_MAX
  prune-packed: use strbuf to avoid having to worry about PATH_MAX

Conflicts:
	builtin/prune.c
Merge branch 'rt/bfg-ad-in-filter-branch-doc' into jch

* rt/bfg-ad-in-filter-branch-doc:
  docs: add filter-branch notes on The BFG
Merge branch 'jh/rlimit-nofile-fallback' into jch

* jh/rlimit-nofile-fallback:
  get_max_fd_limit(): fall back to OPEN_MAX upon getrlimit/sysconf failure
Merge branch 'sb/diff-orderfile-config' into jch

* sb/diff-orderfile-config:
  FIXUP! tests
  diff: Add diff.orderfile configuration variable
  diff: Let "git diff -O" read orderfile from any file, failing when appropriate
  diff: Tests for "git diff -O"
Merge branch 'bc/log-decoration' into jch

* bc/log-decoration:
  SQUASH???
  log: properly handle decorations with chained tags
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 until using script appears.

* 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.

Holding until needed.

* tg/perf-lib-test-perf-cleanup:
  perf-lib: add test_perf_cleanup target
  perf-lib: split starting the test from the execution