Makefile: add description on PERL/PYTHON_PATH

Signed-off-by: Junio C Hamano <gitster@pobox.com>
cvsimport: allow setting a custom cvsps (2.x) program name

Distros may ship old cvsps under a different name, or the user may
install it outside the normal $PATH.  Allow setting CVSPS2_PATH from
the build environment.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
cvsimport: introduce a version-switch wrapper

In preparation to have both old and new cvsimport during the
transition period, rename the cvsimport script to cvsimport-2
and introduce a small wrapper that we can later change it to
allow users to run either frontend (with their corresponding
cvsps backends).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
cvsimport: start adding cvsps 3.x support

The new cvsps 3.x series lacks support of some options cvsps 2.x
series had and used by cvsimport-2; add a replacement program from
the author of cvsps 3.x and allow users to choose it by setting the
GIT_CVSPS_VERSION environment variable to 3.  We would later add
support to auto-detect the version of installed cvsps to this code
when the environment variable is not set.

Note that in this step, cvsimport-3 that relies on cvsps 3.x does
not have any test coverage.  As cvsimport-3 supports most of the
command line options cvsimport-2 does, we should be able to tweak
some of the t96xx tests and run them with GIT_CVSPS_VERSION set to
both 2 and 3, but that is a topic of later patches that should come
on top.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
cvsimport: make tests reusable for cvsimport-3

This way, a dual-use test can be dot-sourced into a new test script
after defining GIT_CVSPS_VERSION=3 to test that the new cvsimport
with cvsps (3.x) works on simple test histories that old cvsimport
can grok correctly.

Also allow CVSPS2_PATH and CVSPS3_PATH to be defined as "NoThanks"
to cause the tests in t96?? series to be skipped.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
cvsimport-3: add a sample test

This is primarily for illustration to show how the support
introduced by the previous step can be used.

Some parts of t9600 needs to be made conditional to the value of
TEST_CVSPS_VERSION to avoid passing options the new cvsimport does
not need or understand, before this can become usable as a real
test.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t9600: further prepare for sharing

When t9650, which dot-sources this script, really becomes ready to
test the new cvsimport, we no longer depend on having PERL to run
this test through it.  Move the PERL dependency to lib-cvs.sh
instead.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t9600: adjust for new cvsimport

The rewritten cvsimport does not skip the latest 10 minutes worth of
CVS commits by default, so there is no need to pass the "-a" option;
it will barf if it sees "-a".

Also it will do the merge itself, so there is no need to merge
"origin" ourselves, either.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-clean: Display more accurate delete messages

(1) Only print out the names of the files and directories that got
    actually deleted. Also do not mention that we are not removing
    directories when the user did not ask us to do so with '-d'.
(2) Show ignore message for skipped untracked git repositories.

Consider the following repo layout:

  test.git/
    |-- tracked_dir/
    |     |-- some_tracked_file
    |     |-- some_untracked_file
    |-- tracked_file
    |-- untracked_file
    |-- untracked_foo/
    |     |-- bar/
    |     |     |-- bar.txt
    |     |-- emptydir/
    |     |-- frotz.git/
    |           |-- frotz.tx
    |-- untracked_some.git/
          |-- some.txt

Suppose the user issues 'git clean -fd' from the test.git directory.

When -d option is used and untracked directory 'foo' contains a
subdirectory 'frotz.git' that is managed by a different git repository
therefore it will not be removed.

  $ git clean -fd
  Removing tracked_dir/some_untracked_file
  Removing untracked_file
  Removing untracked_foo/
  Removing untracked_some.git/

The message displayed to the user is slightly misleading. The foo/
directory has not been removed because of foo/frotz.git still exists.
On the other hand the subdirectories 'bar' and 'emptydir' have been
deleted but they're not mentioned anywhere. Also, untracked_some.git
has not been removed either.

