]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jn/vcs-svn-cleanup' into maint
authorJunio C Hamano <gitster@pobox.com>
Sun, 10 Sep 2017 08:03:09 +0000 (17:03 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sun, 10 Sep 2017 08:03:09 +0000 (17:03 +0900)
Code clean-up.

* jn/vcs-svn-cleanup:
  vcs-svn: move remaining repo_tree functions to fast_export.h
  vcs-svn: remove repo_delete wrapper function
  vcs-svn: remove custom mode constants
  vcs-svn: remove more unused prototypes and declarations

1  2 
Makefile
vcs-svn/fast_export.c
vcs-svn/fast_export.h
vcs-svn/svndump.c

diff --combined Makefile
index 461c845d33cbc5f201096ea4b3e1048492cb0a6a,9b00d5b219f922e1d3cdc4e84de8e2cf69116e53..043ec8377b72ff3d86193982eb866a2f055f752c
+++ b/Makefile
@@@ -19,34 -19,16 +19,34 @@@ all:
  # have been written to the final string if enough space had been available.
  #
  # Define FREAD_READS_DIRECTORIES if you are on a system which succeeds
 -# when attempting to read from an fopen'ed directory.
 +# when attempting to read from an fopen'ed directory (or even to fopen
 +# it at all).
  #
  # Define NO_OPENSSL environment variable if you do not have OpenSSL.
  # This also implies BLK_SHA1.
  #
 -# Define USE_LIBPCRE if you have and want to use libpcre. git-grep will be
 -# able to use Perl-compatible regular expressions.
 -#
 -# Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in
 -# /foo/bar/include and /foo/bar/lib directories.
 +# Define USE_LIBPCRE if you have and want to use libpcre. Various
 +# commands such as log and grep offer runtime options to use
 +# Perl-compatible regular expressions instead of standard or extended
 +# POSIX regular expressions.
 +#
 +# Currently USE_LIBPCRE is a synonym for USE_LIBPCRE1, define
 +# USE_LIBPCRE2 instead if you'd like to use version 2 of the PCRE
 +# library. The USE_LIBPCRE flag will likely be changed to mean v2 by
 +# default in future releases.
 +#
 +# When using USE_LIBPCRE1, define NO_LIBPCRE1_JIT if the PCRE v1
 +# library is compiled without --enable-jit. We will auto-detect
 +# whether the version of the PCRE v1 library in use has JIT support at
 +# all, but we unfortunately can't auto-detect whether JIT support
 +# hasn't been compiled in in an otherwise JIT-supporting version. If
 +# you have link-time errors about a missing `pcre_jit_exec` define
 +# this, or recompile PCRE v1 with --enable-jit.
 +#
 +# Define LIBPCREDIR=/foo/bar if your PCRE header and library files are
 +# in /foo/bar/include and /foo/bar/lib directories. Which version of
 +# PCRE this points to determined by the USE_LIBPCRE1 and USE_LIBPCRE2
 +# variables.
  #
  # Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header.
  #
  #
  # Define MKDIR_WO_TRAILING_SLASH if your mkdir() can't deal with trailing slash.
  #
 -# Define NO_MKSTEMPS if you don't have mkstemps in the C library.
 -#
  # Define NO_GECOS_IN_PWENT if you don't have pw_gecos in struct passwd
  # in the C library.
  #
  # Define PPC_SHA1 environment variable when running make to make use of
  # a bundled SHA1 routine optimized for PowerPC.
  #
 +# Define DC_SHA1 to unconditionally enable the collision-detecting sha1
 +# algorithm. This is slower, but may detect attempted collision attacks.
 +# Takes priority over other *_SHA1 knobs.
 +#
 +# Define DC_SHA1_SUBMODULE in addition to DC_SHA1 to use the
 +# sha1collisiondetection shipped as a submodule instead of the
 +# non-submodule copy in sha1dc/. This is an experimental option used
 +# by the git project to migrate to using sha1collisiondetection as a
 +# submodule.
 +#
 +# Define OPENSSL_SHA1 environment variable when running make to link
 +# with the SHA1 routine from openssl library.
 +#
  # Define SHA1_MAX_BLOCK_SIZE to limit the amount of data that will be hashed
  # in one call to the platform's SHA1_Update(). e.g. APPLE_COMMON_CRYPTO
  # wants 'SHA1_MAX_BLOCK_SIZE=1024L*1024L*1024L' defined.
  # apostrophes to be ASCII so that cut&pasting examples to the shell
  # will work.
  #
 +# Define USE_ASCIIDOCTOR to use Asciidoctor instead of AsciiDoc to build the
 +# documentation.
 +#
 +# Define ASCIIDOCTOR_EXTENSIONS_LAB to point to the location of the Asciidoctor
 +# Extensions Lab if you have it available.
 +#
  # Define PERL_PATH to the path of your Perl binary (usually /usr/bin/perl).
  #
  # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
  # is a simplified version of the merge sort used in glibc. This is
  # recommended if Git triggers O(n^2) behavior in your platform's qsort().
  #
 +# Define HAVE_ISO_QSORT_S if your platform provides a qsort_s() that's
 +# compatible with the one described in C11 Annex K.
 +#
  # Define UNRELIABLE_FSTAT if your system's fstat does not return the same
  # information on a not yet closed file that lstat would return for the same
  # file after it was closed.
  #
  # Define NATIVE_CRLF if your platform uses CRLF for line endings.
  #
 -# Define XDL_FAST_HASH to use an alternative line-hashing method in
 -# the diff algorithm.  It gives a nice speedup if your processor has
 -# fast unaligned word loads.  Does NOT work on big-endian systems!
 -# Enabled by default on x86_64.
 -#
  # Define GIT_USER_AGENT if you want to change how git identifies itself during
  # network interactions.  The default is "git/$(GIT_VERSION)".
  #
@@@ -500,7 -467,6 +500,7 @@@ SPATCH = spatc
  export TCL_PATH TCLTK_PATH
  
  SPARSE_FLAGS =
 +SPATCH_FLAGS = --all-includes
  
  
  
@@@ -560,10 -526,12 +560,10 @@@ SCRIPT_LIB += git-sh-setu
  SCRIPT_LIB += git-sh-i18n
  
  SCRIPT_PERL += git-add--interactive.perl
 -SCRIPT_PERL += git-difftool.perl
  SCRIPT_PERL += git-archimport.perl
  SCRIPT_PERL += git-cvsexportcommit.perl
  SCRIPT_PERL += git-cvsimport.perl
  SCRIPT_PERL += git-cvsserver.perl
 -SCRIPT_PERL += git-relink.perl
  SCRIPT_PERL += git-send-email.perl
  SCRIPT_PERL += git-svn.perl
  
@@@ -645,17 -613,14 +645,17 @@@ TEST_PROGRAMS_NEED_X += test-fake-ss
  TEST_PROGRAMS_NEED_X += test-genrandom
  TEST_PROGRAMS_NEED_X += test-hashmap
  TEST_PROGRAMS_NEED_X += test-index-version
 +TEST_PROGRAMS_NEED_X += test-lazy-init-name-hash
  TEST_PROGRAMS_NEED_X += test-line-buffer
  TEST_PROGRAMS_NEED_X += test-match-trees
  TEST_PROGRAMS_NEED_X += test-mergesort
  TEST_PROGRAMS_NEED_X += test-mktemp
 +TEST_PROGRAMS_NEED_X += test-online-cpus
  TEST_PROGRAMS_NEED_X += test-parse-options
  TEST_PROGRAMS_NEED_X += test-path-utils
  TEST_PROGRAMS_NEED_X += test-prio-queue
  TEST_PROGRAMS_NEED_X += test-read-cache
 +TEST_PROGRAMS_NEED_X += test-ref-store
  TEST_PROGRAMS_NEED_X += test-regex
  TEST_PROGRAMS_NEED_X += test-revision-walking
  TEST_PROGRAMS_NEED_X += test-run-command
@@@ -663,7 -628,6 +663,7 @@@ TEST_PROGRAMS_NEED_X += test-scrap-cach
  TEST_PROGRAMS_NEED_X += test-sha1
  TEST_PROGRAMS_NEED_X += test-sha1-array
  TEST_PROGRAMS_NEED_X += test-sigchain
 +TEST_PROGRAMS_NEED_X += test-strcmp-offset
  TEST_PROGRAMS_NEED_X += test-string-list
  TEST_PROGRAMS_NEED_X += test-submodule-config
  TEST_PROGRAMS_NEED_X += test-subprocess
@@@ -734,7 -698,6 +734,7 @@@ LIB_OBJS += abspath.
  LIB_OBJS += advice.o
  LIB_OBJS += alias.o
  LIB_OBJS += alloc.o
 +LIB_OBJS += apply.o
  LIB_OBJS += archive.o
  LIB_OBJS += archive-tar.o
  LIB_OBJS += archive-zip.o
@@@ -742,7 -705,6 +742,7 @@@ LIB_OBJS += argv-array.
  LIB_OBJS += attr.o
  LIB_OBJS += base85.o
  LIB_OBJS += bisect.o
 +LIB_OBJS += blame.o
  LIB_OBJS += blob.o
  LIB_OBJS += branch.o
  LIB_OBJS += bulk-checkin.o
@@@ -815,7 -777,6 +815,7 @@@ LIB_OBJS += notes-cache.
  LIB_OBJS += notes-merge.o
  LIB_OBJS += notes-utils.o
  LIB_OBJS += object.o
 +LIB_OBJS += oidset.o
  LIB_OBJS += pack-bitmap.o
  LIB_OBJS += pack-bitmap-write.o
  LIB_OBJS += pack-check.o
@@@ -842,11 -803,9 +842,11 @@@ LIB_OBJS += reflog-walk.
  LIB_OBJS += refs.o
  LIB_OBJS += refs/files-backend.o
  LIB_OBJS += refs/iterator.o
 +LIB_OBJS += refs/ref-cache.o
  LIB_OBJS += ref-filter.o
  LIB_OBJS += remote.o
  LIB_OBJS += replace_object.o
 +LIB_OBJS += repository.o
  LIB_OBJS += rerere.o
  LIB_OBJS += resolve-undo.o
  LIB_OBJS += revision.o
@@@ -868,11 -827,9 +868,11 @@@ LIB_OBJS += streaming.
  LIB_OBJS += string-list.o
  LIB_OBJS += submodule.o
  LIB_OBJS += submodule-config.o
 +LIB_OBJS += sub-process.o
  LIB_OBJS += symlinks.o
  LIB_OBJS += tag.o
  LIB_OBJS += tempfile.o
 +LIB_OBJS += tmp-objdir.o
  LIB_OBJS += trace.o
  LIB_OBJS += trailer.o
  LIB_OBJS += transport.o
@@@ -928,7 -885,6 +928,7 @@@ BUILTIN_OBJS += builtin/diff-files.
  BUILTIN_OBJS += builtin/diff-index.o
  BUILTIN_OBJS += builtin/diff-tree.o
  BUILTIN_OBJS += builtin/diff.o
 +BUILTIN_OBJS += builtin/difftool.o
  BUILTIN_OBJS += builtin/fast-export.o
  BUILTIN_OBJS += builtin/fetch-pack.o
  BUILTIN_OBJS += builtin/fetch.o
@@@ -970,7 -926,6 +970,7 @@@ BUILTIN_OBJS += builtin/prune.
  BUILTIN_OBJS += builtin/pull.o
  BUILTIN_OBJS += builtin/push.o
  BUILTIN_OBJS += builtin/read-tree.o
 +BUILTIN_OBJS += builtin/rebase--helper.o
  BUILTIN_OBJS += builtin/receive-pack.o
  BUILTIN_OBJS += builtin/reflog.o
  BUILTIN_OBJS += builtin/remote.o
@@@ -1010,10 -965,6 +1010,10 @@@ EXTLIBS 
  
  GIT_USER_AGENT = git/$(GIT_VERSION)
  
 +ifeq ($(wildcard sha1collisiondetection/lib/sha1.h),sha1collisiondetection/lib/sha1.h)
 +DC_SHA1_SUBMODULE = auto
 +endif
 +
  include config.mak.uname
  -include config.mak.autogen
  -include config.mak
@@@ -1022,19 -973,6 +1022,19 @@@ ifdef DEVELOPE
  CFLAGS += $(DEVELOPER_CFLAGS)
  endif
  
 +comma := ,
 +empty :=
 +space := $(empty) $(empty)
 +
 +ifdef SANITIZE
 +SANITIZERS := $(foreach flag,$(subst $(comma),$(space),$(SANITIZE)),$(flag))
 +BASIC_CFLAGS += -fsanitize=$(SANITIZE) -fno-sanitize-recover=$(SANITIZE)
 +BASIC_CFLAGS += -fno-omit-frame-pointer
 +ifneq ($(filter undefined,$(SANITIZERS)),)
 +BASIC_CFLAGS += -DNO_UNALIGNED_LOADS
 +endif
 +endif
 +
  ifndef sysconfdir
  ifeq ($(prefix),/usr)
  sysconfdir = /etc
@@@ -1129,29 -1067,13 +1129,29 @@@ ifdef NO_LIBGEN_
        COMPAT_OBJS += compat/basename.o
  endif
  
 -ifdef USE_LIBPCRE
 -      BASIC_CFLAGS += -DUSE_LIBPCRE
 -      ifdef LIBPCREDIR
 -              BASIC_CFLAGS += -I$(LIBPCREDIR)/include
 -              EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
 +USE_LIBPCRE1 ?= $(USE_LIBPCRE)
 +
 +ifneq (,$(USE_LIBPCRE1))
 +      ifdef USE_LIBPCRE2
 +$(error Only set USE_LIBPCRE1 (or its alias USE_LIBPCRE) or USE_LIBPCRE2, not both!)
        endif
 +
 +      BASIC_CFLAGS += -DUSE_LIBPCRE1
        EXTLIBS += -lpcre
 +
 +ifdef NO_LIBPCRE1_JIT
 +      BASIC_CFLAGS += -DNO_LIBPCRE1_JIT
 +endif
 +endif
 +
 +ifdef USE_LIBPCRE2
 +      BASIC_CFLAGS += -DUSE_LIBPCRE2
 +      EXTLIBS += -lpcre2-8
 +endif
 +
 +ifdef LIBPCREDIR
 +      BASIC_CFLAGS += -I$(LIBPCREDIR)/include
 +      EXTLIBS += -L$(LIBPCREDIR)/$(lib) $(CC_LD_DYNPATH)$(LIBPCREDIR)/$(lib)
  endif
  
  ifdef HAVE_ALLOCA_H
@@@ -1352,6 -1274,9 +1352,6 @@@ ifdef MKDIR_WO_TRAILING_SLAS
        COMPAT_CFLAGS += -DMKDIR_WO_TRAILING_SLASH
        COMPAT_OBJS += compat/mkdir.o
  endif
 -ifdef NO_MKSTEMPS
 -      COMPAT_CFLAGS += -DNO_MKSTEMPS
 -endif
  ifdef NO_UNSETENV
        COMPAT_CFLAGS += -DNO_UNSETENV
        COMPAT_OBJS += compat/unsetenv.o
@@@ -1455,40 -1380,20 +1455,40 @@@ ifdef APPLE_COMMON_CRYPT
        SHA1_MAX_BLOCK_SIZE = 1024L*1024L*1024L
  endif
  
 +ifdef OPENSSL_SHA1
 +      EXTLIBS += $(LIB_4_CRYPTO)
 +      BASIC_CFLAGS += -DSHA1_OPENSSL
 +else
  ifdef BLK_SHA1
 -      SHA1_HEADER = "block-sha1/sha1.h"
        LIB_OBJS += block-sha1/sha1.o
 +      BASIC_CFLAGS += -DSHA1_BLK
  else
  ifdef PPC_SHA1
 -      SHA1_HEADER = "ppc/sha1.h"
        LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
 +      BASIC_CFLAGS += -DSHA1_PPC
  else
  ifdef APPLE_COMMON_CRYPTO
        COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
 -      SHA1_HEADER = <CommonCrypto/CommonDigest.h>
 +      BASIC_CFLAGS += -DSHA1_APPLE
  else
 -      SHA1_HEADER = <openssl/sha.h>
 -      EXTLIBS += $(LIB_4_CRYPTO)
 +      DC_SHA1 := YesPlease
 +ifdef DC_SHA1_SUBMODULE
 +      LIB_OBJS += sha1collisiondetection/lib/sha1.o
 +      LIB_OBJS += sha1collisiondetection/lib/ubc_check.o
 +      BASIC_CFLAGS += -DDC_SHA1_SUBMODULE
 +else
 +      LIB_OBJS += sha1dc/sha1.o
 +      LIB_OBJS += sha1dc/ubc_check.o
 +endif
 +      BASIC_CFLAGS += \
 +              -DSHA1_DC \
 +              -DSHA1DC_NO_STANDARD_INCLUDES \
 +              -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
 +              -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
 +              -DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_C="\"sha1dc_git.c\"" \
 +              -DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_H="\"sha1dc_git.h\"" \
 +              -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
 +endif
  endif
  endif
  endif
@@@ -1515,11 -1420,6 +1515,11 @@@ ifdef INTERNAL_QSOR
        COMPAT_CFLAGS += -DINTERNAL_QSORT
        COMPAT_OBJS += compat/qsort.o
  endif
 +ifdef HAVE_ISO_QSORT_S
 +      COMPAT_CFLAGS += -DHAVE_ISO_QSORT_S
 +else
 +      COMPAT_OBJS += compat/qsort_s.o
 +endif
  ifdef RUNTIME_PREFIX
        COMPAT_CFLAGS += -DRUNTIME_PREFIX
  endif
@@@ -1582,6 -1482,10 +1582,6 @@@ ifndef NO_MSGFMT_EXTENDED_OPTION
        MSGFMT += --check --statistics
  endif
  
 -ifneq (,$(XDL_FAST_HASH))
 -      BASIC_CFLAGS += -DXDL_FAST_HASH
 -endif
 -
  ifdef GMTIME_UNRELIABLE_ERRORS
        COMPAT_OBJS += compat/gmtime.o
        BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
@@@ -1680,6 -1584,7 +1680,6 @@@ endi
  
  # Shell quote (do not use $(call) to accommodate ancient setups);
  
 -SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
  ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
  ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES))
  
