1. 04 6月, 2012 3 次提交
  2. 01 6月, 2012 1 次提交
  3. 08 5月, 2012 1 次提交
    • N
      index-pack: support multithreaded delta resolving · b8a2486f
      Nguyễn Thái Ngọc Duy 提交于
      This puts delta resolving on each base on a separate thread, one base
      cache per thread. Per-thread data is grouped in struct thread_local.
      When running with nr_threads == 1, no pthreads calls are made. The
      system essentially runs in non-thread mode.
      
      An experiment on a Xeon 24 core machine with git.git shows that
      performance does not increase proportional to the number of cores. So
      by default, we use maximum 3 cores. Some numbers with --threads from 1
      to 16:
      
      1..4
      real    0m8.003s  0m5.307s  0m4.321s  0m3.830s
      user    0m7.720s  0m8.009s  0m8.133s  0m8.305s
      sys     0m0.224s  0m0.372s  0m0.360s  0m0.360s
      
      5..8
      real    0m3.727s  0m3.604s  0m3.332s  0m3.369s
      user    0m9.361s  0m9.817s  0m9.525s  0m9.769s
      sys     0m0.584s  0m0.624s  0m0.540s  0m0.560s
      
      9..12
      real    0m3.036s  0m3.139s  0m3.177s  0m2.961s
      user    0m8.977s  0m10.205s 0m9.737s  0m10.073s
      sys     0m0.596s  0m0.680s  0m0.684s  0m0.680s
      
      13..16
      real    0m2.985s  0m2.894s  0m2.975s  0m2.971s
      user    0m9.825s  0m10.573s 0m10.833s 0m11.361s
      sys     0m0.788s  0m0.732s  0m0.904s  0m1.016s
      
      On an Intel dual core and linux-2.6.git
      
      1..4
      real    2m37.789s 2m7.963s  2m0.920s  1m58.213s
      user    2m28.415s 2m52.325s 2m50.176s 2m41.187s
      sys     0m7.808s  0m11.181s 0m11.224s 0m10.731s
      
      Thanks Ramsay Jones for troubleshooting and support on MinGW platform.
      Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b8a2486f
  4. 05 5月, 2012 2 次提交
  5. 28 4月, 2012 4 次提交
  6. 25 4月, 2012 1 次提交
  7. 24 4月, 2012 1 次提交
  8. 11 4月, 2012 2 次提交
  9. 10 4月, 2012 2 次提交
    • T
      xdiff: load full words in the inner loop of xdl_hash_record · 6942efcf
      Thomas Rast 提交于
      Redo the hashing loop in xdl_hash_record in a way that loads an entire
      'long' at a time, using masking tricks to see when and where we found
      the terminating '\n'.
      
      I stole inspiration and code from the posts by Linus Torvalds around
      
        https://lkml.org/lkml/2012/3/2/452
        https://lkml.org/lkml/2012/3/5/6
      
      His method reads the buffers in sizeof(long) increments, and may thus
      overrun it by at most sizeof(long)-1 bytes before it sees the final
      newline (or hits the buffer length check).  I considered padding out
      all buffers by a suitable amount to "catch" the overrun, but
      
      * this does not work for mmap()'d buffers: if you map 4096+8 bytes
        from a 4096 byte file, accessing the last 8 bytes results in a
        SIGBUS on my machine; and
      
      * it would also be extremely ugly because it intrudes deep into the
        unpacking machinery.
      
      So I adapted it to not read beyond the buffer at all.  Instead, it
      reads the final partial word byte-by-byte and strings it together.
      Then it can use the same logic as before to finish the hashing.
      
      So far we enable this only on x86_64, where it provides nice speedup
      for diff-related work:
      
        Test                                  origin/next      tr/xdiff-fast-hash
        -----------------------------------------------------------------------------
        4000.1: log -3000 (baseline)          0.07(0.05+0.02)  0.08(0.06+0.02) +14.3%
        4000.2: log --raw -3000 (tree-only)   0.37(0.33+0.04)  0.37(0.32+0.04) +0.0%
        4000.3: log -p -3000 (Myers)          1.75(1.65+0.09)  1.60(1.49+0.10) -8.6%
        4000.4: log -p -3000 --histogram      1.73(1.62+0.09)  1.58(1.49+0.08) -8.7%
        4000.5: log -p -3000 --patience       2.11(2.00+0.10)  1.94(1.80+0.11) -8.1%
      
      Perhaps other platforms could also benefit.  However it does NOT work
      on big-endian systems!
      
      [jc: minimum style and compilation fixes]
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6942efcf
    • P
      git-p4: move to toplevel · b6f93057
      Pete Wyckoff 提交于
      Move git-p4 out of contrib/fast-import into the main code base,
      aside other foreign SCM tools.
      Signed-off-by: NPete Wyckoff <pw@padd.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b6f93057
  10. 04 4月, 2012 2 次提交
    • B
      Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd · b3e34ddd
      Ben Walton 提交于
      During the testing of the 1.7.10 rc series on Solaris for OpenCSW, it
      was discovered that t7006-pager was failing due to finding a bad "sh"
      in PATH after a call to execvp("sh", ...).  This call was setup by
      run_command.c:prepare_shell_cmd.
      
      The PATH in use at the time saw /opt/csw/bin given precedence to
      traditional Solaris paths such as /usr/bin and /usr/xpg4/bin.  A
      package named schilyutils (Joerg Schilling's utilities) was installed
      on the build system and it delivered a modified version of the
      traditional Solaris /usr/bin/sh as /opt/csw/bin/sh.  This version of
      sh suffers from many of the same problems as /usr/bin/sh.
      
      The command-specific pager test failed due to the broken "sh" handling
      ^ as a pipe character.  It tried to fork two processes when it
      encountered "sed s/^/foo:/" as the pager command.  This problem was
      entirely dependent on the PATH of the user at runtime.
      
      Possible fixes for this issue are:
      
      1. Use the standard system() or popen() which both launch a POSIX
         shell on Solaris as long as _POSIX_SOURCE is defined.
      
      2. The git wrapper could prepend SANE_TOOL_PATH to PATH thus forcing
         all unqualified commands run to use the known good tools on the
         system.
      
      3. The run_command.c:prepare_shell_command() could use the same
         SHELL_PATH that is in the #! line of all all scripts and not rely
         on PATH to find the sh to run.
      
      Option 1 would preclude opening a bidirectional pipe to a filter
      script and would also break git for Windows as cmd.exe is spawned from
      system() (cf. v1.7.5-rc0~144^2, "alias: use run_command api to execute
      aliases, 2011-01-07).
      
      Option 2 is not friendly to users as it would negate their ability to
      use tools of their choice in many cases.  Alternately, injecting
      SANE_TOOL_PATH such that it takes precedence over /bin and /usr/bin
      (and anything with lower precedence than those paths) as
      git-sh-setup.sh does would not solve the problem either as the user
      environment could still allow a bad sh to be found.  (Many OpenCSW
      users will have /opt/csw/bin leading their PATH and some subset would
      have schilyutils installed.)
      
      Option 3 allows us to use a known good shell while still honouring the
      users' PATH for the utilities being run.  Thus, it solves the problem
      while not negatively impacting either users or git's ability to run
      external commands in convenient ways.  Essentially, the shell is a
      special case of tool that should not rely on SANE_TOOL_PATH and must
      be called explicitly.
      
      With this patch applied, any code path leading to
      run_command.c:prepare_shell_cmd can count on using the same sane shell
      that all shell scripts in the git suite use.  Both the build system
      and run_command.c will default this shell to /bin/sh unless
      overridden.
      Signed-off-by: NBen Walton <bwalton@artsci.utoronto.ca>
      Reviewed-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b3e34ddd
    • J
      d2c18985
  11. 30 3月, 2012 1 次提交
  12. 27 2月, 2012 1 次提交
  13. 18 2月, 2012 1 次提交
    • T
      Introduce a performance testing framework · 342e9ef2
      Thomas Rast 提交于
      This introduces a performance testing framework under t/perf/.  It
      tries to be as close to the test-lib.sh infrastructure as possible,
      and thus should be easy to get used to for git developers.
      
      The following points were considered for the implementation:
      
      1. You usually want to compare arbitrary revisions/build trees against
         each other.  They may not have the performance test under
         consideration, or even the perf-lib.sh infrastructure.
      
         To cope with this, the 'run' script lets you specify arbitrary
         build dirs and revisions.  It even automatically builds the revisions
         if it doesn't have them at hand yet.
      
      2. Usually you would not want to run all tests.  It would take too
         long anyway.  The 'run' script lets you specify which tests to run;
         or you can also do it manually.  There is a Makefile for
         discoverability and 'make clean', but it is not meant for
         real-world use.
      
      3. Creating test repos from scratch in every test is extremely
         time-consuming, and shipping or downloading such large/weird repos
         is out of the question.
      
         We leave this decision to the user.  Two different sizes of test
         repos can be configured, and the scripts just copy one or more of
         those (using hardlinks for the object store).  By default it tries
         to use the build tree's git.git repository.
      
         This is fairly fast and versatile.  Using a copy instead of a clone
         preserves many properties that the user may want to test for, such
         as lots of loose objects, unpacked refs, etc.
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      342e9ef2
  14. 15 2月, 2012 1 次提交
  15. 13 2月, 2012 2 次提交
    • Æ
      Makefile: Change the default compiler from "gcc" to "cc" · 6d62c983
      Ævar Arnfjörð Bjarmason 提交于
      Ever since the very first commit to git.git we've been setting CC to
      "gcc". Presumably this is behavior that Linus copied from the Linux
      Makefile.
      
      However unlike Linux Git is written in ANSI C and supports a multitude
      of compilers, including Clang, Sun Studio, xlc etc. On my Linux box
      "cc" is a symlink to clang, and on a Solaris box I have access to "cc"
      is Sun Studio's CC.
      
      Both of these are perfectly capable of compiling Git, and it's
      annoying to have to specify CC=cc on the command-line when compiling
      Git when that's the default behavior of most other portable programs.
      
      So change the default to "cc". Users who want to compile with GCC can
      still add "CC=gcc" to the make(1) command-line, but those users who
      don't have GCC as their "cc" will see expected behavior, and as a
      bonus we'll be more likely to smoke out new compilation warnings from
      our distributors since they'll me using a more varied set of compilers
      by default.
      Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6d62c983
    • Д
      Makefile: introduce CHARSET_LIB to link with -lcharset · b5225286
      Дилян Палаузов 提交于
      On some systems, the function locale_charset() may not be exported from
      libiconv but is available from libcharset, and we need -lcharset when
      linking.
      
      Introduce a make variable CHARSET_LIB that can be set to -lcharsetlib
      on such systems.  Also autodetect this in the configure script by first
      looking for the symbol in libiconv, and then libcharset.
      Signed-off-by: NДилян Палаузов <dilyan.palauzov@aegee.org>
      b5225286
  16. 10 2月, 2012 2 次提交
  17. 06 2月, 2012 1 次提交
    • T
      Fix build problems related to profile-directed optimization · f2d713fc
      Theodore Ts'o 提交于
      There was a number of problems I ran into when trying the
      profile-directed optimizations added by Andi Kleen in git commit
      7ddc2710.  (This was using gcc 4.4 found on many enterprise
      distros.)
      
      1) The -fprofile-generate and -fprofile-use commands are incompatible
      with ccache; the code ends up looking in the wrong place for the gcda
      files based on the ccache object names.
      
      2) If the makefile notices that CFLAGS are different, it will rebuild
      all of the binaries.  Hence the recipe originally specified by the
      INSTALL file ("make profile-all" followed by "make install") doesn't
      work.  It will appear to work, but the binaries will end up getting
      built with no optimization.
      
      This patch fixes this by using an explicit set of options passed via
      the PROFILE variable then using this to directly manipulate CFLAGS and
      EXTLIBS.
      
      The developer can run "make PROFILE=BUILD all ; sudo make
      PROFILE=BUILD install" automatically run a two-pass build with the
      test suite run in between as the sample workload for the purpose of
      recording profiling information to do the profile-directed
      optimization.
      
      Alternatively, the profiling version of binaries can be built using:
      
      	make PROFILE=GEN PROFILE_DIR=/var/cache/profile all
      	make PROFILE=GEN install
      
      and then after git has been used for a while, the optimized version of
      the binary can be built as follows:
      
      	make PROFILE=USE PROFILE_DIR=/var/cache/profile all
      	make PROFILE=USE install
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: Andi Kleen <ak@linux.intel.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f2d713fc
  18. 28 1月, 2012 1 次提交
  19. 24 1月, 2012 2 次提交
  20. 13 12月, 2011 6 次提交
    • J
      Makefile: OS X has /dev/tty · 3f3a9701
      Jeff King 提交于
      We can use our enhanced getpass(). Tested by me.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3f3a9701
    • J
      Makefile: linux has /dev/tty · 9b4b8946
      Jeff King 提交于
      Therefore we can turn on our custom prompt function instead
      of relying on getpass.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9b4b8946
    • J
      credentials: add "store" helper · 71e1b4b6
      Jeff King 提交于
      This is like "cache", except that we actually put the
      credentials on disk. This can be terribly insecure, of
      course, but we do what we can to protect them by filesystem
      permissions, and we warn the user in the documentation.
      
      This is not unlike using .netrc to store entries, but it's a
      little more user-friendly. Instead of putting credentials in
      place ahead of time, we transparently store them after
      prompting the user for them once.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      71e1b4b6
    • J
      add generic terminal prompt function · 21aeafce
      Jeff King 提交于
      When we need to prompt the user for input interactively, we
      want to access their terminal directly. We can't rely on
      stdio because it may be connected to pipes or files, rather
      than the terminal. Instead, we use "getpass()", because it
      abstracts the idea of prompting and reading from the
      terminal.  However, it has some problems:
      
        1. It never echoes the typed characters, which makes it OK
           for passwords but annoying for other input (like usernames).
      
        2. Some implementations of getpass() have an extremely
           small input buffer (e.g., Solaris 8 is reported to
           support only 8 characters).
      
        3. Some implementations of getpass() will fall back to
           reading from stdin (e.g., glibc). We explicitly don't
           want this, because our stdin may be connected to a pipe
           speaking a particular protocol, and reading will
           disrupt the protocol flow (e.g., the remote-curl
           helper).
      
        4. Some implementations of getpass() turn off signals, so
           that hitting "^C" on the terminal does not break out of
           the password prompt. This can be a mild annoyance.
      
      Instead, let's provide an abstract "git_terminal_prompt"
      function that addresses these concerns. This patch includes
      an implementation based on /dev/tty, enabled by setting
      HAVE_DEV_TTY. The fallback is to use getpass() as before.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      21aeafce
    • J
      move git_getpass to its own source file · d3c58b83
      Jeff King 提交于
      This is currently in connect.c, but really has nothing to
      do with the git protocol itself. Let's make a new source
      file all about prompting the user, which will make it
      cleaner to refactor.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d3c58b83
    • J
      Makefile: unix sockets may not available on some platforms · 6320358e
      Johannes Sixt 提交于
      Introduce a configuration option NO_UNIX_SOCKETS to exclude code that
      depends on Unix sockets and use it in MSVC and MinGW builds.
      
      Notice that unix-socket.h was missing from LIB_H before; fix that, too.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Helped-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6320358e
  21. 12 12月, 2011 2 次提交
    • J
      credentials: add "cache" helper · e2770979
      Jeff King 提交于
      If you access repositories over smart-http using http
      authentication, then it can be annoying to have git ask you
      for your password repeatedly. We cache credentials in
      memory, of course, but git is composed of many small
      programs. Having to input your password for each one can be
      frustrating.
      
      This patch introduces a credential helper that will cache
      passwords in memory for a short period of time.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e2770979
    • J
      introduce credentials API · abca927d
      Jeff King 提交于
      There are a few places in git that need to get a username
      and password credential from the user; the most notable one
      is HTTP authentication for smart-http pushing.
      
      Right now the only choices for providing credentials are to
      put them plaintext into your ~/.netrc, or to have git prompt
      you (either on the terminal or via an askpass program). The
      former is not very secure, and the latter is not very
      convenient.
      
      Unfortunately, there is no "always best" solution for
      password management. The details will depend on the tradeoff
      you want between security and convenience, as well as how
      git can integrate with other security systems (e.g., many
      operating systems provide a keychain or password wallet for
      single sign-on).
      
      This patch provides an abstract notion of credentials as a
      data item, and provides three basic operations:
      
        - fill (i.e., acquire from external storage or from the
          user)
      
        - approve (mark a credential as "working" for further
          storage)
      
        - reject (mark a credential as "not working", so it can
          be removed from storage)
      
      These operations can be backed by external helper processes
      that interact with system- or user-specific secure storage.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      abca927d
  22. 07 12月, 2011 1 次提交