Merge branch 'po/etc-gitattributes'
authorJunio C Hamano <gitster@pobox.com>
Wed, 29 Sep 2010 20:47:51 +0000 (13:47 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 29 Sep 2010 20:47:51 +0000 (13:47 -0700)
* po/etc-gitattributes:
Add global and system-wide gitattributes

Conflicts:
Documentation/config.txt
Makefile

1  2 
Documentation/config.txt
Documentation/gitattributes.txt
Makefile
configure.ac
t/t0003-attributes.sh
diff --combined Documentation/config.txt
index d82c0da2cf470dbfe7936762d4645b7509647177,a043d55459424cc02d4ec63637c523bdfc011894..e6d74e6ade440a9ea26c4e2f22d54aad6cf6044e
@@@ -128,7 -128,7 +128,7 @@@ advice.*:
                when writing commit messages. Default: true.
        commitBeforeMerge::
                Advice shown when linkgit:git-merge[1] refuses to
 -              merge to avoid overwritting local changes.
 +              merge to avoid overwriting local changes.
                Default: true.
        resolveConflict::
                Advices shown by various commands when conflicts
@@@ -418,7 -418,7 +418,7 @@@ Common unit suffixes of 'k', 'm', or 'g
  
  core.deltaBaseCacheLimit::
        Maximum number of bytes to reserve for caching base objects
 -      that multiple deltafied objects reference.  By storing the
 +      that may be referenced by multiple deltified objects.  By storing the
        entire decompressed base objects in a cache Git is able
        to avoid unpacking and decompressing frequently used base
        objects multiple times.
@@@ -450,15 -450,12 +450,21 @@@ core.excludesfile:
        to the value of `$HOME` and "{tilde}user/" to the specified user's
        home directory.  See linkgit:gitignore[5].
  
 +core.askpass::
 +      Some commands (e.g. svn and http interfaces) that interactively
 +      ask for a password can be told to use an external program given
 +      via the value of this variable. Can be overridden by the 'GIT_ASKPASS'
 +      environment variable. If not set, fall back to the value of the
 +      'SSH_ASKPASS' environment variable or, failing that, a simple password
 +      prompt. The external program shall be given a suitable prompt as
 +      command line argument and write the password on its STDOUT.
 +
+ core.attributesfile::
+       In addition to '.gitattributes' (per-directory) and
+       '.git/info/attributes', git looks into this file for attributes
+       (see linkgit:gitattributes[5]). Path expansions are made the same
+       way as for `core.excludesfile`.
  core.editor::
        Commands such as `commit` and `tag` that lets you edit
        messages by launching an editor uses the value of this
@@@ -572,7 -569,7 +578,7 @@@ not necessarily be the current director
  am.keepcr::
        If true, git-am will call git-mailsplit for patches in mbox format
        with parameter '--keep-cr'. In this case git-mailsplit will
 -      not remove `\r` from lines ending with `\r\n`. Can be overrriden
 +      not remove `\r` from lines ending with `\r\n`. Can be overridden
        by giving '--no-keep-cr' from the command line.
        See linkgit:git-am[1], linkgit:git-mailsplit[1].
  
@@@ -813,6 -810,8 +819,6 @@@ diff.mnemonicprefix:
        standard "a/" and "b/" depending on what is being compared.  When
        this configuration is in effect, reverse diff output also swaps
        the order of the prefixes:
 -diff.noprefix::
 -      If set, 'git diff' does not show any source or destination prefix.
  `git diff`;;
        compares the (i)ndex and the (w)ork tree;
  `git diff HEAD`;;
  `git diff --no-index a b`;;
        compares two non-git things (1) and (2).
  
 +diff.noprefix::
 +      If set, 'git diff' does not show any source or destination prefix.
 +
  diff.renameLimit::
        The number of files to consider when performing the copy/rename
        detection; equivalent to the 'git diff' option '-l'.
@@@ -836,12 -832,6 +842,12 @@@ diff.renames:
        will enable basic rename detection.  If set to "copies" or
        "copy", it will detect copies, as well.
  
 +diff.ignoreSubmodules::
 +      Sets the default value of --ignore-submodules. Note that this
 +      affects only 'git diff' Porcelain, and not lower level 'diff'
 +      commands such as 'git diff-files'. 'git checkout' also honors
 +      this setting when reporting uncommitted changes.
 +
  diff.suppressBlankEmpty::
        A boolean to inhibit the standard behavior of printing a space
        before each empty output line. Defaults to false.
@@@ -1018,7 -1008,7 +1024,7 @@@ gitcvs.usecrlfattr:
        If true, the server will look up the end-of-line conversion
        attributes for files to determine the '-k' modes to use. If
        the attributes force git to treat a file as text,
 -      the '-k' mode will be left blank so cvs clients will
 +      the '-k' mode will be left blank so CVS clients will
        treat it as text. If they suppress text conversion, the file
        will be set with '-kb' mode, which suppresses any newline munging
        the client might otherwise do. If the attributes do not allow
@@@ -1259,15 -1249,6 +1265,15 @@@ http.noEPSV:
        support EPSV mode. Can be overridden by the 'GIT_CURL_FTP_NO_EPSV'
        environment variable. Default is false (curl will use EPSV).
  
 +http.useragent::
 +      The HTTP USER_AGENT string presented to an HTTP server.  The default
 +      value represents the version of the client git such as git/1.7.1.
 +      This option allows you to override this value to a more common value
 +      such as Mozilla/4.0.  This may be necessary, for instance, if
 +      connecting through a firewall that restricts HTTP connections to a set
 +      of common USER_AGENT strings (but not including those like git/1.7.1).
 +      Can be overridden by the 'GIT_HTTP_USER_AGENT' environment variable.
 +
  i18n.commitEncoding::
        Character encoding the commit messages are stored in; git itself
        does not care per se, but this information is necessary e.g. when
@@@ -1300,9 -1281,7 +1306,9 @@@ instaweb.local:
        be bound to the local IP (127.0.0.1).
  
  instaweb.modulepath::
 -      The module path for an apache httpd used by linkgit:git-instaweb[1].
 +      The default module path for linkgit:git-instaweb[1] to use
 +      instead of /usr/lib/apache2/modules.  Only used if httpd
 +      is Apache.
  
  instaweb.port::
        The port number to bind the gitweb httpd to. See
@@@ -1316,11 -1295,10 +1322,11 @@@ interactive.singlekey:
        ignored if portable keystroke input is not available.
  
  log.date::
 -      Set default date-time mode for the log command. Setting log.date
 -      value is similar to using 'git log'\'s --date option. The value is one of the
 -      following alternatives: {relative,local,default,iso,rfc,short}.
 -      See linkgit:git-log[1].
 +      Set the default date-time mode for the 'log' command.
 +      Setting a value for log.date is similar to using 'git log''s
 +      `\--date` option.  Possible values are `relative`, `local`,
 +      `default`, `iso`, `rfc`, and `short`; see linkgit:git-log[1]
 +      for details.
  
  log.decorate::
        Print out the ref names of any commits that are shown by the log
@@@ -1561,9 -1539,6 +1567,9 @@@ rebase.stat:
        Whether to show a diffstat of what changed upstream since the last
        rebase. False by default.
  
 +rebase.autosquash::
 +      If set to true enable '--autosquash' option by default.
 +
  receive.autogc::
        By default, git-receive-pack will run "git-gc --auto" after
        receiving data from git-push and updating refs.  You can stop
@@@ -1589,10 -1564,6 +1595,10 @@@ receive.denyDeletes:
        If set to true, git-receive-pack will deny a ref update that deletes
        the ref. Use this to prevent such a ref deletion via a push.
  
 +receive.denyDeleteCurrent::
 +      If set to true, git-receive-pack will deny a ref update that
 +      deletes the currently checked out branch of a non-bare repository.
 +
  receive.denyCurrentBranch::
        If set to true or "refuse", git-receive-pack will deny a ref update
        to the currently checked out branch of a non-bare repository.
@@@ -1658,9 -1629,7 +1664,9 @@@ remote.<name>.tagopt:
        Setting this value to \--no-tags disables automatic tag following when
        fetching from remote <name>. Setting it to \--tags will fetch every
        tag from remote <name>, even if they are not reachable from remote
 -      branch heads.
 +      branch heads. Passing these flags directly to linkgit:git-fetch[1] can
 +      override this setting. See options \--tags and \--no-tags of
 +      linkgit:git-fetch[1].
  
  remote.<name>.vcs::
        Setting this to a value <vcs> will cause git to interact with
@@@ -1780,19 -1749,6 +1786,19 @@@ submodule.<name>.update:
        URL and other values found in the `.gitmodules` file.  See
        linkgit:git-submodule[1] and linkgit:gitmodules[5] for details.
  
 +submodule.<name>.ignore::
 +      Defines under what circumstances "git status" and the diff family show
 +      a submodule as modified. When set to "all", it will never be considered
 +      modified, "dirty" will ignore all changes to the submodules work tree and
 +      takes only differences between the HEAD of the submodule and the commit
 +      recorded in the superproject into account. "untracked" will additionally
 +      let submodules with modified tracked files in their work tree show up.
 +      Using "none" (the default when this option is not set) also shows
 +      submodules that have untracked files in their work tree as changed.
 +      This setting overrides any setting made in .gitmodules for this submodule,
 +      both settings can be overridden on the command line by using the
 +      "--ignore-submodules" option.
 +
  tar.umask::
        This variable can be used to restrict the permission bits of
        tar archive entries.  The default is 0002, which turns off the
index e5a27d875eb63dbfeccbf5357983f5c94668ffeb,c6bdeae66da33d21993022b4e2a8561b863c3f1e..ed03e2a4aa82d5466901dc7f4048aee78a267d8a
@@@ -62,14 -62,21 +62,21 @@@ consults `$GIT_DIR/info/attributes` fil
  precedence), `.gitattributes` file in the same directory as the
  path in question, and its parent directories up to the toplevel of the
  work tree (the further the directory that contains `.gitattributes`
- is from the path in question, the lower its precedence).
+ is from the path in question, the lower its precedence). Finally
+ global and system-wide files are considered (they have the lowest
+ precedence).
  
  If you wish to affect only a single repository (i.e., to assign
- attributes to files that are particular to one user's workflow), then
+ attributes to files that are particular to
+ one user's workflow for that repository), then
  attributes should be placed in the `$GIT_DIR/info/attributes` file.
  Attributes which should be version-controlled and distributed to other
  repositories (i.e., attributes of interest to all users) should go into
- `.gitattributes` files.
+ `.gitattributes` files. Attributes that should affect all repositories
+ for a single user should be placed in a file specified by the
+ `core.attributesfile` configuration option (see linkgit:git-config[1]).
+ Attributes for all users on a system should be placed in the
+ `$(prefix)/etc/gitattributes` file.
  
  Sometimes you would need to override an setting of an attribute
  for a path to `unspecified` state.  This can be done by listing
@@@ -317,17 -324,6 +324,17 @@@ command is "cat")
        smudge = cat
  ------------------------
  
 +For best results, `clean` should not alter its output further if it is
 +run twice ("clean->clean" should be equivalent to "clean"), and
 +multiple `smudge` commands should not alter `clean`'s output
 +("smudge->smudge->clean" should be equivalent to "clean").  See the
 +section on merging below.
 +
 +The "indent" filter is well-behaved in this regard: it will not modify
 +input that is already correctly indented.  In this case, the lack of a
 +smudge filter means that the clean filter _must_ accept its own output
 +without modifying it.
 +
  
  Interaction between checkin/checkout attributes
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@@ -342,29 -338,6 +349,29 @@@ In the check-out codepath, the blob con
  with `text`, and then `ident` and fed to `filter`.
  
  
 +Merging branches with differing checkin/checkout attributes
 +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 +
 +If you have added attributes to a file that cause the canonical
 +repository format for that file to change, such as adding a
 +clean/smudge filter or text/eol/ident attributes, merging anything
 +where the attribute is not in place would normally cause merge
 +conflicts.
 +
 +To prevent these unnecessary merge conflicts, git can be told to run a
 +virtual check-out and check-in of all three stages of a file when
 +resolving a three-way merge by setting the `merge.renormalize`
 +configuration variable.  This prevents changes caused by check-in
 +conversion from causing spurious merge conflicts when a converted file
 +is merged with an unconverted file.
 +
 +As long as a "smudge->clean" results in the same output as a "clean"
 +even on files that are already smudged, this strategy will
 +automatically resolve all filter-related conflicts.  Filters that do
 +not act in this way may cause additional merge conflicts that must be
 +resolved manually.
 +
 +
  Generating diff text
  ~~~~~~~~~~~~~~~~~~~~
  
