Merge branch 'jn/scripts-updates'
authorJunio C Hamano <gitster@pobox.com>
Thu, 12 Dec 2013 22:22:59 +0000 (14:22 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 12 Dec 2013 22:22:59 +0000 (14:22 -0800)
* jn/scripts-updates:
remove #!interpreter line from shell libraries
test: replace shebangs with descriptions in shell libraries
test: make FILEMODE a lazy prereq
contrib: remove git-p4import
mark contributed hooks executable
mark perl test scripts executable
mark Windows build scripts executable

1  2 
contrib/completion/git-completion.bash
t/lib-read-tree.sh
t/test-lib.sh
index 874611db56b6431a5aa5c55f34a22007eec7ebdf,be6193162737bec2fc5eac840f75956dae9e00e5..51c2dd4dec3b65dc6ab8f051580fc03ce3027d5b
@@@ -1,5 -1,3 +1,3 @@@
- #!bash
- #
  # bash/zsh completion support for core Git.
  #
  # Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
@@@ -673,6 -671,7 +671,6 @@@ __git_list_porcelain_commands (
                index-pack)       : plumbing;;
                init-db)          : deprecated;;
                local-fetch)      : plumbing;;
 -              lost-found)       : infrequent;;
                ls-files)         : plumbing;;
                ls-remote)        : plumbing;;
                ls-tree)          : plumbing;;
                pack-refs)        : plumbing;;
                parse-remote)     : plumbing;;
                patch-id)         : plumbing;;
 -              peek-remote)      : plumbing;;
                prune)            : plumbing;;
                prune-packed)     : plumbing;;
                quiltimport)      : import;;
                read-tree)        : plumbing;;
                receive-pack)     : plumbing;;
                remote-*)         : transport;;
 -              repo-config)      : deprecated;;
                rerere)           : plumbing;;
                rev-list)         : plumbing;;
                rev-parse)        : plumbing;;
                ssh-*)            : transport;;
                stripspace)       : plumbing;;
                symbolic-ref)     : plumbing;;
 -              tar-tree)         : deprecated;;
                unpack-file)      : plumbing;;
                unpack-objects)   : plumbing;;
                update-index)     : plumbing;;
diff --combined t/lib-read-tree.sh
index ef079afc4638a4f02fa0c12f1d54ad622047ed56,6442ae337590956bdde988ff51f596909ba8159a..b95f4856061da723cbe36bd6955c552bee7a29aa
@@@ -1,43 -1,41 +1,41 @@@
- #!/bin/sh
- #
  # Helper functions to check if read-tree would succeed/fail as expected with
  # and without the dry-run option. They also test that the dry-run does not
  # write the index and that together with -u it doesn't touch the work tree.
  #
  read_tree_must_succeed () {
 -    git ls-files -s >pre-dry-run &&
 -    git read-tree -n "$@" &&
 -    git ls-files -s >post-dry-run &&
 -    test_cmp pre-dry-run post-dry-run &&
 -    git read-tree "$@"
 +      git ls-files -s >pre-dry-run &&
 +      git read-tree -n "$@" &&
 +      git ls-files -s >post-dry-run &&
 +      test_cmp pre-dry-run post-dry-run &&
 +      git read-tree "$@"
  }
  
  read_tree_must_fail () {
 -    git ls-files -s >pre-dry-run &&
 -    test_must_fail git read-tree -n "$@" &&
 -    git ls-files -s >post-dry-run &&
 -    test_cmp pre-dry-run post-dry-run &&
 -    test_must_fail git read-tree "$@"
 +      git ls-files -s >pre-dry-run &&
 +      test_must_fail git read-tree -n "$@" &&
 +      git ls-files -s >post-dry-run &&
 +      test_cmp pre-dry-run post-dry-run &&
 +      test_must_fail git read-tree "$@"
  }
  
  read_tree_u_must_succeed () {
 -    git ls-files -s >pre-dry-run &&
 -    git diff-files -p >pre-dry-run-wt &&
 -    git read-tree -n "$@" &&
 -    git ls-files -s >post-dry-run &&
 -    git diff-files -p >post-dry-run-wt &&
 -    test_cmp pre-dry-run post-dry-run &&
 -    test_cmp pre-dry-run-wt post-dry-run-wt &&
 -    git read-tree "$@"
 +      git ls-files -s >pre-dry-run &&
 +      git diff-files -p >pre-dry-run-wt &&
 +      git read-tree -n "$@" &&
 +      git ls-files -s >post-dry-run &&
 +      git diff-files -p >post-dry-run-wt &&
 +      test_cmp pre-dry-run post-dry-run &&
 +      test_cmp pre-dry-run-wt post-dry-run-wt &&
 +      git read-tree "$@"
  }
  
  read_tree_u_must_fail () {
 -    git ls-files -s >pre-dry-run &&
 -    git diff-files -p >pre-dry-run-wt &&
 -    test_must_fail git read-tree -n "$@" &&
 -    git ls-files -s >post-dry-run &&
 -    git diff-files -p >post-dry-run-wt &&
 -    test_cmp pre-dry-run post-dry-run &&
 -    test_cmp pre-dry-run-wt post-dry-run-wt &&
 -    test_must_fail git read-tree "$@"
 +      git ls-files -s >pre-dry-run &&
 +      git diff-files -p >pre-dry-run-wt &&
 +      test_must_fail git read-tree -n "$@" &&
 +      git ls-files -s >post-dry-run &&
 +      git diff-files -p >post-dry-run-wt &&
 +      test_cmp pre-dry-run post-dry-run &&
 +      test_cmp pre-dry-run-wt post-dry-run-wt &&
 +      test_must_fail git read-tree "$@"
  }
diff --combined t/test-lib.sh
index d303e6c943ab94e15e65fb8a51cbe871cf9ef544,c3e07b9e162d6ec6984e07d1ea8061c14658642a..1cf78d5b113e0ddac8cdda9b8bc9b49db7b43451
@@@ -1,4 -1,4 +1,4 @@@
- #!/bin/sh
+ # Test framework for git.  See t/README for usage.
  #
  # Copyright (c) 2005 Junio C Hamano
  #
@@@ -26,10 -26,6 +26,10 @@@ the
        # outside of t/, e.g. for running tests on the test library
        # itself.
        TEST_DIRECTORY=$(pwd)
 +else
 +      # ensure that TEST_DIRECTORY is an absolute path so that it
 +      # is valid even if the current working directory is changed
 +      TEST_DIRECTORY=$(cd "$TEST_DIRECTORY" && pwd) || exit 1
  fi
  if test -z "$TEST_OUTPUT_DIRECTORY"
  then
@@@ -577,11 -573,9 +577,9 @@@ the
  
        make_valgrind_symlink () {
                # handle only executables, unless they are shell libraries that
-               # need to be in the exec-path.  We will just use "#!" as a
-               # guess for a shell-script, since we have no idea what the user
-               # may have configured as the shell path.
+               # need to be in the exec-path.
                test -x "$1" ||
-               test "#!" = "$(head -c 2 <"$1")" ||
+               test "# " = "$(head -c 2 <"$1")" ||
                return;
  
                base=$(basename "$1")
@@@ -834,6 -828,10 +832,10 @@@ test_lazy_prereq SYMLINKS 
        ln -s x y && test -h y
  '
  
+ test_lazy_prereq FILEMODE '
+       test "$(git config --bool core.filemode)" = true
+ '
  test_lazy_prereq CASE_INSENSITIVE_FS '
        echo good >CamelCase &&
        echo bad >camelcase &&