1. 13 9月, 2011 1 次提交
    • J
      fetch: avoid quadratic loop checking for updated submodules · 6859de45
      Jeff King 提交于
      Recent versions of git can be slow to fetch repositories with a
      large number of refs (or when they already have a large
      number of refs). For example, GitHub makes pull-requests
      available as refs, which can lead to a large number of
      available refs. This slowness goes away when submodule
      recursion is turned off:
      
        $ git ls-remote git://github.com/rails/rails.git | wc -l
        3034
      
        [this takes ~10 seconds of CPU time to complete]
        git fetch --recurse-submodules=no \
          git://github.com/rails/rails.git "refs/*:refs/*"
      
        [this still isn't done after 10 _minutes_ of pegging the CPU]
        git fetch \
          git://github.com/rails/rails.git "refs/*:refs/*"
      
      You can produce a quicker and simpler test case like this:
      
        doit() {
          head=`git rev-parse HEAD`
          for i in `seq 1 $1`; do
            echo $head refs/heads/ref$i
          done >.git/packed-refs
          echo "==> $1"
          rm -rf dest
          git init -q --bare dest &&
            (cd dest && time git.compile fetch -q .. refs/*:refs/*)
        }
      
        rm -rf repo
        git init -q repo && cd repo &&
        >file && git add file && git commit -q -m one
      
        doit 100
        doit 200
        doit 400
        doit 800
        doit 1600
        doit 3200
      
      Which yields timings like:
      
        # refs  seconds of CPU
           100            0.06
           200            0.24
           400            0.95
           800            3.39
          1600           13.66
          3200           54.09
      
      Notice that although the number of refs doubles in each
      trial, the CPU time spent quadruples.
      
      The problem is that the submodule recursion code works
      something like:
      
        - for each ref we fetch
          - for each commit in git rev-list $new_sha1 --not --all
            - add modified submodules to list
        - fetch any newly referenced submodules
      
      But that means if we fetch N refs, we start N revision
      walks. Worse, because we use "--all", the number of refs we
      must process that constitute "--all" keeps growing, too. And
      you end up doing O(N^2) ref resolutions.
      
      Instead, this patch structures the code like this:
      
        - for each sha1 we already have
          - add $old_sha1 to list $old
        - for each ref we fetch
          - add $new_sha1 to list $new
        - for each commit in git rev-list $new --not $old
          - add modified submodules to list
        - fetch any newly referenced submodules
      
      This yields timings like:
      
        # refs  seconds of CPU
        100               0.00
        200               0.04
        400               0.04
        800               0.10
        1600              0.21
        3200              0.39
      
      Note that the amount of effort doubles as the number of refs
      doubles. Similarly, the fetch of rails.git takes about as
      much time as it does with --recurse-submodules=no.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6859de45
  2. 27 6月, 2011 2 次提交
  3. 25 6月, 2011 2 次提交
  4. 23 6月, 2011 3 次提交
  5. 22 6月, 2011 2 次提交
  6. 21 6月, 2011 3 次提交
  7. 20 6月, 2011 3 次提交
  8. 18 6月, 2011 4 次提交
    • J
      tests: link shell libraries into valgrind directory · 36bfb0e5
      Jeff King 提交于
      When we run tests under valgrind, we symlink anything
      executable that starts with git-* or test-* into a special
      valgrind bin directory, and then make that our
      GIT_EXEC_PATH.
      
      However, shell libraries like git-sh-setup do not have the
      executable bit marked, and did not get symlinked.  This
      means that any test looking for shell libraries in our
      exec-path would fail to find them, even though that is a
      fine thing to do when testing against a regular git build
      (or in a git install, for that matter).
      
      t2300 demonstrated this problem. The fix is to symlink these
      shell libraries directly into the valgrind directory.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      36bfb0e5
    • J
      t/Makefile: pass test opts to valgrind target properly · 7ef4d6b9
      Jeff King 提交于
      The valgrind target just reinvokes make with GIT_TEST_OPTS
      set to "--valgrind". However, it does this using an
      environment variable, which means GIT_TEST_OPTS in your
      config.mak would override it, and "make valgrind" would
      simply run the test suite without valgrind on.
      
      Instead, we should pass GIT_TEST_OPTS on the command-line,
      overriding what's in config.mak, and take care to append to
      whatever the user has there already.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7ef4d6b9
    • J
      Merge branch 'ab/i18n-scripts-basic' · 179aae51
      Junio C Hamano 提交于
      * ab/i18n-scripts-basic:
        sh-i18n--envsubst.c: do not #include getopt.h
      179aae51
    • B
      sh-i18n--envsubst.c: do not #include getopt.h · 7c1fdd70
      Brandon Casey 提交于
      The getopt.h header file is not used.  It's inclusion is left over from the
      original version of this source.  Additionally, getopt.h does not exist on
      all platforms (SunOS 5.7) and will cause a compilation failure.  So, let's
      remove it.
      Signed-off-by: NBrandon Casey <casey@nrlssc.navy.mil>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7c1fdd70
  9. 17 6月, 2011 2 次提交
  10. 10 6月, 2011 1 次提交
    • J
      gitweb: do not misparse nonnumeric content tag files that contain a digit · 2c162b56
      Jonathan Nieder 提交于
      v1.7.6-rc0~27^2~4 (gitweb: Change the way "content tags" ('ctags') are
      handled, 2011-04-29) tried to make gitweb's tag cloud feature more
      intuitive for webmasters by checking whether the ctags/<label> under
      a project's .git dir contains a number (representing the strength of
      association to <label>) before treating it as one.
      
      With that change, after putting '$feature{'ctags'}{'default'} = [1];'
      in your $GITWEB_CONFIG, you could do
      
      	echo Linux >.git/ctags/linux
      
      and gitweb would treat that as a request to tag the current repository
      with the Linux tag, instead of the previous behavior of writing an
      error page embedded in the projects list that triggers error messages
      from Chromium and Firefox about malformed XML.
      
      Unfortunately the pattern (\d+) used to match numbers is too loose,
      and the "XML declaration allowed only at the start of the document"
      error can still be experienced if you write "Linux-2.6" in place of
      "Linux" in the example above.  Fix it by tightening the pattern to
      ^\d+$.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2c162b56
  11. 09 6月, 2011 3 次提交
  12. 07 6月, 2011 6 次提交
  13. 06 6月, 2011 1 次提交
  14. 04 6月, 2011 1 次提交
  15. 03 6月, 2011 2 次提交
  16. 02 6月, 2011 4 次提交