1. 07 5月, 2010 1 次提交
    • J
      test-lib: some shells do not let $? propagate into an eval · b6b0afdc
      Jonathan Nieder 提交于
      In 3bf78867 (test-lib: Let tests specify commands to be run at end of
      test, 2010-05-02), the git test harness learned to run cleanup
      commands unconditionally at the end of a test.  During each test,
      the intended cleanup actions are collected in the test_cleanup variable
      and evaluated.  That variable looks something like this:
      
      	eval_ret=$?; clean_something && (exit "$eval_ret")
      	eval_ret=$?; clean_something_else && (exit "$eval_ret")
      	eval_ret=$?; final_cleanup && (exit "$eval_ret")
      	eval_ret=$?
      
      All cleanup actions are run unconditionally but if one of them fails
      it is properly reported through $eval_ret.
      
      On FreeBSD, unfortunately, $? is set at the beginning of an ‘eval’
      to 0 instead of the exit status of the previous command.  This results
      in tests using test_expect_code appearing to fail and all others
      appearing to pass, unless their cleanup fails.  Avoid the problem by
      setting eval_ret before the ‘eval’ begins.
      
      Thanks to Jeff King for the explanation.
      
      Cc: Jeff King <peff@peff.net>
      Cc: Johannes Sixt <j6t@kdbg.org>
      Acked-by: NJeff King <peff@peff.net>
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b6b0afdc
  2. 05 5月, 2010 2 次提交
  3. 13 3月, 2010 3 次提交
  4. 08 3月, 2010 1 次提交
  5. 26 1月, 2010 1 次提交
  6. 04 1月, 2010 1 次提交
  7. 09 12月, 2009 1 次提交
  8. 07 12月, 2009 1 次提交
  9. 04 12月, 2009 1 次提交
  10. 25 11月, 2009 1 次提交
    • S
      Add Python support library for remote helpers · 2fe40b63
      Sverre Rabbelier 提交于
      This patch introduces parts of a Python package called
      "git_remote_helpers" containing the building blocks for
      remote helpers written in Python.
      
      No actual remote helpers are part of this patch, this patch only
      includes the common basics needed to start writing such helpers.
      
      The patch includes the necessary Makefile additions to build and
      install the git_remote_helpers Python package along with the rest of
      Git.
      
      This patch is based on Johan Herland's git_remote_cvs patch and
      has been improved by the following contributions:
      - David Aguilar: Lots of Python coding style fixes
      - David Aguilar: DESTDIR support in Makefile
      
      Cc: David Aguilar <davvid@gmail.com>
      Cc: Johan Herland <johan@herland.net>
      Signed-off-by: NSverre Rabbelier <srabbelier@gmail.com>
      Signed-off-by: NJohan Herland <johan@herland.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2fe40b63
  11. 18 11月, 2009 1 次提交
  12. 14 11月, 2009 1 次提交
    • J
      Do not use VISUAL editor on dumb terminals · d33738d7
      Jonathan Nieder 提交于
      Refuse to use $VISUAL and fall back to $EDITOR if TERM is unset
      or set to "dumb".  Traditionally, VISUAL is set to a screen
      editor and EDITOR to a line-based editor, which should be more
      useful in that situation.
      
      vim, for example, is happy to assume a terminal supports ANSI
      sequences even if TERM is dumb (e.g., when running from a text
      editor like Acme).  git already refuses to fall back to vi on a
      dumb terminal if GIT_EDITOR, core.editor, VISUAL, and EDITOR are
      unset, but without this patch, that check is suppressed by
      VISUAL=vi.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d33738d7
  13. 29 8月, 2009 1 次提交
  14. 10 8月, 2009 2 次提交
    • J
      tests: allow user to specify trash directory location · f423ef5f
      Jeff King 提交于
      The tests generate a large amount of I/O activity creating
      and destroying repositories and files. We can improve the
      time it takes to run the test suite by creating trash
      directories on filesystems with better performance
      characteristic, even though we may not want the rest of the
      git repository on those filesystems (e.g., because they are
      not network connected, or because they are temporary
      ramdisks).
      
      For example, on a dual processor system:
      
        $ cd t && time make -j32
        real    1m51.562s
        user    0m59.260s
        sys     1m20.933s
      
        # /dev/shm is tmpfs
        $ cd t && time make -j32 GIT_TEST_OPTS="--root=/dev/shm"
        real    1m1.484s
        user    0m53.555s
        sys     1m5.264s
      
      We almost halve the wall clock time, and we utilize the
      dual processors much better.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f423ef5f
    • J
      tests: provide $TRASH_DIRECTORY variable · 91c8b825
      Jeff King 提交于
      Most scripts don't care about the absolute path to the trash
      directory. The one exception was t4014 script, which pieced
      together $TEST_DIRECTORY and $test itself to get an absolute
      directory.
      
      Instead, let's provide a $TRASH_DIRECTORY which specifies
      the same thing. This keeps the $test variable internal to
      test-lib.sh and paves the way for trash directories in other
      locations.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      91c8b825
  15. 02 6月, 2009 2 次提交
  16. 22 4月, 2009 1 次提交
  17. 09 4月, 2009 1 次提交
  18. 28 3月, 2009 1 次提交
  19. 26 3月, 2009 1 次提交
    • J
      t7502-commit: Skip SIGTERM test on Windows · fb9a2bea
      Johannes Sixt 提交于
      The implementation of exec on Windows is just a rough approximation of the
      POSIX behavior. In particular, no real process "overlay" happens (a new
      process is spawned instead and the parent process waits until the child
      terminates). In particular, the process ID cannot be taken by the exec'd
      process. But there is one test in t7502-commit.sh that depends on this.
      We have to skip it on Windows.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      fb9a2bea
  20. 23 3月, 2009 3 次提交
    • J
      t3700: Skip a test with backslashes in pathspec · 6fd1106a
      Johannes Sixt 提交于
      The test verifies that glob special characters can be escaped with
      backslashes.  In particular, the string fo\[ou\]bar is given to git.
      
      On Windows, this does not work because backslashes are first of all
      directory separators, and first thing git does with a pathspec from the
      command line is to convert backslashes to forward slashes.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      6fd1106a
    • J
      ee9fb68c
    • J
      Use prerequisite tags to skip tests that depend on symbolic links · 704a3143
      Johannes Sixt 提交于
      Many tests depend on that symbolic links work.  This introduces a check
      that sets the prerequisite tag SYMLINKS if the file system supports
      symbolic links.  Since so many tests have to check for this prerequisite,
      we do the check in test-lib.sh, so that we don't need to repeat the test
      in many scripts.
      
      To check for 'ln -s' failures, you can use a FAT partition on Linux:
      
      $ mkdosfs -C git-on-fat 1000000
      $ sudo mount -o loop,uid=j6t,gid=users,shortname=winnt git-on-fat /mnt
      
      Clone git to /mnt and
      
      $ GIT_SKIP_TESTS='t0001.1[34] t0010 t1301 t403[34] t4129.[47] t5701.7
                t7701.3 t9100 t9101.26 t9119 t9124.[67] t9200.10 t9600.6' \
              make test
      
      (These additionally skipped tests depend on POSIX permissions that FAT on
      Linux does not provide.)
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      704a3143
  21. 22 3月, 2009 1 次提交
    • J
      test-lib: Infrastructure to test and check for prerequisites · a7bb3940
      Johannes Sixt 提交于
      Some tests can be run only if a particular prerequisite is available. For
      example, some tests require that an UTF-8 locale is available. Here we
      introduce functions that are used in this way:
      
      1. Insert code that checks whether the prerequisite is available. If it is,
         call test_set_prereq with an arbitrary tag name that subsequently can be
         used to check for the prerequisite:
      
            case $LANG in
            *.utf-8)
                  test_set_prereq UTF8
                  ;;
            esac
      
      2. In the calls to test_expect_success pass the tag name:
      
            test_expect_success UTF8 '...description...' '...tests...'
      
      3. There is an auxiliary predicate that can be used anywhere to test for
         a prerequisite explicitly:
      
            if test_have_prereq UTF8
            then
                  ...code to be skipped if prerequisite is not available...
            fi
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      a7bb3940
  22. 20 3月, 2009 6 次提交
    • J
      Tests on Windows: $(pwd) must return Windows-style paths · 4114156a
      Johannes Sixt 提交于
      Many tests pass $(pwd) in some form to git and later test that the output
      of git contains the correct value of $(pwd). For example, the test of
      'git remote show' sets up a remote that contains $(pwd) and then the
      expected result must contain $(pwd).
      
      Again, MSYS-bash's path mangling kicks in: Plain $(pwd) uses the MSYS style
      absolute path /c/path/to/git. The test case would write this name into
      the 'expect' file. But when git is invoked, MSYS-bash converts this name to
      the Windows style path c:/path/to/git, and git would produce this form in
      the result; the test would fail.
      
      We fix this by passing -W to bash's pwd that produces the Windows-style
      path.
      
      There are a two cases that need an accompanying change:
      
      - In t1504 the value of $(pwd) becomes part of a path list. In this case,
        the lone 'c' in something like /foo:c:/path/to/git:/bar inhibits
        MSYS-bashes path mangling; IOW in this case we want the /c/path/to/git
        form to allow path mangling. We use $PWD instead of $(pwd), which always
        has the latter form.
      
      - In t6200, $(pwd) - the Windows style path - must be used to construct the
        expected result because that is the path form that git sees. (The change
        in the test itself is just for consistency: 'git fetch' always sees the
        Windows-style path, with or without the change.)
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      4114156a
    • J
      test-lib: Work around missing sum on Windows · 5397ea31
      Johannes Sixt 提交于
      t1002-read-tree-m-u-2way.sh uses 'sum', but it does not rely on the exact
      form of the sum, only that it is a hash digest. Therefore, we can sneak
      in 'md5sum' under the name 'sum'.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      5397ea31
    • J
      test-lib: Work around incompatible sort and find on Windows · f17e9fbb
      Johannes Sixt 提交于
      If the PATH lists the Windows system directories before the MSYS
      directories, Windows's own incompatible sort and find commands would be
      picked up. We implement these commands as functions and call the real
      tools by absolute path.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      f17e9fbb
    • J
      test-lib: Introduce test_chmod and use it instead of update-index --chmod · 1f553918
      Johannes Sixt 提交于
      This function replaces sequences of 'chmod +x' and 'git update-index
      --chmod=+x' in the test suite, whose purpose is to help filesystems
      that need core.filemode=false. Two places where only 'chmod +x' was used
      we also use this new function.
      
      The function calls 'git update-index --chmod' without checking
      core.filemode (unlike some of the call sites did). We do this because the
      call sites *expect* that the executable bit ends up in the index (ie. it
      is not the purpose of the call sites to *test* whether git treats
      'chmod +x' and 'update-index --chmod=+x' correctly). Therefore, on
      filesystems with core.filemode=true the 'git update-index --chmod' is a
      no-op.
      
      The function uses --add with update-index to help one call site in
      t6031-merge-recursive. It makes no difference for the other callers.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      1f553918
    • J
      test-lib: Simplify test counting. · 8586f98b
      Johannes Sixt 提交于
      Since the test case counter was incremented very late, there were a few
      users of the counter had to do their own incrementing. Now we increment it
      early and simplify these users.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      8586f98b
    • J
      test-lib: Replace uses of $(expr ...) by POSIX shell features. · d5d9de1b
      Johannes Sixt 提交于
      In particular:
      
      - Test case counting can be achieved by arithmetic expansion.
      
      - The name of the test, e.g. t1234, can be computed with ${0%%} and ${0##}.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      d5d9de1b
  23. 17 3月, 2009 2 次提交
  24. 15 3月, 2009 1 次提交
  25. 19 2月, 2009 1 次提交
  26. 04 2月, 2009 2 次提交