@@@ -475,8 -448,6 +482,8 @@@ patterns are available
  
  - `cpp` suitable for source code in the C and C++ languages.
  
 +- `csharp` suitable for source code in the C# language.
 +
  - `html` suitable for HTML/XHTML documents.
  
  - `java` suitable for source code in the Java language.
diff --combined Makefile
index d3dcfb18a7a4dffddb8e8cc742b7c151e639549e,eadd2d734bc701cdfeed8ab21e1a2981fb0cefa3..8a56b9ab49816b003da504fe75f339c5b31f3e82
+++ b/Makefile
@@@ -68,8 -68,6 +68,8 @@@ all:
  #
  # Define NO_MKSTEMPS if you don't have mkstemps in the C library.
  #
 +# Define NO_STRTOK_R if you don't have strtok_r in the C library.
 +#
  # Define NO_LIBGEN_H if you don't have libgen.h.
  #
  # Define NEEDS_LIBGEN if your libgen needs -lgen when linking
@@@ -270,6 -268,7 +270,7 @@@ STRIP ?= stri
  #   infodir
  #   htmldir
  #   ETC_GITCONFIG (but not sysconfdir)
+ #   ETC_GITATTRIBUTES
  # can be specified as a relative path some/where/else;
  # this is interpreted as relative to $(prefix) and "git" at
  # runtime figures out where they are based on the path to the executable.