@@@ -1712,7 -1617,8 +1712,7 @@@ PERLLIB_EXTRA_SQ = $(subst ','\'',$(PER
  # from the dependency list, that would make each entry appear twice.
  LIBS = $(filter-out %.o, $(GITLIBS)) $(EXTLIBS)
  
 -BASIC_CFLAGS += -DSHA1_HEADER='$(SHA1_HEADER_SQ)' \
 -      $(COMPAT_CFLAGS)
 +BASIC_CFLAGS += $(COMPAT_CFLAGS)
  LIB_OBJS += $(COMPAT_OBJS)
  
  # Quote for C
@@@ -1916,7 -1822,7 +1916,7 @@@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEF
  git.res: git.rc GIT-VERSION-FILE
        $(QUIET_RC)$(RC) \
          $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \
 -        -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
 +        -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@
  
  # This makes sure we depend on the NO_PERL setting itself.
  $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS
@@@ -1928,7 -1834,6 +1928,7 @@@ perl/perl.mak: perl/PM.stam
  
  perl/PM.stamp: FORCE
        @$(FIND) perl -type f -name '*.pm' | sort >$@+ && \
 +      $(PERL_PATH) -V >>$@+ && \
        { cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; } && \
        $(RM) $@+
  
@@@ -2037,7 -1942,6 +2037,6 @@@ XDIFF_OBJS += xdiff/xhistogram.
  
  VCSSVN_OBJS += vcs-svn/line_buffer.o
  VCSSVN_OBJS += vcs-svn/sliding_window.o
- VCSSVN_OBJS += vcs-svn/repo_tree.o
  VCSSVN_OBJS += vcs-svn/fast_export.o
  VCSSVN_OBJS += vcs-svn/svndiff.o
  VCSSVN_OBJS += vcs-svn/svndump.o
@@@ -2147,7 -2051,7 +2146,7 @@@ git-%$X: %.o GIT-LDFLAGS $(GITLIBS
  
  git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 -              $(LIBS) $(IMAP_SEND_LDFLAGS)
 +              $(IMAP_SEND_LDFLAGS) $(LIBS)
  
  git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
@@@ -2206,8 -2110,7 +2205,8 @@@ XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --
        --keyword=_ --keyword=N_ --keyword="Q_:1,2"
  XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
        --keyword=gettextln --keyword=eval_gettextln
 -XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
 +XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --language=Perl \
 +      --keyword=__ --keyword=N__ --keyword="__n:1,2"
  LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
  LOCALIZED_SH = $(SCRIPT_SH)
  LOCALIZED_SH += git-parse-remote.sh
@@@ -2221,33 -2124,12 +2220,33 @@@ LOCALIZED_SH += t/t0200/test.s
  LOCALIZED_PERL += t/t0200/test.perl
  endif
  
 +## Note that this is meant to be run only by the localization coordinator
 +## under a very controlled condition, i.e. (1) it is to be run in a
 +## Git repository (not a tarball extract), (2) any local modifications
 +## will be lost.
 +## Gettext tools cannot work with our own custom PRItime type, so
 +## we replace PRItime with PRIuMAX.  We need to update this to
 +## PRIdMAX if we switch to a signed type later.
 +
  po/git.pot: $(GENERATED_H) FORCE
 +      # All modifications will be reverted at the end, so we do not
 +      # want to have any local change.
 +      git diff --quiet HEAD && git diff --quiet --cached
 +
 +      @for s in $(LOCALIZED_C) $(LOCALIZED_SH) $(LOCALIZED_PERL); \
 +      do \
 +              sed -e 's|PRItime|PRIuMAX|g' <"$$s" >"$$s+" && \
 +              cat "$$s+" >"$$s" && rm "$$s+"; \
 +      done
 +
        $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)
        $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \
                $(LOCALIZED_SH)
        $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_PERL) \
                $(LOCALIZED_PERL)
 +
 +      # Reverting the munged source, leaving only the updated $@
 +      git reset --hard
        mv $@+ $@
  
  .PHONY: pot
@@@ -2263,22 -2145,9 +2262,22 @@@ endi
  po/build/locale/%/LC_MESSAGES/git.mo: po/%.po
        $(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<
  
 -FIND_SOURCE_FILES = ( git ls-files '*.[hcS]' 2>/dev/null || \
 -                      $(FIND) . \( -name .git -type d -prune \) \
 -                              -o \( -name '*.[hcS]' -type f -print \) )
 +FIND_SOURCE_FILES = ( \
 +      git ls-files \
 +              '*.[hcS]' \
 +              '*.sh' \
 +              ':!*[tp][0-9][0-9][0-9][0-9]*' \
 +              ':!contrib' \
 +              2>/dev/null || \
 +      $(FIND) . \
 +              \( -name .git -type d -prune \) \
 +              -o \( -name '[tp][0-9][0-9][0-9][0-9]*' -prune \) \
 +              -o \( -name contrib -type d -prune \) \
 +              -o \( -name build -type d -prune \) \
 +              -o \( -name 'trash*' -type d -prune \) \
 +              -o \( -name '*.[hcS]' -type f -print \) \
 +              -o \( -name '*.sh' -type f -print \) \
 +      )
  
  $(ETAGS_TARGET): FORCE
        $(RM) $(ETAGS_TARGET)
@@@ -2332,15 -2201,11 +2331,15 @@@ GIT-BUILD-OPTIONS: FORC
        @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+
        @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+
        @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
 -      @echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@+
 +      @echo USE_LIBPCRE1=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE1)))'\' >>$@+
 +      @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+
 +      @echo NO_LIBPCRE1_JIT=\''$(subst ','\'',$(subst ','\'',$(NO_LIBPCRE1_JIT)))'\' >>$@+
        @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
 +      @echo NO_PTHREADS=\''$(subst ','\'',$(subst ','\'',$(NO_PTHREADS)))'\' >>$@+
        @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
        @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
        @echo PAGER_ENV=\''$(subst ','\'',$(subst ','\'',$(PAGER_ENV)))'\' >>$@+
 +      @echo DC_SHA1=\''$(subst ','\'',$(subst ','\'',$(DC_SHA1)))'\' >>$@+
  ifdef TEST_OUTPUT_DIRECTORY
        @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
  endif