This behaviour is the result of the way the deletion of untracked
directories are reported. In the current implementation they are
deleted recursively but only the name of the top most directory is
printed out. The calling function does not know about any
subdirectories that could not be removed during the recursion.

Improve the way the deleted directories are reported back to
the user:
  (1) Create a recursive delete function 'remove_dirs' in builtin/clean.c
      to run in both dry_run and delete modes with the delete logic as
      follows:
        (a) Check if the current directory to be deleted is an untracked
            git repository. If it is and --force --force option is not set
            do not touch this directory, print ignore message, set dir_gone
            flag to false for the caller and return.
        (b) Otherwise for each item in current directory:
              (i)   If current directory cannot be accessed, print warning,
                    set dir_gone flag to false and return.
              (ii)  If the item is a subdirectory recurse into it,
                    check for the returned value of the dir_gone flag.
                    If the subdirectory is gone, add the name of the deleted
                    directory to a list of successfully removed items 'dels'.
                    Else set the dir_gone flag as the current directory
                    cannot be removed because we have at least one subdirectory
                    hanging around.
              (iii) If it is a file try to remove it. If success add the
                    file name to the 'dels' list, else print error and set
                    dir_gone flag to false.
        (c) After we finished deleting all items in the current directory and
            the dir_gone flag is still true, remove the directory itself.
            If failed set the dir_gone flag to false.

        (d) If the current directory cannot be deleted because the dir_gone flag
            has been set to false, print out all the successfully deleted items
            for this directory from the 'dels' list.
        (e) We're done with the current directory, return.

  (2) Modify the cmd_clean() function to:
        (a) call the recursive delete function 'remove_dirs()' for each
            topmost directory it wants to remove
        (b) check for the returned value of dir_gone flag. If it's true
            print the name of the directory as being removed.

Consider the output of the improved version:

  $ git clean -fd
  Removing tracked_dir/some_untracked_file
  Removing untracked_file
  Skipping repository untracked_foo/frotz.git
  Removing untracked_foo/bar
  Removing untracked_foo/emptydir
  Skipping repository untracked_some.git/

Now it displays only the file and directory names that got actually
deleted and shows the name of the untracked git repositories it ignored.

Reported-by: Soren Brinkmann <soren.brinkmann@xilinx.com>

Signed-off-by: Zoltan Klinger <zoltan.klinger@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'ap/log-mailmap' into jch

Teach commands in the "log" family to optionally pay attention to
the mailmap.

* ap/log-mailmap:
  log --use-mailmap: optimize for cases without --author/--committer search
  log: add log.mailmap configuration option
  log: grep author/committer using mailmap
  test: add test for --use-mailmap option
  log: add --use-mailmap option
  pretty: use mailmap to display username and email
  mailmap: add mailmap structure to rev_info and pp
  mailmap: simplify map_user() interface
  mailmap: remove email copy and length limitation
  Use split_ident_line to parse author and committer
  string-list: allow case-insensitive string list

Conflicts:
	commit.h
	log-tree.c
	mailmap.c
Merge branch 'as/check-ignore' into jch

Add a new command "git check-ignore" for debugging .gitignore
files.

Will merge to 'next'.

* as/check-ignore:
  t0008: avoid brace expansion
  add git-check-ignore sub-command
  setup.c: document get_pathspec()
  add.c: extract new die_if_path_beyond_symlink() for reuse
  add.c: extract check_path_for_gitlink() from treat_gitlinks() for reuse
  pathspec.c: rename newly public functions for clarity
  add.c: move pathspec matchers into new pathspec.c for reuse
  add.c: remove unused argument from validate_pathspec()
  dir.c: improve docs for match_pathspec() and match_pathspec_depth()
  dir.c: provide clear_directory() for reclaiming dir_struct memory
  dir.c: keep track of where patterns came from
  dir.c: use a single struct exclude_list per source of excludes

Conflicts:
	builtin/ls-files.c
	dir.c
Merge branch 'pe/doc-email-env-is-trumped-by-config' into jch