@@@ -288,9 -287,11 +289,11 @@@ htmldir = share/doc/git-do
  ifeq ($(prefix),/usr)
  sysconfdir = /etc
  ETC_GITCONFIG = $(sysconfdir)/gitconfig
+ ETC_GITATTRIBUTES = $(sysconfdir)/gitattributes
  else
  sysconfdir = $(prefix)/etc
  ETC_GITCONFIG = etc/gitconfig
+ ETC_GITATTRIBUTES = etc/gitattributes
  endif
  lib = lib
  # DESTDIR=
@@@ -310,7 -311,6 +313,7 @@@ TCL_PATH = tcls
  TCLTK_PATH = wish
  PTHREAD_LIBS = -lpthread
  PTHREAD_CFLAGS =
 +GCOV = gcov
  
  export TCL_PATH TCLTK_PATH
  
@@@ -390,8 -390,6 +393,8 @@@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH
          $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
          git-instaweb
  
 +ETAGS_TARGET = TAGS
 +
  # Empty...
  EXTRA_PROGRAMS =
  
@@@ -413,17 -411,12 +416,17 @@@ TEST_PROGRAMS_NEED_X += test-dat
  TEST_PROGRAMS_NEED_X += test-delta
  TEST_PROGRAMS_NEED_X += test-dump-cache-tree
  TEST_PROGRAMS_NEED_X += test-genrandom
 +TEST_PROGRAMS_NEED_X += test-line-buffer
  TEST_PROGRAMS_NEED_X += test-match-trees
 +TEST_PROGRAMS_NEED_X += test-obj-pool
  TEST_PROGRAMS_NEED_X += test-parse-options
  TEST_PROGRAMS_NEED_X += test-path-utils
  TEST_PROGRAMS_NEED_X += test-run-command
  TEST_PROGRAMS_NEED_X += test-sha1
  TEST_PROGRAMS_NEED_X += test-sigchain
 +TEST_PROGRAMS_NEED_X += test-string-pool
 +TEST_PROGRAMS_NEED_X += test-svn-fe
 +TEST_PROGRAMS_NEED_X += test-treap
  TEST_PROGRAMS_NEED_X += test-index-version
  
  TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X))
