1. 13 3月, 2015 5 次提交
    • J
      t5551: make EXPENSIVE test cheaper · 376e4b39
      Jeff King 提交于
      We create 50,000 tags to check that we don't overflow the
      command-line of fetch-pack. But by using run_with_cmdline_limit,
      we can get the same effect with a much smaller number of
      tags. This makes the test fast enough that we can drop the
      EXPENSIVE prereq, which means people will actually run it.
      
      It was not documented to do so, but this test was also the
      only test of a clone-over-http that requires multiple POSTs
      during the conversation. We can continue to test that by
      dropping http.postbuffer to its minimum size, and checking
      that we get two POSTs.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      376e4b39
    • J
      t5541: move run_with_cmdline_limit to test-lib.sh · 9a308de3
      Jeff King 提交于
      We use this to test http pushing with a restricted
      commandline. Other scripts (like t5551, which does http
      fetching) will want to use it, too.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9a308de3
    • J
      t: pass GIT_TRACE through Apache · 89c57ab3
      Jeff King 提交于
      Apache removes GIT_TRACE from the environment before running
      git-http-backend. This can make it hard to debug the server
      side of an http session. Let's let it through.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      89c57ab3
    • J
      t: redirect stderr GIT_TRACE to descriptor 4 · 025232e8
      Jeff King 提交于
      If you run a test script like:
      
        GIT_TRACE=1 ./t0061-run-command.sh
      
      you may get test failures, because some tests capture and
      check the stderr output from git commands (and with
      GIT_TRACE set to 1, the trace output will be included
      there).
      
      When we see GIT_TRACE set like this, we print a warning to
      the user. However, we can do even better than that by just
      pointing it to descriptor 4, which all tests leave connected
      to the test script's stderr. That's likely what the user
      intended (and any scripts that do want to see GIT_TRACE
      output will set GIT_TRACE themselves).
      
      Not only does this avoid false negatives in the tests, but
      it means the user will actually see trace output for git
      calls that redirect their stderr (whereas before, it was
      sometimes confusingly buried in a file).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      025232e8
    • J
      t: translate SIGINT to an exit · da706545
      Jeff King 提交于
      Right now if a test script receives SIGINT (e.g., because a
      test was hanging and the user hit ^C), the shell exits
      immediately. This can be annoying if the test script did any
      global setup, like starting apache or git-daemon, as it will
      not have an opportunity to clean up after itself. A
      subsequent run of the test won't be able to start its own
      daemon, and will either fail or skip the tests.
      
      Instead, let's trap SIGINT to make sure we do a clean
      shutdown, and just chain it to a normal exit (which will
      trigger any cleanup).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      da706545
  2. 07 3月, 2015 6 次提交
  3. 06 3月, 2015 23 次提交
  4. 27 2月, 2015 2 次提交
    • K
      Git::SVN::*: avoid premature FileHandle closure · e426311b
      Kyle J. McKay 提交于
      Since b19138b (git-svn: Make it incrementally faster by minimizing temp
      files, v1.6.0), git-svn has been using the Git.pm temp_acquire and
      temp_release mechanism to avoid unnecessary temp file churn and provide
      a speed boost.
      
      However, that change introduced a call to temp_acquire inside the
      Git::SVN::Fetcher::close_file function for an 'svn_hash' temp file.
      Because an SVN::Pool is active at the time this function is called, if
      the Git::temp_acquire function ends up actually creating a new
      FileHandle for the temp file (which it will the first time it's called
      with the name 'svn_hash') that FileHandle will end up in the SVN::Pool
      and should that pool have SVN::Pool::clear called on it that FileHandle
      will be closed out from under Git::temp_acquire.
      
      Since the only call site to Git::temp_acquire with the name 'svn_hash'
      is inside the close_file function, if an 'svn_hash' temp file is ever
      created its FileHandle is guaranteed to be created in the active
      SVN::Pool.
      
      This has not been a problem in the past because the SVN::Pool was not
      being cleared.  However, since dfa72fdb (git-svn: reload RA every
      log-window-size, v2.2.0) the pool has been getting cleared periodically
      at which point the FileHandle for the 'svn_hash' temp file gets closed.
      Any subsequent calls to Git::temp_acquire for 'svn_hash', however,
      succeed without creating/opening a new temporary file since it still has
      the now invalid FileHandle in its cache.  Callers that then attempt to
      use that FileHandle fail with an error.
      
      We avoid this problem by making sure the 'svn_hash' temp file is created
      in the same place the 'svn_delta_...' and 'git_blob_...' temp files are
      (and then temp_release'd) so that it can be safely used inside the
      close_file function without having its FileHandle end up in an SVN::Pool
      that gets cleared.
      
      Additionally the Git.pm cat_blob function creates a bidirectional pipe
      FileHandle using the IPC::Open2::open2 function.  If that handle is
      created too late, it also gets caught up in the SVN::Pool and incorrectly
      closed by the SVN::Pool::clear call.  But this only seems to happen with
      more recent versions of Perl and svn.
      
      To avoid this problem we add an explicit call to _open_cat_blob_if_needed
      before the first call to SVN::Pool->new_default to make sure the open2
      handle does not end up in the SVN::Pool.
      Signed-off-by: NKyle J. McKay <mackyle@gmail.com>
      Signed-off-by: NEric Wong <normalperson@yhbt.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e426311b
    • R
      git-svn: fix localtime=true on non-glibc environments · 45c956b3
      Ryuichi Kokubo 提交于
      git svn uses POSIX::strftime('%s', $sec, $min, ...) to make unix epoch time.
      But lowercase %s formatting character is a GNU extention. This causes problem
      in git svn fetch --localtime on non-glibc systems, such as msys or cygwin.
      Using Time::Local::timelocal($sec, $min, ...) fixes it.
      Signed-off-by: NRyuichi Kokubo <ryu1kkb@gmail.com>
      Signed-off-by: NEric Wong <normalperson@yhbt.net>
      
      Notes:
          lowercase %s format character in strftime is a GNU extension and not widely supported.
          POSIX::strftime affected by underlying crt's strftime because POSIX::strftime just calls crt's one.
          Time::Local is good function to replace POSIX::strftime because it's a perl core module function.
      
          Document about Time::Local.
           http://perldoc.perl.org/Time/Local.html
      
          These are specifications of strftime.
      
          The GNU C Library Reference Manual.
           http://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
      
          perl POSIX module's strftime document. It does not have '%s'.
           http://perldoc.perl.org/POSIX.html
      
          strftime document of Microsort Windows C Run-Time library.
           https://msdn.microsoft.com/en-us/library/fe06s4ak.aspx
      
          The Open Group's old specification does not have '%s' too.
           http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html
      
          On my environment, following problems happened.
          - msys   : git svn fetch does not progress at all with perl.exe consuming CPU.
          - cygwin : git svn fetch progresses but time stamp information is dropped.
             Every commits have unix epoch timestamp.
      
          I would like to thank git developer and contibutors.
          git helps me so much everyday.
          Thank you.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      45c956b3
  5. 25 2月, 2015 4 次提交
    • J
      Git 2.3.1 · 8004647a
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8004647a
    • J
      Merge branch 'ak/add-i-empty-candidates' into maint · 7bc4c01d
      Junio C Hamano 提交于
      The interactive "show a list and let the user choose from it"
      interface "add -i" used showed and prompted to the user even when
      the candidate list was empty, against which the only "choice" the
      user could have made was to choose nothing.
      
      * ak/add-i-empty-candidates:
        add -i: return from list_and_choose if there is no candidate
      7bc4c01d
    • J
      Merge branch 'jc/apply-ws-fix-expands' into maint · 2764442a
      Junio C Hamano 提交于
      "git apply --whitespace=fix" used to under-allocate the memory
      when the fix resulted in a longer text than the original patch.
      
      * jc/apply-ws-fix-expands:
        apply: count the size of postimage correctly
        apply: make update_pre_post_images() sanity check the given postlen
        apply.c: typofix
      2764442a
    • J
      Merge branch 'jc/doc-log-rev-list-options' into maint · 254a3ebf
      Junio C Hamano 提交于
      "git log --help" used to show rev-list options that are irrelevant
      to the "log" command.
      
      * jc/doc-log-rev-list-options:
        Documentation: what does "git log --indexed-objects" even mean?
      254a3ebf