Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sat, 1 Dec 2007 00:21:33 +0000 (16:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 1 Dec 2007 00:21:33 +0000 (16:21 -0800)
* maint:
Replace the word 'update-cache' by 'update-index' everywhere
cvsimport: fix usage of cvsimport.module
t7003-filter-branch: Fix test of a failing --msg-filter.
cvsimport: miscellaneous packed-ref fixes
cvsimport: use rev-parse to support packed refs
Add basic cvsimport tests

1  2 
Documentation/user-manual.txt
Makefile
configure.ac
git-cvsimport.perl
index 0aaed10c761c9256dbb1c2f2dfffeaa2a3bd401f,159de30e19493587585a81f8ed8ad26960eead62..93a47b439b4504467fc5ba7612b8205367f347c2
@@@ -481,7 -481,7 +481,7 @@@ Bisecting: 3537 revisions left to test 
  If you run "git branch" at this point, you'll see that git has
  temporarily moved you to a new branch named "bisect".  This branch
  points to a commit (with commit id 65934...) that is reachable from
 -v2.6.19 but not from v2.6.18.  Compile and test it, and see whether
 +"master" but not from v2.6.18.  Compile and test it, and see whether
  it crashes.  Assume it does crash.  Then:
  
  -------------------------------------------------
@@@ -939,7 -939,7 +939,7 @@@ file such that it contained the given c
  commit.  You can find out with this:
  
  -------------------------------------------------
 -$  git log --raw --abbrev=40 --pretty=oneline -- filename |
 +$  git log --raw --abbrev=40 --pretty=oneline |
        grep -B 1 `git hash-object filename`
  -------------------------------------------------
  
@@@ -1380,7 -1380,7 +1380,7 @@@ If you make a commit that you later wis
  fundamentally different ways to fix the problem:
  
        1. You can create a new commit that undoes whatever was done
 -      by the previous commit.  This is the correct thing if your
 +      by the old commit.  This is the correct thing if your
        mistake has already been made public.
  
        2. You can go back and modify the old commit.  You should
@@@ -1508,7 -1508,7 +1508,7 @@@ Ensuring good performanc
  -------------------------
  
  On large repositories, git depends on compression to keep the history
 -information from taking up to much space on disk or in memory.
 +information from taking up too much space on disk or in memory.
  
  This compression is not performed automatically.  Therefore you
  should occasionally run gitlink:git-gc[1]:
@@@ -1549,7 -1549,7 +1549,7 @@@ dangling tree b24c2473f1fd3d91352a62479
  Dangling objects are not a problem.  At worst they may take up a little
  extra disk space.  They can sometimes provide a last-resort method for
  recovering lost work--see <<dangling-objects>> for details.  However, if
 -you wish, you can remove them with gitlink:git-prune[1] or the --prune
 +you wish, you can remove them with gitlink:git-prune[1] or the `--prune`
  option to gitlink:git-gc[1]:
  
  -------------------------------------------------
@@@ -1573,7 -1573,7 +1573,7 @@@ Recovering lost change
  Reflogs
  ^^^^^^^
  
 -Say you modify a branch with gitlink:git-reset[1] --hard, and then
 +Say you modify a branch with `gitlink:git-reset[1] --hard`, and then
  realize that the branch was the only reference you had to that point in
  history.
  
@@@ -1585,9 -1585,9 +1585,9 @@@ old history using, for example
  $ git log master@{1}
  -------------------------------------------------
  
 -This lists the commits reachable from the previous version of the head.
 -This syntax can be used to with any git command that accepts a commit,
 -not just with git log.  Some other examples:
 +This lists the commits reachable from the previous version of the
 +"master" branch head.  This syntax can be used with any git command
 +that accepts a commit, not just with git log.  Some other examples:
  
  -------------------------------------------------
  $ git show master@{2}         # See where the branch pointed 2,
@@@ -1702,7 -1702,7 +1702,7 @@@ $ git pul
  More generally, a branch that is created from a remote branch will pull
  by default from that branch.  See the descriptions of the
  branch.<name>.remote and branch.<name>.merge options in
 -gitlink:git-config[1], and the discussion of the --track option in
 +gitlink:git-config[1], and the discussion of the `--track` option in
  gitlink:git-checkout[1], to learn how to control these defaults.
  
  In addition to saving you keystrokes, "git pull" also helps you by
@@@ -1800,7 -1800,7 +1800,7 @@@ $ git clone /path/to/repositor
  $ git pull /path/to/other/repository
  -------------------------------------------------
  
 -or an ssh url:
 +or an ssh URL:
  
  -------------------------------------------------
  $ git clone ssh://yourhost/~you/repository
@@@ -1861,7 -1861,7 +1861,7 @@@ Exporting a git repository via the git 
  This is the preferred method.
  
  If someone else administers the server, they should tell you what
 -directory to put the repository in, and what git:// url it will appear
 +directory to put the repository in, and what git:// URL it will appear
  at.  You can then skip to the section
  "<<pushing-changes-to-a-public-repository,Pushing changes to a public
  repository>>", below.
@@@ -1898,8 -1898,8 +1898,8 @@@ $ chmod a+x hooks/post-updat
  gitlink:git-update-server-info[1], and the documentation
  link:hooks.html[Hooks used by git].)
  
 -Advertise the url of proj.git.  Anybody else should then be able to
 -clone or pull from that url, for example with a command line like:
 +Advertise the URL of proj.git.  Anybody else should then be able to
 +clone or pull from that URL, for example with a command line like:
  
  -------------------------------------------------
  $ git clone http://yourserver.com/~you/proj.git