In the precedence order, the environment variable $EMAIL comes
between the built-in default (i.e. taking value by asking the
system's gethostname() etc.) and the user.email configuration
variable; the documentation implied that it is stronger than the
configuration like $GIT_COMMITTER_EMAIL is, which is wrong.

Will merge to 'next'.

* pe/doc-email-env-is-trumped-by-config:
  git-commit-tree(1): correct description of defaults
Merge branch 'mk/complete-tcsh' into jch

Update tcsh command line completion so that an unwanted space is
not added to a single directory name.

* mk/complete-tcsh:
  Prevent space after directories in tcsh completion
Merge branch 'jc/doc-maintainer' into jch

Describe tools for automation that were invented since this
document was originally written.

* jc/doc-maintainer:
  howto/maintain: mark titles for asciidoc
  Documentation: update "howto maintain git"
Merge branch 'nd/retire-fnmatch' into jch

Originally merged to 'next' on 2013-01-04

Replace our use of fnmatch(3) with a more feature-rich wildmatch.
A handful patches at the bottom have been moved to nd/wildmatch to
graduate as part of that branch, before this series solidifies.

Will cook in 'next' a bit longer than other topics.

* nd/retire-fnmatch:
  Makefile: add USE_WILDMATCH to use wildmatch as fnmatch
  wildmatch: advance faster in <asterisk> + <literal> patterns
  wildmatch: make a special case for "*/" with FNM_PATHNAME
  test-wildmatch: add "perf" command to compare wildmatch and fnmatch
  wildmatch: support "no FNM_PATHNAME" mode
  wildmatch: make dowild() take arbitrary flags
  wildmatch: rename constants and update prototype
Merge branch 'mo/cvs-server-updates' into jch

Various git-cvsserver updates.

Will cook in 'next' for a while to see if anybody screams.

* mo/cvs-server-updates:
  t9402: Use TABs for indentation
  t9402: Rename check.cvsCount and check.list
  t9402: Simplify git ls-tree
  t9402: Add missing &&; Code style
  t9402: No space after IO-redirection
  t9402: Dont use test_must_fail cvs
  t9402: improve check_end_tree() and check_end_full_tree()
  t9402: sed -i is not portable
  cvsserver Documentation: new cvs ... -r support
  cvsserver: add t9402 to test branch and tag refs
  cvsserver: support -r and sticky tags for most operations
  cvsserver: Add version awareness to argsfromdir
  cvsserver: generalize getmeta() to recognize commit refs
  cvsserver: implement req_Sticky and related utilities
  cvsserver: add misc commit lookup, file meta data, and file listing functions
  cvsserver: define a tag name character escape mechanism
  cvsserver: cleanup extra slashes in filename arguments
  cvsserver: factor out git-log parsing logic
Merge branch 'jc/push-2.0-default-to-simple' into jch

Will cook in 'next' until Git 2.0 ;-).

* jc/push-2.0-default-to-simple:
  doc: push.default is no longer "matching"
  push: switch default from "matching" to "simple"
  t9401: do not assume the "matching" push is the default
  t9400: do not assume the "matching" push is the default
  t7406: do not assume the "matching" push is the default
  t5531: do not assume the "matching" push is the default
  t5519: do not assume the "matching" push is the default
  t5517: do not assume the "matching" push is the default
  t5516: do not assume the "matching" push is the default
  t5505: do not assume the "matching" push is the default
  t5404: do not assume the "matching" push is the default

Conflicts:
	builtin/push.c
### match next
Merge branch 'rt/commit-cleanup-config' into jch

Add a configuration variable to set default clean-up mode other
than "strip".

Will merge to 'next'.

* rt/commit-cleanup-config:
  commit: make default of "cleanup" option configurable
Merge branch 'jn/maint-trim-vim-contrib' into jch

Will merge to 'next'.

* jn/maint-trim-vim-contrib:
  contrib/vim: simplify instructions for old vim support