@@@ -2367,12 -2232,6 +2366,12 @@@ endi
  ifdef GIT_PERF_MAKE_OPTS
        @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+
  endif
 +ifdef GIT_PERF_MAKE_COMMAND
 +      @echo GIT_PERF_MAKE_COMMAND=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_COMMAND)))'\' >>$@+
 +endif
 +ifdef GIT_INTEROP_MAKE_OPTS
 +      @echo GIT_INTEROP_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_INTEROP_MAKE_OPTS)))'\' >>$@+
 +endif
  ifdef TEST_GIT_INDEX_VERSION
        @echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
  endif
@@@ -2453,17 -2312,9 +2452,17 @@@ check: common-cmds.
  C_SOURCES = $(patsubst %.o,%.c,$(C_OBJ))
  %.cocci.patch: %.cocci $(C_SOURCES)
        @echo '    ' SPATCH $<; \
 +      ret=0; \
        for f in $(C_SOURCES); do \
 -              $(SPATCH) --sp-file $< $$f; \
 -      done >$@ 2>$@.log; \
 +              $(SPATCH) --sp-file $< $$f $(SPATCH_FLAGS) || \
 +                      { ret=$$?; break; }; \
 +      done >$@+ 2>$@.log; \
 +      if test $$ret != 0; \
 +      then \
 +              cat $@.log; \
 +              exit 1; \
 +      fi; \
 +      mv $@+ $@; \
        if test -s $@; \
        then \
                echo '    ' SPATCH result: $@; \