@@@ -2098,7 -2098,7 +2098,7 @@@ $ git branch --track test origin/maste
  $ git branch --track release origin/master
  -------------------------------------------------
  
 -These can be easily kept up to date using gitlink:git-pull[1]
 +These can be easily kept up to date using gitlink:git-pull[1].
  
  -------------------------------------------------
  $ git checkout test && git pull
@@@ -2190,7 -2190,7 +2190,7 @@@ changes are in a specific branch, use
  $ git log linux..branchname | git-shortlog
  -------------------------------------------------
  
 -To see whether it has already been merged into the test or release branches
 +To see whether it has already been merged into the test or release branches,
  use:
  
  -------------------------------------------------
  $ git log release..branchname
  -------------------------------------------------
  
 -(If this branch has not yet been merged you will see some log entries.
 +(If this branch has not yet been merged, you will see some log entries.
  If it has been merged, then there will be no output.)
  
  Once a patch completes the great cycle (moving from test to release,
  then pulled by Linus, and finally coming back into your local
 -"origin/master" branch) the branch for this change is no longer needed.
 +"origin/master" branch), the branch for this change is no longer needed.
  You detect this when the output from:
  
  -------------------------------------------------
@@@ -2470,7 -2470,7 +2470,7 @@@ $ git rebase --continu
  
  and git will continue applying the rest of the patches.
  
 -At any point you may use the --abort option to abort this process and
 +At any point you may use the `--abort` option to abort this process and
  return mywork to the state it had before you started the rebase:
  
  -------------------------------------------------
@@@ -2539,9 -2539,9 +2539,9 @@@ $ git checkout -b mywork-new origi
  $ gitk origin..mywork &
  -------------------------------------------------
  
 -And browse through the list of patches in the mywork branch using gitk,
 +and browse through the list of patches in the mywork branch using gitk,
  applying them (possibly in a different order) to mywork-new using
 -cherry-pick, and possibly modifying them as you go using commit --amend.
 +cherry-pick, and possibly modifying them as you go using `commit --amend`.
  The gitlink:git-gui[1] command may also help as it allows you to
  individually select diff hunks for inclusion in the index (by
  right-clicking on the diff hunk and choosing "Stage Hunk for Commit").
@@@ -2865,7 -2865,7 +2865,7 @@@ others
  
  - Git can quickly determine whether two objects are identical or not,
    just by comparing names.
 -- Since object names are computed the same way in ever repository, the
 +- Since object names are computed the same way in every repository, the
    same content stored in two repositories will always be stored under
    the same name.
  - Git can detect errors when it reads an object, by checking that the
@@@ -2882,7 -2882,7 +2882,7 @@@ There are four different types of objec
    "blob" objects into a directory structure. In addition, a tree object
    can refer to other tree objects, thus creating a directory hierarchy.
  - A <<def_commit_object,"commit" object>> ties such directory hierarchies
 -  together into a <<def_DAG,directed acyclic graph>> of revisions - each
 +  together into a <<def_DAG,directed acyclic graph>> of revisions--each
    commit contains the object name of exactly one tree designating the
    directory hierarchy at the time of the commit. In addition, a commit
    refers to "parent" commit objects that describe the history of how we
@@@ -3155,7 -3155,7 +3155,7 @@@ There are also other situations that ca
  example, a "dangling blob" may arise because you did a "git add" of a
  file, but then, before you actually committed it and made it part of the
  bigger picture, you changed something else in that file and committed
 -that *updated* thing - the old state that you added originally ends up
 +that *updated* thing--the old state that you added originally ends up
  not being pointed to by any commit or tree, so it's now a dangling blob
  object.
  
@@@ -3170,7 -3170,7 +3170,7 @@@ up pointing to them, so they end up "da
  Generally, dangling objects aren't anything to worry about. They can
  even be very useful: if you screw something up, the dangling objects can
  be how you recover your old tree (say, you did a rebase, and realized
 -that you really didn't want to - you can look at what dangling objects
 +that you really didn't want to--you can look at what dangling objects
  you have, and decide to reset your head to some old dangling state).
  
  For commits, you can just use:
