difftool: Simplify print_tool_help()

Eliminate a global variable and File::Find usage by building upon
basename() and glob() instead.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
difftool: Eliminate global variables

Organize the script so that it has a single main() function which
calls out to dir_diff() and file_diff() functions. This eliminates
"dir-diff"-specific variables that do not need to be calculated when
performing a regular file-diff.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
difftool: Move option values into a hash

Shorten the "my" declaration for all of the option-specific variables
by wrapping all of them in a hash.  This also gives us a place to
specify default values, should we need them.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
difftool: Call the temp directory "git-difftool"

The "diffall" name was left over from when this functionality was part of
the "git-diffall" script in contrib/.  Make the naming consistent.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
difftool: Use symlinks when diffing against the worktree

Teach difftool's --dir-diff mode to use symlinks to represent
files from the working copy, and make it the default behavior
for the non-Windows platforms.

Using symlinks is simpler and safer since we do not need to
worry about copying files back into the worktree.
The old behavior is still available as --no-symlinks.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'sl/autoconf' into jch

* sl/autoconf:
  build: reconfigure automatically if configure.ac changes
  build: "make clean" should not remove configure-generated files
  autoconf: use AC_CONFIG_COMMANDS instead of ad-hoc 'config.mak.append'
  autoconf: remove few redundant semicolons
  autoconf: remove some redundant shell indirections
  autoconf: GIT_CONF_APPEND_LINE -> GIT_CONF_SUBST
  autoconf: GIT_CONF_APPEND_LINE: change signature
Merge branch 'th/difftool-diffall' into jch

* th/difftool-diffall:
  difftool: only copy back files modified during directory diff
Merge branch 'jn/block-sha1' into jch

* jn/block-sha1:
  Makefile: BLK_SHA1 does not require fast htonl() and unaligned loads
  block-sha1: put expanded macro parameters in parentheses
  block-sha1: avoid pointer conversion that violates alignment constraints
Merge branch 'jn/make-assembly-in-right-directory' into jch

* jn/make-assembly-in-right-directory:
  Makefile: fix location of listing produced by "make subdir/foo.s"
Merge branch 'jk/no-more-pre-exec-callback' into jch

* jk/no-more-pre-exec-callback:
  pager: drop "wait for output to run less" hack
Merge branch 'jc/test-lib-source-build-options-early' into pu

Reorders t/test-lib.sh so that we dot-source GIT-BUILD-OPTIONS that
records the shell and Perl the user told us to use with Git a lot
early, so that test-lib.sh script itself can use "$PERL_PATH" in
one of its early operations.

Needs to be eyeballed by people who run tests with exotic options
like valgrind, --root=/dev/shm/somewhere, etc.

* jc/test-lib-source-build-options-early:
  test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlier
Merge branch 'ph/stash-rerere' into pu

Will be rerolled but is going in the right direction.

* ph/stash-rerere:
  stash: invoke rerere in case of conflict
  test: git-stash conflict sets up rerere
Merge branch 'jc/split-blob' into pu

Not ready.

I finished the streaming checkout codepath, but as explained in
127b177 (bulk-checkin: support chunked-object encoding, 2011-11-30),
these are still early steps of a long and painful journey. At least
pack-objects and fsck need to learn the new encoding for the series
to be usable locally, and then index-pack/unpack-objects needs to
learn it to be used remotely.

Given that I heard a lot of noise that people want large files, and
that I was asked by somebody at GitTogether'11 privately for an
advice on how to pay developers (not me) to help adding necessary
support, I am somewhat dissapointed that the original patch series
that was sent almost two months ago still remains here without much
comments and updates from the developer community. I even made the
interface to the logic that decides where to split chunks easily
replaceable, and I deliberately made the logic in the original patch
extremely stupid to entice others, especially the "bup" fanboys, to
come up with a better logic, thinking that giving people an easy
target to shoot for, they may be encouraged to help out. The plan is
not working :-(.

* jc/split-blob:
  chunked-object: streaming checkout
  chunked-object: fallback checkout codepaths
  bulk-checkin: support chunked-object encoding
  bulk-checkin: allow the same data to be multiply hashed
  new representation types in the packstream
  packfile: use varint functions

Conflicts:
	builtin/pack-objects.c
	streaming.c
	t/t1050-large.sh
Merge branch 'jc/maint-push-refs-all' into pu

Allows pushing and fetching refs/stash.
There still seem to be other bugs hiding (e.g. try pushing twice).

Not ready.

* jc/maint-push-refs-all:
  get_fetch_map(): tighten checks on dest refs
  fetch/push: allow refs/*:refs/*
Merge branch 'lt/commit-tree-guess-utf-8' into pu

Teaches "git commit" and "git commit-tree" the "we are told to use
utf-8 in log message, but this does not look like utf-8---attempt to
pass it through convert-from-latin1-to-utf8 and see if it makes
sense" heuristics "git mailinfo" already uses.

A draft from Linus received privately without a log message.
Expecting a reroll.

* lt/commit-tree-guess-utf-8:
  commit/commit-tree: correct latin1 to utf-8
Merge branch 'mh/maint-revisions-doc' into pu

Expecting a reroll of the tip one.

* mh/maint-revisions-doc:
  Document rev^! and rev^@ as revision specifiers
  Make <refname> documentation more consistent.
Merge branch 'jl/submodule-rm' into pu

Expecting a reroll.

* jl/submodule-rm:
  rm: remove submodules from the index and the .gitmodules file
  rm: don't fail when removing populated submodules
Merge branch 'mb/remote-default-nn-origin' into pu

When the user does not specify what remote to interact with, we
often attempt to use 'origin'.  This can now be customized via a
configuration variable.

Expecting a reroll.
"The first remote becomes the default" bit is better done as a
separate step.

* mb/remote-default-nn-origin:
  Teach get_default_remote to respect remote.default.
  Test that plain "git fetch" uses remote.default when on a detached HEAD.
  Teach clone to set remote.default.
  Teach "git remote" about remote.default.
  Teach remote.c about the remote.default configuration setting.
  Rename remote.c's default_remote_name static variables.
Merge branch 'mz/rebase-range' into pu

Performance concerns from Windows folks.

* mz/rebase-range:
  rebase (without -p): correctly calculate patches to rebase
  rebase -p: don't request --left-right only to ignore left side
  rebase -p: use --cherry-mark for todo file
  git-rebase--interactive.sh: look up subject in add_pick_line
  git-rebase--interactive: group all $preserve_merges code
  git-rebase--interactive.sh: extract function for adding "pick" line
  git-rebase--am.sh: avoid special-casing --keep-empty
Merge branch 'jx/i18n-1.7.11' into pu

* jx/i18n-1.7.11:
  i18n: merge-recursive: mark strings for translation
  Remove unused and bad gettext block from git-am
  i18n: am: mark more strings for translation
  Remove obsolete LONG_USAGE which breaks xgettext
  i18n: Rewrite gettext messages start with dash
  i18n: rebase: mark strings for translation
  i18n: New keywords for xgettext extraction from sh

Conflicts:
	git-am.sh