diff --combined vcs-svn/fast_export.c
index 5a89db30e3ffcb64ee25597fe014592929e07abb,5bd455b8c88e0b7a1340f2791b82b3fab5270218..3fd047a8b82b1c2a6b32ec0a5ded3d67913b5be0
@@@ -6,7 -6,6 +6,6 @@@
  #include "cache.h"
  #include "quote.h"
  #include "fast_export.h"
- #include "repo_tree.h"
  #include "strbuf.h"
  #include "svndiff.h"
  #include "sliding_window.h"
@@@ -68,12 -67,12 +67,12 @@@ void fast_export_modify(const char *pat
  }
  
  void fast_export_begin_note(uint32_t revision, const char *author,
 -              const char *log, unsigned long timestamp, const char *note_ref)
 +              const char *log, timestamp_t timestamp, const char *note_ref)
  {
        static int firstnote = 1;
        size_t loglen = strlen(log);
        printf("commit %s\n", note_ref);
 -      printf("committer %s <%s@%s> %lu +0000\n", author, author, "local", timestamp);
 +      printf("committer %s <%s@%s> %"PRItime" +0000\n", author, author, "local", timestamp);
        printf("data %"PRIuMAX"\n", (uintmax_t)loglen);
        fwrite(log, loglen, 1, stdout);
        if (firstnote) {
@@@ -93,7 -92,7 +92,7 @@@ static char gitsvnline[MAX_GITSVN_LINE_
  void fast_export_begin_commit(uint32_t revision, const char *author,
                        const struct strbuf *log,
                        const char *uuid, const char *url,
 -                      unsigned long timestamp, const char *local_ref)
 +                      timestamp_t timestamp, const char *local_ref)
  {
        static const struct strbuf empty = STRBUF_INIT;
        if (!log)
        }
        printf("commit %s\n", local_ref);
        printf("mark :%"PRIu32"\n", revision);
 -      printf("committer %s <%s@%s> %lu +0000\n",
 +      printf("committer %s <%s@%s> %"PRItime" +0000\n",
                   *author ? author : "nobody",
                   *author ? author : "nobody",
                   *uuid ? uuid : "local", timestamp);
@@@ -210,7 -209,7 +209,7 @@@ static long apply_delta(off_t len, stru
                        die("invalid cat-blob response: %s", response);
                check_preimage_overflow(preimage.max_off, 1);
        }
-       if (old_mode == REPO_MODE_LNK) {
+       if (old_mode == S_IFLNK) {
                strbuf_addstr(&preimage.buf, "link ");
                check_preimage_overflow(preimage.max_off, strlen("link "));
                preimage.max_off += strlen("link ");
@@@ -244,7 -243,7 +243,7 @@@ void fast_export_buf_to_data(const stru
  void fast_export_data(uint32_t mode, off_t len, struct line_buffer *input)
  {
        assert(len >= 0);
-       if (mode == REPO_MODE_LNK) {
+       if (mode == S_IFLNK) {
                /* svn symlink blobs start with "link " */
                if (len < 5)
                        die("invalid dump: symlink too short for \"link\" prefix");
@@@ -312,6 -311,40 +311,40 @@@ int fast_export_ls(const char *path, ui
        return parse_ls_response(get_response_line(), mode, dataref);
  }
  
+ const char *fast_export_read_path(const char *path, uint32_t *mode_out)
+ {
+       int err;
+       static struct strbuf buf = STRBUF_INIT;
+       strbuf_reset(&buf);
+       err = fast_export_ls(path, mode_out, &buf);
+       if (err) {
+               if (errno != ENOENT)
+                       die_errno("BUG: unexpected fast_export_ls error");
+               /* Treat missing paths as directories. */
+               *mode_out = S_IFDIR;
+               return NULL;
+       }
+       return buf.buf;
+ }
+ void fast_export_copy(uint32_t revision, const char *src, const char *dst)
+ {
+       int err;
+       uint32_t mode;
+       static struct strbuf data = STRBUF_INIT;
+       strbuf_reset(&data);
+       err = fast_export_ls_rev(revision, src, &mode, &data);
+       if (err) {
+               if (errno != ENOENT)
+                       die_errno("BUG: unexpected fast_export_ls_rev error");
+               fast_export_delete(dst);
+               return;
+       }
+       fast_export_modify(dst, mode, data.buf);
+ }
  void fast_export_blob_delta(uint32_t mode,
                                uint32_t old_mode, const char *old_data,
                                off_t len, struct line_buffer *input)
  
        assert(len >= 0);
        postimage_len = apply_delta(len, input, old_data, old_mode);
-       if (mode == REPO_MODE_LNK) {
+       if (mode == S_IFLNK) {
                buffer_skip_bytes(&postimage, strlen("link "));
                postimage_len -= strlen("link ");
        }
diff --combined vcs-svn/fast_export.h
index b9a3b71c99fd59312f493d6b1eb24c9a0b44578c,ae8ab7e589fd83dd198f18dd692f30b86379f995..60b79c35b97cbdc9589fe3778ac1f4b5f61646ff
@@@ -11,10 -11,10 +11,10 @@@ void fast_export_delete(const char *pat
  void fast_export_modify(const char *path, uint32_t mode, const char *dataref);
  void fast_export_note(const char *committish, const char *dataref);
  void fast_export_begin_note(uint32_t revision, const char *author,
 -              const char *log, unsigned long timestamp, const char *note_ref);
 +              const char *log, timestamp_t timestamp, const char *note_ref);
  void fast_export_begin_commit(uint32_t revision, const char *author,
                        const struct strbuf *log, const char *uuid,const char *url,
 -                      unsigned long timestamp, const char *local_ref);
 +                      timestamp_t timestamp, const char *local_ref);
  void fast_export_end_commit(uint32_t revision);
  void fast_export_data(uint32_t mode, off_t len, struct line_buffer *input);
  void fast_export_buf_to_data(const struct strbuf *data);
@@@ -28,4 -28,7 +28,7 @@@ int fast_export_ls_rev(uint32_t rev, co
  int fast_export_ls(const char *path,
                        uint32_t *mode_out, struct strbuf *dataref_out);
  
+ void fast_export_copy(uint32_t revision, const char *src, const char *dst);
+ const char *fast_export_read_path(const char *path, uint32_t *mode_out);
  #endif
diff --combined vcs-svn/svndump.c
index 37c4a36b921a4dc5c6c370b08c03441c83590d45,01b6ded400dace5d7d91605de3d57ffd158d6730..ec6b350611d367fd75f909c4695d9faf2d68f91e
@@@ -8,7 -8,6 +8,6 @@@
   */
  
  #include "cache.h"
- #include "repo_tree.h"
  #include "fast_export.h"
  #include "line_buffer.h"
  #include "strbuf.h"
@@@ -47,7 -46,7 +46,7 @@@ static struct 
  
  static struct {
        uint32_t revision;
 -      unsigned long timestamp;
 +      timestamp_t timestamp;
        struct strbuf log, author, note;
  } rev_ctx;
  
@@@ -134,13 -133,13 +133,13 @@@ static void handle_property(const struc
                        die("invalid dump: sets type twice");
                }
                if (!val) {
-                       node_ctx.type = REPO_MODE_BLB;
+                       node_ctx.type = S_IFREG | 0644;
                        return;
                }
                *type_set = 1;
                node_ctx.type = keylen == strlen("svn:executable") ?
-                               REPO_MODE_EXE :
-                               REPO_MODE_LNK;
+                               (S_IFREG | 0755) :
+                               S_IFLNK;
        }
  }
  
@@@ -219,45 -218,45 +218,45 @@@ static void handle_node(void
         */
        static const char *const empty_blob = "::empty::";
        const char *old_data = NULL;
-       uint32_t old_mode = REPO_MODE_BLB;
+       uint32_t old_mode = S_IFREG | 0644;
  
        if (node_ctx.action == NODEACT_DELETE) {
                if (have_text || have_props || node_ctx.srcRev)
                        die("invalid dump: deletion node has "
                                "copyfrom info, text, or properties");
-               svn_repo_delete(node_ctx.dst.buf);
+               fast_export_delete(node_ctx.dst.buf);
                return;
        }
        if (node_ctx.action == NODEACT_REPLACE) {
-               svn_repo_delete(node_ctx.dst.buf);
+               fast_export_delete(node_ctx.dst.buf);
                node_ctx.action = NODEACT_ADD;
        }
        if (node_ctx.srcRev) {
-               svn_repo_copy(node_ctx.srcRev, node_ctx.src.buf, node_ctx.dst.buf);
+               fast_export_copy(node_ctx.srcRev, node_ctx.src.buf, node_ctx.dst.buf);
                if (node_ctx.action == NODEACT_ADD)
                        node_ctx.action = NODEACT_CHANGE;
        }
-       if (have_text && type == REPO_MODE_DIR)
+       if (have_text && type == S_IFDIR)
                die("invalid dump: directories cannot have text attached");
  
        /*
         * Find old content (old_data) and decide on the new mode.
         */
        if (node_ctx.action == NODEACT_CHANGE && !*node_ctx.dst.buf) {
-               if (type != REPO_MODE_DIR)
+               if (type != S_IFDIR)
                        die("invalid dump: root of tree is not a regular file");
                old_data = NULL;
        } else if (node_ctx.action == NODEACT_CHANGE) {
                uint32_t mode;
-               old_data = svn_repo_read_path(node_ctx.dst.buf, &mode);
-               if (mode == REPO_MODE_DIR && type != REPO_MODE_DIR)
+               old_data = fast_export_read_path(node_ctx.dst.buf, &mode);
+               if (mode == S_IFDIR && type != S_IFDIR)
                        die("invalid dump: cannot modify a directory into a file");
-               if (mode != REPO_MODE_DIR && type == REPO_MODE_DIR)
+               if (mode != S_IFDIR && type == S_IFDIR)
                        die("invalid dump: cannot modify a file into a directory");
                node_ctx.type = mode;
                old_mode = mode;
        } else if (node_ctx.action == NODEACT_ADD) {
-               if (type == REPO_MODE_DIR)
+               if (type == S_IFDIR)
                        old_data = NULL;
                else if (have_text)
                        old_data = empty_blob;
        /*
         * Save the result.
         */
-       if (type == REPO_MODE_DIR)      /* directories are not tracked. */
+       if (type == S_IFDIR)    /* directories are not tracked. */
                return;
        assert(old_data);
        if (old_data == empty_blob)
@@@ -385,9 -384,9 +384,9 @@@ void svndump_read(const char *url, cons
                                continue;
                        strbuf_addf(&rev_ctx.note, "%s\n", t);
                        if (!strcmp(val, "dir"))
-                               node_ctx.type = REPO_MODE_DIR;
+                               node_ctx.type = S_IFDIR;
                        else if (!strcmp(val, "file"))
-                               node_ctx.type = REPO_MODE_BLB;
+                               node_ctx.type = S_IFREG | 0644;
                        else
                                fprintf(stderr, "Unknown node-kind: %s\n", val);
                        break;