@@@ -3214,10 -3214,10 +3214,10 @@@ $ git prun
  ------------------------------------------------
  
  and they'll be gone. But you should only run "git prune" on a quiescent
 -repository - it's kind of like doing a filesystem fsck recovery: you
 +repository--it's kind of like doing a filesystem fsck recovery: you
  don't want to do that while the filesystem is mounted.
  
 -(The same is true of "git-fsck" itself, btw - but since
 +(The same is true of "git-fsck" itself, btw, but since
  git-fsck never actually *changes* the repository, it just reports
  on what it found, git-fsck itself is never "dangerous" to run.
  Running it while somebody is actually changing the repository can cause
@@@ -3336,14 -3336,14 +3336,14 @@@ $ git hash-object -w <recreated-file
  
  and your repository is good again!
  
 -(Btw, you could have ignored the fsck, and started with doing a 
 +(Btw, you could have ignored the fsck, and started with doing a
  
  ------------------------------------------------
  $ git log --raw --all
  ------------------------------------------------
  
 -and just looked for the sha of the missing object (4b9458b..) in that 
 -whole thing. It's up to you - git does *have* a lot of information, it is 
 +and just looked for the sha of the missing object (4b9458b..) in that
 +whole thing. It's up to you - git does *have* a lot of information, it is
  just missing one particular blob version.
  
  [[the-index]]
@@@ -3672,10 -3672,9 +3672,10 @@@ The Workflo
  ------------
  
  High-level operations such as gitlink:git-commit[1],
 -gitlink:git-checkout[1] and git-reset[1] work by moving data between the
 -working tree, the index, and the object database.  Git provides
 -low-level operations which perform each of these steps individually.
 +gitlink:git-checkout[1] and gitlink:git-reset[1] work by moving data
 +between the working tree, the index, and the object database.  Git
 +provides low-level operations which perform each of these steps
 +individually.
  
  Generally, all "git" operations work on the index file. Some operations
  work *purely* on the index file (showing the current state of the
@@@ -3707,7 -3706,7 +3707,7 @@@ should use the `--remove` and `--add` f
  NOTE! A `--remove` flag does 'not' mean that subsequent filenames will
  necessarily be removed: if the files still exist in your directory
  structure, the index will be updated with their new status, not
- removed. The only thing `--remove` means is that update-cache will be
+ removed. The only thing `--remove` means is that update-index will be
  considering a removed file to be a valid thing, and if the file really
  does not exist any more, it will update the index accordingly.
  
@@@ -3730,7 -3729,7 +3730,7 @@@ You write your current index file to a 
  $ git write-tree
  -------------------------------------------------
  
 -that doesn't come with any options - it will just write out the
 +that doesn't come with any options--it will just write out the
  current index into the set of tree objects that describe that state,
  and it will return the name of the resulting top-level tree. You can
  use that tree to re-generate the index at any time by going in the
@@@ -3741,7 -3740,7 +3741,7 @@@ object database -> inde
  ~~~~~~~~~~~~~~~~~~~~~~~~
  
  You read a "tree" file from the object database, and use that to
 -populate (and overwrite - don't do this if your index contains any
 +populate (and overwrite--don't do this if your index contains any
  unsaved state that you might want to restore later!) your current
  index.  Normal operation is just
  
@@@ -3789,7 -3788,7 +3789,7 @@@ Tying it all togethe
  
  To commit a tree you have instantiated with "git-write-tree", you'd
  create a "commit" object that refers to that tree and the history
 -behind it - most notably the "parent" commits that preceded it in
 +behind it--most notably the "parent" commits that preceded it in
  history.
  
  Normally a "commit" has one parent: the previous state of the tree
@@@ -3932,7 -3931,7 +3932,7 @@@ Once you know the three trees you are g
  tree, aka the common tree, and the two "result" trees, aka the branches
  you want to merge), you do a "merge" read into the index. This will
  complain if it has to throw away your old index contents, so you should
 -make sure that you've committed those - in fact you would normally
 +make sure that you've committed those--in fact you would normally
  always do a merge against your last commit (which should thus match what
  you have in your current index anyway).
  
@@@ -3952,7 -3951,7 +3952,7 @@@ Merging multiple trees, continue
  ---------------------------------
  
  Sadly, many merges aren't trivial. If there are files that have
 -been added.moved or removed, or if both branches have modified the
 +been addedmoved or removed, or if both branches have modified the
  same file, you will be left with an index tree that contains "merge
  entries" in it. Such an index tree can 'NOT' be written out to a tree
  object, and you will have to resolve any such merge clashes using
@@@ -4204,7 -4203,7 +4204,7 @@@ Two things are interesting here
  
  - `get_sha1()` returns 0 on _success_.  This might surprise some new
    Git hackers, but there is a long tradition in UNIX to return different
 -  negative numbers in case of different errors -- and 0 on success.
 +  negative numbers in case of different errors--and 0 on success.
  
  - the variable `sha1` in the function signature of `get_sha1()` is `unsigned
    char \*`, but is actually expected to be a pointer to `unsigned
@@@ -4309,7 -4308,7 +4309,7 @@@ $ git branch new     # create branch "n
  $ git branch -d new  # delete branch "new"
  -----------------------------------------------
  
 -Instead of basing new branch on current HEAD (the default), use:
 +Instead of basing new branch on current HEAD (the default), use:
  
  -----------------------------------------------
  $ git branch new test    # branch named "test"
diff --combined Makefile
index ccf522adce9fccb8b94ebc26d686a995d900ebbf,c72d40ada34c71e99e319b81ad656ab98e71690c..e869b85b952f4945403b7f8fae6a78d5f74aa4ec
+++ b/Makefile
@@@ -28,8 -28,6 +28,8 @@@ all:
  #
  # Define NO_STRCASESTR if you don't have strcasestr.
  #
 +# Define NO_MEMMEM if you don't have memmem.
 +#
  # Define NO_STRLCPY if you don't have strlcpy.
  #
  # Define NO_STRTOUMAX if you don't have strtoumax in the C library.
@@@ -38,8 -36,6 +38,8 @@@
  #
  # Define NO_SETENV if you don't have setenv in the C library.
  #
 +# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
 +#
  # Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
  # Enable it on Windows.  By default, symrefs are still used.
  #
  # times (my ext3 doesn't).
  #
  # Define USE_STDEV below if you want git to care about the underlying device
- # change being considered an inode change from the update-cache perspective.
+ # change being considered an inode change from the update-index perspective.
  #
  # Define ASCIIDOC8 if you want to format documentation with AsciiDoc 8
  #
  # If not set it defaults to the bare 'wish'. If it is set to the empty
  # string then NO_TCLTK will be forced (this is used by configure script).
  #
 +# Define THREADED_DELTA_SEARCH if you have pthreads and wish to exploit
 +# parallel delta searching when packing objects.
 +#
  
  GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@@ -171,7 -164,6 +171,7 @@@ GITWEB_CONFIG = gitweb_config.per
  GITWEB_HOME_LINK_STR = projects
  GITWEB_SITENAME =
  GITWEB_PROJECTROOT = /pub/git
 +GITWEB_PROJECT_MAXDEPTH = 2007
  GITWEB_EXPORT_OK =
  GITWEB_STRICT_EXPORT =
  GITWEB_BASE_URL =
@@@ -213,14 -205,16 +213,14 @@@ BASIC_LDFLAGS 
  
  SCRIPT_SH = \
        git-bisect.sh git-checkout.sh \
 -      git-clean.sh git-clone.sh git-commit.sh \
 -      git-fetch.sh \
 -      git-ls-remote.sh \
 +      git-clone.sh git-commit.sh \
        git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \
        git-pull.sh git-rebase.sh git-rebase--interactive.sh \
 -      git-repack.sh git-request-pull.sh git-reset.sh \
 +      git-repack.sh git-request-pull.sh \
        git-sh-setup.sh \
        git-am.sh \
        git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
 -      git-merge-resolve.sh git-merge-ours.sh \
 +      git-merge-resolve.sh \
        git-lost-found.sh git-quiltimport.sh git-submodule.sh \
        git-filter-branch.sh \
        git-stash.sh
  SCRIPT_PERL = \
        git-add--interactive.perl \
        git-archimport.perl git-cvsimport.perl git-relink.perl \
 -      git-cvsserver.perl git-remote.perl \
 -      git-svnimport.perl git-cvsexportcommit.perl \
 +      git-cvsserver.perl git-remote.perl git-cvsexportcommit.perl \
        git-send-email.perl git-svn.perl
  
  SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
  
  # ... and all the rest that could be moved out of bindir to gitexecdir
  PROGRAMS = \
 -      git-convert-objects$X git-fetch-pack$X \
 -      git-hash-object$X git-index-pack$X git-local-fetch$X \
 +      git-fetch-pack$X \
 +      git-hash-object$X git-index-pack$X \
        git-fast-import$X \
        git-daemon$X \
        git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
 -      git-peek-remote$X git-receive-pack$X \
 +      git-receive-pack$X \
        git-send-pack$X git-shell$X \
 -      git-show-index$X git-ssh-fetch$X \
 -      git-ssh-upload$X git-unpack-file$X \
 +      git-show-index$X \
 +      git-unpack-file$X \
        git-update-server-info$X \
        git-upload-pack$X \
        git-pack-redundant$X git-var$X \
@@@ -273,6 -268,9 +273,6 @@@ ifndef NO_TCLT
  OTHER_PROGRAMS += gitk-wish
  endif
  
 -# Backward compatibility -- to be removed after 1.0
 -PROGRAMS += git-ssh-pull$X git-ssh-push$X
 -
  # Set paths to tools early so that they can be used for version tests.
  ifndef SHELL_PATH
        SHELL_PATH = /bin/sh
@@@ -292,7 -290,7 +292,7 @@@ LIB_H = 
        run-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \
        tree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \
        utf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \
 -      mailmap.h remote.h
 +      mailmap.h remote.h parse-options.h transport.h diffcore.h hash.h
  
  DIFF_OBJS = \
        diff.o diff-lib.o diffcore-break.o diffcore-order.o \
  LIB_OBJS = \
        blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \
        date.o diff-delta.o entry.o exec_cmd.o ident.o \
 -      interpolate.o \
 +      pretty.o interpolate.o hash.o \
        lockfile.o \
        patch-ids.o \
        object.o pack-check.o pack-write.o patch-delta.o path.o pkt-line.o \
        write_or_die.o trace.o list-objects.o grep.o match-trees.o \
        alloc.o merge-file.o path-list.o help.o unpack-trees.o $(DIFF_OBJS) \
        color.o wt-status.o archive-zip.o archive-tar.o shallow.o utf8.o \
 -      convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o
 +      convert.o attr.o decorate.o progress.o mailmap.o symlinks.o remote.o \
 +      transport.o bundle.o walker.o parse-options.o
  
  BUILTIN_OBJS = \
        builtin-add.o \
        builtin-check-attr.o \
        builtin-checkout-index.o \
        builtin-check-ref-format.o \
 +      builtin-clean.o \
        builtin-commit-tree.o \
        builtin-count-objects.o \
        builtin-describe.o \
        builtin-diff-files.o \
        builtin-diff-index.o \
        builtin-diff-tree.o \
 +      builtin-fetch.o \
 +      builtin-fetch-pack.o \
        builtin-fetch--tool.o \
        builtin-fmt-merge-msg.o \
        builtin-for-each-ref.o \
        builtin-log.o \
        builtin-ls-files.o \
        builtin-ls-tree.o \
 +      builtin-ls-remote.o \
        builtin-mailinfo.o \
        builtin-mailsplit.o \
        builtin-merge-base.o \
        builtin-merge-file.o \
 +      builtin-merge-ours.o \
        builtin-mv.o \
        builtin-name-rev.o \
        builtin-pack-objects.o \
        builtin-push.o \
        builtin-read-tree.o \
        builtin-reflog.o \
 +      builtin-send-pack.o \
        builtin-config.o \
        builtin-rerere.o \
 +      builtin-reset.o \
        builtin-rev-list.o \
        builtin-rev-parse.o \
        builtin-revert.o \
@@@ -410,16 -400,13 +410,16 @@@ ifeq ($(uname_S),Darwin
        NEEDS_LIBICONV = YesPlease
        OLD_ICONV = UnfortunatelyYes
        NO_STRLCPY = YesPlease
 +      NO_MEMMEM = YesPlease
  endif
  ifeq ($(uname_S),SunOS)
        NEEDS_SOCKET = YesPlease
        NEEDS_NSL = YesPlease
        SHELL_PATH = /bin/bash
        NO_STRCASESTR = YesPlease
 +      NO_MEMMEM = YesPlease
        NO_HSTRERROR = YesPlease
 +      NO_MKDTEMP = YesPlease
        ifeq ($(uname_R),5.8)
                NEEDS_LIBICONV = YesPlease
                NO_UNSETENV = YesPlease
@@@ -441,7 -428,6 +441,7 @@@ ifeq ($(uname_O),Cygwin
        NO_D_TYPE_IN_DIRENT = YesPlease
        NO_D_INO_IN_DIRENT = YesPlease
        NO_STRCASESTR = YesPlease
 +      NO_MEMMEM = YesPlease
        NO_SYMLINK_HEAD = YesPlease
        NEEDS_LIBICONV = YesPlease
        NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
  endif
  ifeq ($(uname_S),FreeBSD)
        NEEDS_LIBICONV = YesPlease
 +      NO_MEMMEM = YesPlease
        BASIC_CFLAGS += -I/usr/local/include
        BASIC_LDFLAGS += -L/usr/local/lib
  endif
  ifeq ($(uname_S),OpenBSD)
        NO_STRCASESTR = YesPlease
 +      NO_MEMMEM = YesPlease
        NEEDS_LIBICONV = YesPlease
        BASIC_CFLAGS += -I/usr/local/include
        BASIC_LDFLAGS += -L/usr/local/lib
@@@ -476,7 -460,6 +476,7 @@@ ifeq ($(uname_S),NetBSD
  endif
  ifeq ($(uname_S),AIX)
        NO_STRCASESTR=YesPlease
 +      NO_MEMMEM = YesPlease
        NO_STRLCPY = YesPlease
        NEEDS_LIBICONV=YesPlease
  endif
@@@ -488,7 -471,6 +488,7 @@@ ifeq ($(uname_S),IRIX64
        NO_IPV6=YesPlease
        NO_SETENV=YesPlease
        NO_STRCASESTR=YesPlease
 +      NO_MEMMEM = YesPlease
        NO_STRLCPY = YesPlease
        NO_SOCKADDR_STORAGE=YesPlease
        SHELL_PATH=/usr/gnu/bin/bash
@@@ -526,9 -508,7 +526,9 @@@ els
        CC_LD_DYNPATH = -R
  endif
  
 -ifndef NO_CURL
 +ifdef NO_CURL
 +      BASIC_CFLAGS += -DNO_CURL
 +else
        ifdef CURLDIR
                # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
                BASIC_CFLAGS += -I$(CURLDIR)/include
        else
                CURL_LIBCURL = -lcurl
        endif
 -      PROGRAMS += git-http-fetch$X
 +      BUILTIN_OBJS += builtin-http-fetch.o
 +      EXTLIBS += $(CURL_LIBCURL)
 +      LIB_OBJS += http.o http-walker.o
        curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
        ifeq "$(curl_check)" "070908"
                ifndef NO_EXPAT
@@@ -620,10 -598,6 +620,10 @@@ ifdef NO_SETEN
        COMPAT_CFLAGS += -DNO_SETENV
        COMPAT_OBJS += compat/setenv.o
  endif
 +ifdef NO_MKDTEMP
 +      COMPAT_CFLAGS += -DNO_MKDTEMP
 +      COMPAT_OBJS += compat/mkdtemp.o
 +endif
  ifdef NO_UNSETENV
        COMPAT_CFLAGS += -DNO_UNSETENV
        COMPAT_OBJS += compat/unsetenv.o
@@@ -695,15 -669,6 +695,15 @@@ ifdef NO_HSTRERRO
        COMPAT_CFLAGS += -DNO_HSTRERROR
        COMPAT_OBJS += compat/hstrerror.o
  endif
 +ifdef NO_MEMMEM
 +      COMPAT_CFLAGS += -DNO_MEMMEM
 +      COMPAT_OBJS += compat/memmem.o
 +endif
 +
 +ifdef THREADED_DELTA_SEARCH
 +      BASIC_CFLAGS += -DTHREADED_DELTA_SEARCH
 +      EXTLIBS += -lpthread
 +endif
  
  ifeq ($(TCLTK_PATH),)
  NO_TCLTK=NoThanks
@@@ -756,7 -721,7 +756,7 @@@ TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_
  LIBS = $(GITLIBS) $(EXTLIBS)
  
  BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
 -      -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $(COMPAT_CFLAGS)
 +      $(COMPAT_CFLAGS)
  LIB_OBJS += $(COMPAT_OBJS)
  
  ALL_CFLAGS += $(BASIC_CFLAGS)
@@@ -852,7 -817,6 +852,7 @@@ gitweb/gitweb.cgi: gitweb/gitweb.per
            -e 's|++GITWEB_HOME_LINK_STR++|$(GITWEB_HOME_LINK_STR)|g' \
            -e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
            -e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
 +          -e 's|"++GITWEB_PROJECT_MAXDEPTH++"|$(GITWEB_PROJECT_MAXDEPTH)|g' \
            -e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
            -e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
            -e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
@@@ -905,30 -869,39 +905,30 @@@ exec_cmd.o: exec_cmd.c GIT-CFLAG
  builtin-init-db.o: builtin-init-db.c GIT-CFLAGS
        $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"' $<
  
 +config.o: config.c GIT-CFLAGS
 +      $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"' $<
 +
  http.o: http.c GIT-CFLAGS
        $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $<
  
  ifdef NO_EXPAT
 -http-fetch.o: http-fetch.c http.h GIT-CFLAGS
 +http-walker.o: http-walker.c http.h GIT-CFLAGS
        $(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<
  endif
  
  git-%$X: %.o $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  
 -ssh-pull.o: ssh-fetch.c
 -ssh-push.o: ssh-upload.c
 -git-local-fetch$X: fetch.o
 -git-ssh-fetch$X: rsh.o fetch.o
 -git-ssh-upload$X: rsh.o
 -git-ssh-pull$X: rsh.o fetch.o
 -git-ssh-push$X: rsh.o
 -
  git-imap-send$X: imap-send.o $(LIB_FILE)
  
 -http.o http-fetch.o http-push.o: http.h
 -git-http-fetch$X: fetch.o http.o http-fetch.o $(GITLIBS)
 -      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 -              $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
 +http.o http-walker.o http-push.o: http.h
  
  git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
                $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
  
 -$(LIB_OBJS) $(BUILTIN_OBJS) fetch.o: $(LIB_H)
 +$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
  $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
 -$(DIFF_OBJS): diffcore.h
  builtin-revert.o builtin-runstatus.o wt-status.o: wt-status.h
  
  $(LIB_FILE): $(LIB_OBJS)
@@@ -957,10 -930,6 +957,10 @@@ tags
        $(RM) tags
        $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
  
 +cscope:
 +      $(RM) cscope*
 +      $(FIND) . -name '*.[hcS]' -print | xargs cscope -b
 +
  ### Detect prefix changes
  TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
               $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
@@@ -988,7 -957,7 +988,7 @@@ endi
  
  ### Testing rules
  
 -TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-absolute-path$X
 +TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-absolute-path$X test-parse-options$X
  
  all:: $(TEST_PROGRAMS)
  
@@@ -1005,8 -974,6 +1005,8 @@@ test-date$X: date.o ctype.
  
  test-delta$X: diff-delta.o patch-delta.o
  
 +test-parse-options$X: parse-options.o
 +
  .PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
  
  test-%$X: test-%.o $(GITLIBS)
@@@ -1112,7 -1079,7 +1112,7 @@@ clean
                $(LIB_FILE) $(XDIFF_LIB)
        $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS)
 -      $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
 +      $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
        $(RM) -r autom4te.cache
        $(RM) config.log config.mak.autogen config.mak.append config.status config.cache
        $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
@@@ -1130,19 -1097,19 +1130,19 @@@ endi
        $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
  
  .PHONY: all install clean strip
 -.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS
 +.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS
  
  ### Check documentation
  #
  check-docs::
 -      @for v in $(ALL_PROGRAMS) $(BUILT_INS) git$X gitk; \
 +      @(for v in $(ALL_PROGRAMS) $(BUILT_INS) git gitk; \
        do \
                case "$$v" in \
                git-merge-octopus | git-merge-ours | git-merge-recursive | \
 -              git-merge-resolve | git-merge-stupid | \
 +              git-merge-resolve | git-merge-stupid | git-merge-subtree | \
                git-add--interactive | git-fsck-objects | git-init-db | \
 -              git-repo-config | git-fetch--tool | \
 -              git-ssh-pull | git-ssh-push ) continue ;; \
 +              git-rebase--interactive | \
 +              git-repo-config | git-fetch--tool ) continue ;; \
                esac ; \
                test -f "Documentation/$$v.txt" || \
                echo "no doc: $$v"; \
                git) ;; \
                *) echo "no link: $$v";; \
                esac ; \
 -      done | sort
 +      done; \
 +      ( \
 +              sed -e '1,/^__DATA__/d' \
 +                  -e 's/[     ].*//' \
 +                  -e 's/^/listed /' Documentation/cmd-list.perl; \
 +              ls -1 Documentation/git*txt | \
 +              sed -e 's|Documentation/|documented |' \
 +                  -e 's/\.txt//'; \
 +      ) | while read how cmd; \
 +      do \
 +              case "$$how,$$cmd" in \
 +              *,git-citool | \
 +              *,git-gui | \
 +              documented,gitattributes | \
 +              documented,gitignore | \
 +              documented,gitmodules | \
 +              documented,git-tools | \
 +              sentinel,not,matching,is,ok ) continue ;; \
 +              esac; \
 +              case " $(ALL_PROGRAMS) $(BUILT_INS) git gitk " in \
 +              *" $$cmd "*)    ;; \
 +              *) echo "removed but $$how: $$cmd" ;; \
 +              esac; \
 +      done ) | sort
  
  ### Make sure built-ins do not have dups and listed in git.c
  #
diff --combined configure.ac
index 7bcf1a488c05280b4ae1f8aad43b82ba33e2ea94,8dfe9a0e121e5d795745e6368724b02afc8d66d8..5f8a15b9f9580bea6f350e8af468f81cf2535c9e
@@@ -73,7 -73,7 +73,7 @@@ fi 
  AC_ARG_WITH([lib],
   [AS_HELP_STRING([--with-lib=ARG],
                   [ARG specifies alternative name for lib directory])],
 - [if test "$withval" = "no" -o "$withval" = "yes"; then \
 + [if test "$withval" = "no" || test "$withval" = "yes"; then \
        AC_MSG_WARN([You should provide name for --with-lib=ARG]); \
  else \
        GIT_CONF_APPEND_LINE(lib=$withval); \
@@@ -265,9 -265,9 +265,9 @@@ AC_RUN_IFELSE
        [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
                [[char buf[64];
                if (sprintf(buf, "%lld%hhd%jd%zd%td", (long long int)1, (char)2, (intmax_t)3, (size_t)4, (ptrdiff_t)5) != 5)
 -                exit(1);
 +                return 1;
                else if (strcmp(buf, "12345"))
 -                exit(2);]])],
 +                return 2;]])],
        [ac_cv_c_c99_format=yes],
        [ac_cv_c_c99_format=no])
  ])
@@@ -289,36 -289,18 +289,36 @@@ AC_CHECK_FUNC(strcasestr
  [NO_STRCASESTR=YesPlease])
  AC_SUBST(NO_STRCASESTR)
  #
 +# Define NO_MEMMEM if you don't have memmem.
 +AC_CHECK_FUNC(memmem,
 +[NO_MEMMEM=],
 +[NO_MEMMEM=YesPlease])
 +AC_SUBST(NO_MEMMEM)
 +#
  # Define NO_STRLCPY if you don't have strlcpy.
  AC_CHECK_FUNC(strlcpy,
  [NO_STRLCPY=],
  [NO_STRLCPY=YesPlease])
  AC_SUBST(NO_STRLCPY)
  #
 +# Define NO_STRTOUMAX if you don't have strtoumax in the C library.
 +AC_CHECK_FUNC(strtoumax,
 +[NO_STRTOUMAX=],
 +[NO_STRTOUMAX=YesPlease])
 +AC_SUBST(NO_STRTOUMAX)
 +#
  # Define NO_SETENV if you don't have setenv in the C library.
  AC_CHECK_FUNC(setenv,
  [NO_SETENV=],
  [NO_SETENV=YesPlease])
  AC_SUBST(NO_SETENV)
  #
 +# Define NO_MKDTEMP if you don't have mkdtemp in the C library.
 +AC_CHECK_FUNC(mkdtemp,
 +[NO_MKDTEMP=],
 +[NO_MKDTEMP=YesPlease])
 +AC_SUBST(NO_MKDTEMP)
 +#
  # Define NO_MMAP if you want to avoid mmap.
  #
  # Define NO_ICONV if your libc does not properly support iconv.
@@@ -415,7 -397,7 +415,7 @@@ GIT_PARSE_WITH(iconv)
  # times (my ext3 doesn't).
  #
  # Define USE_STDEV below if you want git to care about the underlying device
- # change being considered an inode change from the update-cache perspective.
+ # change being considered an inode change from the update-index perspective.
  
  
  ## Output files
diff --combined git-cvsimport.perl
index efa6a0c41ad5a253047789e8ac2a30bf57f8646d,d565091c35b1931035bbfdf455efec38fde51833..92648f40c98096d624a3a80feab4d3a818089b5a
@@@ -108,10 -108,6 +108,6 @@@ sub read_repo_config 
              }
                }
        }
-     if (@ARGV == 0) {
-         chomp(my $module = `git-repo-config --get cvsimport.module`);
-         push(@ARGV, $module);
-     }
  }
  
  my $opts = "haivmkuo:d:p:r:C:z:s:M:P:A:S:L:";
@@@ -119,6 -115,10 +115,10 @@@ read_repo_config($opts)
  getopts($opts) or usage();
  usage if $opt_h;
  
+ if (@ARGV == 0) {
+               chomp(my $module = `git-repo-config --get cvsimport.module`);
+               push(@ARGV, $module) if $? == 0;
+ }
  @ARGV <= 1 or usage("You can't specify more than one CVS module");
  
  if ($opt_d) {
@@@ -223,8 -223,7 +223,8 @@@ sub conn 
                        }
                }
  
 -              $user="anonymous" unless defined $user;
 +              # if username is not explicit in CVSROOT, then use current user, as cvs would
 +              $user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
                my $rr2 = "-";
                unless ($port) {
                        $rr2 = ":pserver:$user\@$serv:$repo";
@@@ -527,18 -526,12 +527,12 @@@ sub is_sha1 
        return $s =~ /^[a-f0-9]{40}$/;
  }
  
- sub get_headref ($$) {
-     my $name    = shift;
-     my $git_dir = shift;
-     my $f = "$git_dir/$remote/$name";
-     if (open(my $fh, $f)) {
-           chomp(my $r = <$fh>);
-           is_sha1($r) or die "Cannot get head id for $name ($r): $!";
-           return $r;
-     }
-     die "unable to open $f: $!" unless $! == POSIX::ENOENT;
-     return undef;
+ sub get_headref ($) {
+       my $name = shift;
+       my $r = `git rev-parse --verify '$name' 2>/dev/null`;
+       return undef unless $? == 0;
+       chomp $r;
+       return $r;
  }
  
  -d $git_tree
@@@ -698,7 -691,8 +692,8 @@@ my (@old,@new,@skipped,%ignorebranch)
  $ignorebranch{'#CVSPS_NO_BRANCH'} = 1;
  
  sub commit {
-       if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
+       if ($branch eq $opt_o && !$index{branch} &&
+               !get_headref("$remote/$branch")) {
            # looks like an initial commit
            # use the index primed by git-init
            $ENV{GIT_INDEX_FILE} = "$git_dir/index";
        update_index(@old, @new);
        @old = @new = ();
        my $tree = write_tree();
-       my $parent = get_headref($last_branch, $git_dir);
+       my $parent = get_headref("$remote/$last_branch");
        print "Parent ID " . ($parent ? $parent : "(empty)") . "\n" if $opt_v;
  
        my @commit_args;
        foreach my $rx (@mergerx) {
                next unless $logmsg =~ $rx && $1;
                my $mparent = $1 eq 'HEAD' ? $opt_o : $1;
-               if (my $sha1 = get_headref($mparent, $git_dir)) {
+               if (my $sha1 = get_headref("$remote/$mparent")) {
                        push @commit_args, '-p', $mparent;
                        print "Merge parent branch: $mparent\n" if $opt_v;
                }
@@@ -870,29 -864,27 +865,27 @@@ while (<CVS>) 
                                print STDERR "Branch $branch erroneously stems from itself -- changed ancestor to $opt_o\n";
                                $ancestor = $opt_o;
                        }
-                       if (-f "$git_dir/$remote/$branch") {
+                       if (defined get_headref("$remote/$branch")) {
                                print STDERR "Branch $branch already exists!\n";
                                $state=11;
                                next;
                        }
-                       unless (open(H,"$git_dir/$remote/$ancestor")) {
+                       my $id = get_headref("$remote/$ancestor");
+                       if (!$id) {
                                print STDERR "Branch $ancestor does not exist!\n";
                                $ignorebranch{$branch} = 1;
                                $state=11;
                                next;
                        }
-                       chomp(my $id = <H>);
-                       close(H);
-                       unless (open(H,"> $git_dir/$remote/$branch")) {
-                               print STDERR "Could not create branch $branch: $!\n";
+                       system(qw(git update-ref -m cvsimport),
+                               "$remote/$branch", $id);
+                       if($? != 0) {
+                               print STDERR "Could not create branch $branch\n";
                                $ignorebranch{$branch} = 1;
                                $state=11;
                                next;
                        }
-                       print H "$id\n"
-                               or die "Could not write branch $branch: $!";
-                       close(H)
-                               or die "Could not write branch $branch: $!";
                }
                $last_branch = $branch if $branch ne $last_branch;
                $state = 9;
@@@ -1004,7 -996,7 +997,7 @@@ if ($orig_branch) 
        $orig_branch = "master";
        print "DONE; creating $orig_branch branch\n" if $opt_v;
        system("git-update-ref", "refs/heads/master", "$remote/$opt_o")
-               unless -f "$git_dir/refs/heads/master";
+               unless defined get_headref('refs/heads/master');
        system("git-symbolic-ref", "$remote/HEAD", "$remote/$opt_o")
                if ($opt_r && $opt_o ne 'HEAD');
        system('git-update-ref', 'HEAD', "$orig_branch");