@@@ -478,7 -471,6 +481,7 @@@ export PYTHON_PAT
  
  LIB_FILE=libgit.a
  XDIFF_LIB=xdiff/lib.a
 +VCSSVN_LIB=vcs-svn/lib.a
  
  LIB_H += advice.h
  LIB_H += archive.h
@@@ -984,7 -976,6 +987,7 @@@ ifeq ($(uname_S),IRIX
        # NO_MMAP.  If you suspect that your compiler is not affected by this
        # issue, comment out the NO_MMAP statement.
        NO_MMAP = YesPlease
 +      NO_REGEX = YesPlease
        SNPRINTF_RETURNS_BOGUS = YesPlease
        SHELL_PATH = /usr/gnu/bin/bash
        NEEDS_LIBGEN = YesPlease
@@@ -1003,7 -994,6 +1006,7 @@@ ifeq ($(uname_S),IRIX64
        # NO_MMAP.  If you suspect that your compiler is not affected by this
        # issue, comment out the NO_MMAP statement.
        NO_MMAP = YesPlease
 +      NO_REGEX = YesPlease
        SNPRINTF_RETURNS_BOGUS = YesPlease
        SHELL_PATH=/usr/gnu/bin/bash
        NEEDS_LIBGEN = YesPlease
@@@ -1048,7 -1038,6 +1051,7 @@@ ifeq ($(uname_S),Windows
        NO_UNSETENV = YesPlease
        NO_STRCASESTR = YesPlease
        NO_STRLCPY = YesPlease
 +      NO_STRTOK_R = YesPlease
        NO_MEMMEM = YesPlease
        # NEEDS_LIBICONV = YesPlease
        NO_ICONV = YesPlease
@@@ -1103,7 -1092,6 +1106,7 @@@ ifneq (,$(findstring MINGW,$(uname_S))
        NO_UNSETENV = YesPlease
        NO_STRCASESTR = YesPlease
        NO_STRLCPY = YesPlease
 +      NO_STRTOK_R = YesPlease
        NO_MEMMEM = YesPlease
        NEEDS_LIBICONV = YesPlease
        OLD_ICONV = YesPlease
        NO_REGEX = YesPlease
        NO_PYTHON = YesPlease
        BLK_SHA1 = YesPlease
 +      ETAGS_TARGET = ETAGS
        COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -DNOGDI -Icompat -Icompat/fnmatch -Icompat/win32
        COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
        COMPAT_OBJS += compat/mingw.o compat/fnmatch/fnmatch.o compat/winansi.o \
@@@ -1335,10 -1322,6 +1338,10 @@@ endi
  ifdef NO_STRTOULL
        COMPAT_CFLAGS += -DNO_STRTOULL
  endif
 +ifdef NO_STRTOK_R
 +      COMPAT_CFLAGS += -DNO_STRTOK_R
 +      COMPAT_OBJS += compat/strtok_r.o
 +endif
  ifdef NO_SETENV
        COMPAT_CFLAGS += -DNO_SETENV
        COMPAT_OBJS += compat/setenv.o
@@@ -1468,7 -1451,7 +1471,7 @@@ ifdef NO_REGE
  endif
  
  ifdef USE_NED_ALLOCATOR
 -       COMPAT_CFLAGS += -DUSE_NED_ALLOCATOR -DOVERRIDE_STRDUP -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -Icompat/nedmalloc
 +       COMPAT_CFLAGS += -Icompat/nedmalloc
         COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
  endif
  
@@@ -1505,7 -1488,6 +1508,7 @@@ ifndef 
        QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
        QUIET_GEN      = @echo '   ' GEN $@;
        QUIET_LNCP     = @echo '   ' LN/CP $@;
 +      QUIET_GCOV     = @echo '   ' GCOV $@;
        QUIET_SUBDIR0  = +@subdir=
        QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
                         $(MAKE) $(PRINT_DIR) -C $$subdir
@@@ -1523,6 -1505,7 +1526,7 @@@ endi
  
  SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
  ETC_GITCONFIG_SQ = $(subst ','\'',$(ETC_GITCONFIG))
+ ETC_GITATTRIBUTES_SQ = $(subst ','\'',$(ETC_GITATTRIBUTES))
  
  DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
  bindir_SQ = $(subst ','\'',$(bindir))
@@@ -1760,9 -1743,7 +1764,9 @@@ ifndef NO_CUR
  endif
  XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
        xdiff/xmerge.o xdiff/xpatience.o
 -OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS)
 +VCSSVN_OBJS = vcs-svn/string_pool.o vcs-svn/line_buffer.o \
 +      vcs-svn/repo_tree.o vcs-svn/fast_export.o vcs-svn/svndump.o
 +OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
  
  dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
  dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
@@@ -1877,18 -1858,12 +1881,18 @@@ builtin/prune.o builtin/reflog.o reacha
  builtin/commit.o builtin/revert.o wt-status.o: wt-status.h
  builtin/tar-tree.o archive-tar.o: tar.h
  builtin/pack-objects.o: thread-utils.h
 +connect.o transport.o http-backend.o: url.h
  http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
 -http.o http-walker.o http-push.o remote-curl.o: http.h
 +http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h
  
  xdiff-interface.o $(XDIFF_OBJS): \
        xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
        xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
 +
 +$(VCSSVN_OBJS): \
 +      vcs-svn/obj_pool.h vcs-svn/trp.h vcs-svn/string_pool.h \
 +      vcs-svn/line_buffer.h vcs-svn/repo_tree.h vcs-svn/fast_export.h \
 +      vcs-svn/svndump.h
  endif
  
  exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
@@@ -1901,21 -1876,14 +1905,23 @@@ builtin/init-db.s builtin/init-db.o: EX
  
  config.s config.o: EXTRA_CPPFLAGS = -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
  
 -http.s http.o: EXTRA_CPPFLAGS = -DGIT_USER_AGENT='"git/$(GIT_VERSION)"'
+ attr.s attr.o: EXTRA_CPPFLAGS = -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
 +http.s http.o: EXTRA_CPPFLAGS = -DGIT_HTTP_USER_AGENT='"git/$(GIT_VERSION)"'
  
  ifdef NO_EXPAT
  http-walker.s http-walker.o: EXTRA_CPPFLAGS = -DNO_EXPAT
  endif
  
 +ifdef NO_REGEX
 +compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
 +endif
 +
 +ifdef USE_NED_ALLOCATOR
 +compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
 +      -DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR
 +endif
 +
  git-%$X: %.o $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  
@@@ -1946,8 -1914,6 +1952,8 @@@ $(LIB_FILE): $(LIB_OBJS
  $(XDIFF_LIB): $(XDIFF_OBJS)
        $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
  
 +$(VCSSVN_LIB): $(VCSSVN_OBJS)
 +      $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS)
  
  doc:
        $(MAKE) -C Documentation all
@@@ -1964,11 -1930,11 +1970,11 @@@ info
  pdf:
        $(MAKE) -C Documentation pdf
  
 -TAGS:
 -      $(RM) TAGS
 -      $(FIND) . -name '*.[hcS]' -print | xargs etags -a
 +$(ETAGS_TARGET): FORCE
 +      $(RM) $(ETAGS_TARGET)
 +      $(FIND) . -name '*.[hcS]' -print | xargs etags -a -o $(ETAGS_TARGET)
  
 -tags:
 +tags: FORCE
        $(RM) tags
        $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
  
@@@ -2046,18 -2012,12 +2052,18 @@@ test-date$X: date.o ctype.
  
  test-delta$X: diff-delta.o patch-delta.o
  
 +test-line-buffer$X: vcs-svn/lib.a
 +
  test-parse-options$X: parse-options.o
  
 +test-string-pool$X: vcs-svn/lib.a
 +
 +test-svn-fe$X: vcs-svn/lib.a
 +
  .PRECIOUS: $(TEST_OBJS)
  
  test-%$X: test-%.o $(GITLIBS)
 -      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
 +      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
  
  check-sha1:: test-sha1$X
        ./test-sha1.sh
@@@ -2121,19 -2081,10 +2127,19 @@@ endi
        bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
        execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
        { test "$$bindir/" = "$$execdir/" || \
 -              { $(RM) "$$execdir/git$X" && \
 +        for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
 +              $(RM) "$$execdir/$$p" && \
                test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
 -              ln "$$bindir/git$X" "$$execdir/git$X" 2>/dev/null || \
 -              cp "$$bindir/git$X" "$$execdir/git$X"; } ; } && \
 +              ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
 +              cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
 +        done; \
 +      } && \
 +      for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
 +              $(RM) "$$bindir/$$p" && \
 +              ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
 +              ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
 +              cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
 +      done && \
        for p in $(BUILT_INS); do \
                $(RM) "$$execdir/$$p" && \
                ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
@@@ -2232,13 -2183,13 +2238,13 @@@ distclean: clea
        $(RM) configure
  
  clean:
 -      $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o \
 -              builtin/*.o $(LIB_FILE) $(XDIFF_LIB)
 +      $(RM) *.o block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \
 +              builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
        $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS)
        $(RM) -r bin-wrappers
        $(RM) -r $(dep_dirs)
 -      $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags cscope*
 +      $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) 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
@@@ -2262,7 -2213,7 +2268,7 @@@ endi
  
  .PHONY: all install clean strip
  .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
 -.PHONY: FORCE TAGS tags cscope
 +.PHONY: FORCE cscope
  
  ### Check documentation
  #
@@@ -2309,7 -2260,6 +2315,7 @@@ check-docs:
                documented,gitglossary | \
                documented,githooks | \
                documented,gitrepository-layout | \
 +              documented,gitrevisions | \
                documented,gittutorial | \
                documented,gittutorial-2 | \
                documented,git-bisect-lk2009 | \
@@@ -2336,18 -2286,11 +2342,18 @@@ coverage
        $(MAKE) coverage-build
        $(MAKE) coverage-report
  
 +object_dirs := $(sort $(dir $(OBJECTS)))
  coverage-clean:
 -      rm -f *.gcda *.gcno
 +      $(RM) $(addsuffix *.gcov,$(object_dirs))
 +      $(RM) $(addsuffix *.gcda,$(object_dirs))
 +      $(RM) $(addsuffix *.gcno,$(object_dirs))
 +      $(RM) coverage-untested-functions
 +      $(RM) -r cover_db/
 +      $(RM) -r cover_db_html/
  
  COVERAGE_CFLAGS = $(CFLAGS) -O0 -ftest-coverage -fprofile-arcs
  COVERAGE_LDFLAGS = $(CFLAGS)  -O0 -lgcov
 +GCOVFLAGS = --preserve-paths --branch-probabilities --all-blocks
  
  coverage-build: coverage-clean
        $(MAKE) CFLAGS="$(COVERAGE_CFLAGS)" LDFLAGS="$(COVERAGE_LDFLAGS)" all
                -j1 test
  
  coverage-report:
 -      gcov -b *.c
 +      $(QUIET_GCOV)for dir in $(object_dirs); do \
 +              $(GCOV) $(GCOVFLAGS) --object-directory=$$dir $$dir*.c || exit; \
 +      done
 +
 +coverage-untested-functions: coverage-report
        grep '^function.*called 0 ' *.c.gcov \
                | sed -e 's/\([^:]*\)\.gcov: *function \([^ ]*\) called.*/\1: \2/' \
 -              | tee coverage-untested-functions
 +              > coverage-untested-functions
 +
 +cover_db: coverage-report
 +      gcov2perl -db cover_db *.gcov
 +
 +cover_db_html: cover_db
 +      cover -report html -outputdir cover_db_html cover_db
diff --combined configure.ac
index 56731c35c9d1b5e2d2c82cdff51ab496dcbac7f5,c5b3a4145fc7c15d4f3beba793864fb60560588f..cc55b6d4f741948f3bd05c6299fabdb9f21d7f95
@@@ -282,7 -282,15 +282,15 @@@ GIT_PARSE_WITH(iconv)
  GIT_PARSE_WITH_SET_MAKE_VAR(gitconfig, ETC_GITCONFIG,
                        Use VALUE instead of /etc/gitconfig as the
                        global git configuration file.
-                       If VALUE is not fully qualified it will be interpretted
+                       If VALUE is not fully qualified it will be interpreted
+                       as a path relative to the computed prefix at runtime.)
+ #
+ # Allow user to set ETC_GITATTRIBUTES variable
+ GIT_PARSE_WITH_SET_MAKE_VAR(gitattributes, ETC_GITATTRIBUTES,
+                       Use VALUE instead of /etc/gitattributes as the
+                       global git attributes file.
+                       If VALUE is not fully qualified it will be interpreted
                        as a path relative to the computed prefix at runtime.)
  
  #
@@@ -706,27 -714,6 +714,27 @@@ els
  fi
  AC_SUBST(NO_C99_FORMAT)
  #
 +# Define NO_REGEX if you have no or inferior regex support in your C library.
 +AC_CACHE_CHECK([whether the platform regex can handle null bytes],
 + [ac_cv_c_excellent_regex], [
 +AC_EGREP_CPP(yippeeyeswehaveit,
 +      AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
 +#include <regex.h>
 +],
 +[#ifdef REG_STARTEND
 +yippeeyeswehaveit
 +#endif
 +]),
 +      [ac_cv_c_excellent_regex=yes],
 +      [ac_cv_c_excellent_regex=no])
 +])
 +if test $ac_cv_c_excellent_regex = yes; then
 +      NO_REGEX=
 +else
 +      NO_REGEX=YesPlease
 +fi
 +AC_SUBST(NO_REGEX)
 +#
  # Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
  # when attempting to read from an fopen'ed directory.
  AC_CACHE_CHECK([whether system succeeds to read fopen'ed directory],
@@@ -804,12 -791,6 +812,12 @@@ GIT_CHECK_FUNC(strcasestr
  [NO_STRCASESTR=YesPlease])
  AC_SUBST(NO_STRCASESTR)
  #
 +# Define NO_STRTOK_R if you don't have strtok_r
 +GIT_CHECK_FUNC(strtok_r,
 +[NO_STRTOK_R=],
 +[NO_STRTOK_R=YesPlease])
 +AC_SUBST(NO_STRTOK_R)
 +#
  # Define NO_MEMMEM if you don't have memmem.
  GIT_CHECK_FUNC(memmem,
  [NO_MEMMEM=],
diff --combined t/t0003-attributes.sh
index de38c7f7aab16a0c2766ef020a3fc03fadece555,a7e24edf5b0ac3157ab2772f3cd94db176e810c1..25205ac0ee5397452428a02698a35d04f72cd501
@@@ -36,6 -36,9 +36,9 @@@ test_expect_success 'setup' 
                echo "d/* test=a/b/d/*"
                echo "d/yes notest"
        ) >a/b/.gitattributes
+       (
+               echo "global test=global"
+       ) >$HOME/global-gitattributes
  
  '
  
@@@ -48,15 -51,25 +51,25 @@@ test_expect_success 'attribute test' 
        attr_check a/b/g a/b/g &&
        attr_check b/g unspecified &&
        attr_check a/b/h a/b/h &&
 -      attr_check a/b/d/g "a/b/d/*"
 -      attr_check onoff unset
 -      attr_check offon set
 -      attr_check no unspecified
 -      attr_check a/b/d/no "a/b/d/*"
 +      attr_check a/b/d/g "a/b/d/*" &&
 +      attr_check onoff unset &&
 +      attr_check offon set &&
 +      attr_check no unspecified &&
 +      attr_check a/b/d/no "a/b/d/*" &&
        attr_check a/b/d/yes unspecified
  
  '
  
+ test_expect_success 'core.attributesfile' '
+       attr_check global unspecified &&
+       git config core.attributesfile "$HOME/global-gitattributes" &&
+       attr_check global global &&
+       git config core.attributesfile "~/global-gitattributes" &&
+       attr_check global global &&
+       echo "global test=precedence" >> .gitattributes &&
+       attr_check global precedence
+ '
  test_expect_success 'attribute test: read paths from stdin' '
  
        cat <<EOF > expect