Merge the attributes fix in from maint-1.6.7 branch
authorJunio C Hamano <gitster@pobox.com>
Tue, 10 Jan 2012 22:24:01 +0000 (14:24 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Jan 2012 22:24:01 +0000 (14:24 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1  2 
Documentation/config.txt
t/t0003-attributes.sh
diff --combined Documentation/config.txt
index 295939094f050c3b8ec1b95164bdd0b9b8c1dd95,3bcf660e0256b3706d8d78e3cb152dcf3b1b740a..9fba453f23754b3afc3268f9e6c1db90dca3e55e
@@@ -45,10 -45,9 +45,10 @@@ lines.  Variables may belong directly t
  You can have `[section]` if you have `[section "subsection"]`, but you
  don't need to.
  
 -There is also a case insensitive alternative `[section.subsection]` syntax.
 -In this syntax, subsection names follow the same restrictions as for section
 -names.
 +There is also a deprecated `[section.subsection]` syntax. With this
 +syntax, the subsection name is converted to lower-case and is also
 +compared case sensitively. These subsection names follow the same
 +restrictions as section names.
  
  All the other lines (and the remainder of the line after the section
  header) are recognized as setting variables, in the form
@@@ -115,32 -114,35 +115,32 @@@ in the appropriate manual page. You wil
  porcelain configuration variables in the respective porcelain documentation.
  
  advice.*::
 -      When set to 'true', display the given optional help message.
 -      When set to 'false', do not display. The configuration variables
 -      are:
 +      These variables control various optional help messages designed to
 +      aid new users. All 'advice.*' variables default to 'true', and you
 +      can tell Git that you do not need help by setting these to 'false':
  +
  --
        pushNonFastForward::
                Advice shown when linkgit:git-push[1] refuses
 -              non-fast-forward refs. Default: true.
 +              non-fast-forward refs.
        statusHints::
                Directions on how to stage/unstage/add shown in the
                output of linkgit:git-status[1] and the template shown
 -              when writing commit messages. Default: true.
 +              when writing commit messages.
        commitBeforeMerge::
                Advice shown when linkgit:git-merge[1] refuses to
                merge to avoid overwriting local changes.
 -              Default: true.
        resolveConflict::
                Advices shown by various commands when conflicts
                prevent the operation from being performed.
 -              Default: true.
        implicitIdentity::
                Advice on how to set your identity configuration when
                your information is guessed from the system username and
 -              domain name. Default: true.
 -
 +              domain name.
        detachedHead::
 -              Advice shown when you used linkgit::git-checkout[1] to
 +              Advice shown when you used linkgit:git-checkout[1] to
                move to the detach HEAD state, to instruct how to create
 -              a local branch after the fact.  Default: true.
 +              a local branch after the fact.
  --
  
  core.fileMode::
@@@ -471,12 -473,6 +471,12 @@@ core.editor:
        variable when it is set, and the environment variable
        `GIT_EDITOR` is not set.  See linkgit:git-var[1].
  
 +sequence.editor::
 +      Text editor used by `git rebase -i` for editing the rebase insn file.
 +      The value is meant to be interpreted by the shell when it is used.
 +      It can be overridden by the `GIT_SEQUENCE_EDITOR` environment variable.
 +      When not configured the default commit message editor is used instead.
 +
  core.pager::
        The command that git will use to paginate output.  Can
        be overridden with the `GIT_PAGER` environment
@@@ -861,13 -857,6 +861,13 @@@ fetch.recurseSubmodules:
        when its superproject retrieves a commit that updates the submodule's
        reference.
  
 +fetch.fsckObjects::
 +      If it is set to true, git-fetch-pack will check all fetched
 +      objects. It will abort in the case of a malformed object or a
 +      broken link. The result of an abort are only dangling objects.
 +      Defaults to false. If not set, the value of `transfer.fsckObjects`
 +      is used instead.
 +
  fetch.unpackLimit::
        If the number of objects fetched over the git native
        transfer is below this
@@@ -1075,23 -1064,6 +1075,23 @@@ All gitcvs variables except for 'gitcvs
  is one of "ext" and "pserver") to make them apply only for the given
  access method.
  
 +gitweb.category::
 +gitweb.description::
 +gitweb.owner::
 +gitweb.url::
 +      See linkgit:gitweb[1] for description.
 +
 +gitweb.avatar::
 +gitweb.blame::
 +gitweb.grep::
 +gitweb.highlight::
 +gitweb.patches::
 +gitweb.pickaxe::
 +gitweb.remote_heads::
 +gitweb.showsizes::
 +gitweb.snapshot::
 +      See linkgit:gitweb.conf[5] for description.
 +
  grep.lineNumber::
        If set to true, enable '-n' option by default.
  
@@@ -1624,8 -1596,7 +1624,8 @@@ receive.fsckObjects:
        If it is set to true, git-receive-pack will check all received
        objects. It will abort in the case of a malformed object or a
        broken link. The result of an abort are only dangling objects.
 -      Defaults to false.
 +      Defaults to false. If not set, the value of `transfer.fsckObjects`
 +      is used instead.
  
  receive.unpackLimit::
        If the number of objects received in a push is below this
@@@ -1740,7 -1711,8 +1740,8 @@@ rerere.enabled:
        conflict hunks can be resolved automatically, should they be
        encountered again.  By default, linkgit:git-rerere[1] is
        enabled if there is an `rr-cache` directory under the
-       `$GIT_DIR`.
+       `$GIT_DIR`, e.g. if "rerere" was previously used in the
+       repository.
  
  sendemail.identity::
        A configuration identity. When given, causes values in the
@@@ -1860,11 -1832,6 +1861,11 @@@ tar.umask:
        archiving user's umask will be used instead.  See umask(2) and
        linkgit:git-archive[1].
  
 +transfer.fsckObjects::
 +      When `fetch.fsckObjects` or `receive.fsckObjects` are
 +      not set, the value of this variable is used instead.
 +      Defaults to false.
 +
  transfer.unpackLimit::
        When `fetch.unpackLimit` or `receive.unpackLimit` are
        not set, the value of this variable is used instead.
diff --combined t/t0003-attributes.sh
index dbb2623d930e433111f7e125749f5f1071e9ab3c,19265c77cf0b1df828eea188d5f880cbb7497c63..51f3045ba4bde549b06ea669b1877f0e2db7c401
@@@ -5,16 -5,20 +5,16 @@@ test_description=gitattribute
  . ./test-lib.sh
  
  attr_check () {
 -
 -      path="$1"
 -      expect="$2"
 +      path="$1" expect="$2"
  
        git $3 check-attr test -- "$path" >actual 2>err &&
        echo "$path: test: $2" >expect &&
        test_cmp expect actual &&
        test_line_count = 0 err
 -
  }
  
  
  test_expect_success 'setup' '
 -
        mkdir -p a/b/d a/c b &&
        (
                echo "[attr]notest !test"
        (
                echo "global test=global"
        ) >"$HOME"/global-gitattributes &&
 -      cat <<EOF >expect-all
 -f: test: f
 -a/f: test: f
 -a/c/f: test: f
 -a/g: test: a/g
 -a/b/g: test: a/b/g
 -b/g: test: unspecified
 -a/b/h: test: a/b/h
 -a/b/d/g: test: a/b/d/*
 -onoff: test: unset
 -offon: test: set
 -no: notest: set
 -no: test: unspecified
 -a/b/d/no: notest: set
 -a/b/d/no: test: a/b/d/*
 -a/b/d/yes: notest: set
 -a/b/d/yes: test: unspecified
 -EOF
 -
 +      cat <<-EOF >expect-all
 +      f: test: f
 +      a/f: test: f
 +      a/c/f: test: f
 +      a/g: test: a/g
 +      a/b/g: test: a/b/g
 +      b/g: test: unspecified
 +      a/b/h: test: a/b/h
 +      a/b/d/g: test: a/b/d/*
 +      onoff: test: unset
 +      offon: test: set
 +      no: notest: set
 +      no: test: unspecified
 +      a/b/d/no: notest: set
 +      a/b/d/no: test: a/b/d/*
 +      a/b/d/yes: notest: set
 +      a/b/d/yes: test: unspecified
 +      EOF
  '
  
  test_expect_success 'command line checks' '
 -
        test_must_fail git check-attr &&
        test_must_fail git check-attr -- &&
        test_must_fail git check-attr test &&
        echo "f" | test_must_fail git check-attr --stdin -- f &&
        echo "f" | test_must_fail git check-attr --stdin test -- f &&
        test_must_fail git check-attr "" -- f
 -
  '
  
  test_expect_success 'attribute test' '
 -
        attr_check f f &&
        attr_check a/f f &&
        attr_check a/c/f f &&
@@@ -83,6 -91,7 +83,6 @@@
        attr_check no unspecified &&
        attr_check a/b/d/no "a/b/d/*" &&
        attr_check a/b/d/yes unspecified
 -
  '
  
  test_expect_success 'attribute matching is case sensitive when core.ignorecase=0' '
@@@ -142,13 -151,16 +142,13 @@@ test_expect_success CASE_INSENSITIVE_F
  '
  
  test_expect_success 'unnormalized paths' '
 -
        attr_check ./f f &&
        attr_check ./a/g a/g &&
        attr_check a/./g a/g &&
        attr_check a/c/../b/g a/b/g
 -
  '
  
  test_expect_success 'relative paths' '
 -
        (cd a && attr_check ../f f) &&
        (cd a && attr_check f f) &&
        (cd a && attr_check i a/i) &&
        (cd b && attr_check ../a/f f) &&
        (cd b && attr_check ../a/g a/g) &&
        (cd b && attr_check ../a/b/g a/b/g)
 -
  '
  
+ test_expect_success 'prefixes are not confused with leading directories' '
+       attr_check a_plus/g unspecified &&
+       cat >expect <<-\EOF &&
+       a/g: test: a/g
+       a_plus/g: test: unspecified
+       EOF
+       git check-attr test a/g a_plus/g >actual &&
+       test_cmp expect actual
+ '
  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 &&
 +      echo "global test=precedence" >>.gitattributes &&
        attr_check global precedence
  '
  
  test_expect_success 'attribute test: read paths from stdin' '
 -
 -      grep -v notest < expect-all > expect &&
 -      sed -e "s/:.*//" < expect | git check-attr --stdin test > actual &&
 +      grep -v notest <expect-all >expect &&
 +      sed -e "s/:.*//" <expect | git check-attr --stdin test >actual &&
        test_cmp expect actual
  '
  
  test_expect_success 'attribute test: --all option' '
 +      grep -v unspecified <expect-all | sort >specified-all &&
 +      sed -e "s/:.*//" <expect-all | uniq >stdin-all &&
 +      git check-attr --stdin --all <stdin-all | sort >actual &&
 +      test_cmp specified-all actual
 +'
  
 -      grep -v unspecified < expect-all | sort > expect &&
 -      sed -e "s/:.*//" < expect-all | uniq |
 -              git check-attr --stdin --all | sort > actual &&
 -      test_cmp expect actual
 +test_expect_success 'attribute test: --cached option' '
 +      : >empty &&
 +      git check-attr --cached --stdin --all <stdin-all | sort >actual &&
 +      test_cmp empty actual &&
 +      git add .gitattributes a/.gitattributes a/b/.gitattributes &&
 +      git check-attr --cached --stdin --all <stdin-all | sort >actual &&
 +      test_cmp specified-all actual
  '
  
  test_expect_success 'root subdir attribute test' '
 -
        attr_check a/i a/i &&
        attr_check subdir/a/i unspecified
 -
  '
  
  test_expect_success 'setup bare' '
 -
        git clone --bare . bare.git &&
        cd bare.git
 -
  '
  
  test_expect_success 'bare repository: check that .gitattribute is ignored' '
 -
        (
                echo "f test=f"
                echo "a/i test=a/i"
        attr_check a/c/f unspecified &&
        attr_check a/i unspecified &&
        attr_check subdir/a/i unspecified
 +'
  
 +test_expect_success 'bare repository: check that --cached honors index' '
 +      GIT_INDEX_FILE=../.git/index \
 +      git check-attr --cached --stdin --all <../stdin-all |
 +      sort >actual &&
 +      test_cmp ../specified-all actual
  '
  
  test_expect_success 'bare repository: test info/attributes' '
 -
        (
                echo "f test=f"
                echo "a/i test=a/i"
        attr_check a/c/f f &&
        attr_check a/i a/i &&
        attr_check subdir/a/i unspecified
 -
  '
  
  test_done