1. 09 4月, 2009 1 次提交
    • J
      Makefile: allow building without perl · 499c2939
      Jeff King 提交于
      For systems with a missing or broken perl, it is nicer to
      explicitly say "we don't want perl" because:
      
        1. The Makefile knows not to bother with Perl-ish things
           like Git.pm.
      
        2. We can print a more user-friendly error message
           than "foo is not a git command" or whatever the broken
           perl might barf
      
        3. Test scripts that require perl can mark themselves and
           such and be skipped
      
      This patch implements parts (1) and (2). The perl/
      subdirectory is skipped entirely, gitweb is not built, and
      any git commands which rely on perl will print a
      human-readable message and exit with an error code.
      
      This patch is based on one from Robin H. Johnson.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      499c2939
  2. 05 4月, 2009 1 次提交
  3. 26 3月, 2009 1 次提交
  4. 23 3月, 2009 1 次提交
  5. 19 3月, 2009 1 次提交
    • J
      MinGW: implement mmap · b130a72b
      Janos Laube 提交于
      Add USE_WIN32_MMAP which triggers the use of windows' native
      file memory mapping functionality in git_mmap()/git_munmap() functions.
      
      As git functions currently use mmap with MAP_PRIVATE set only, this
      implementation supports only that mode for now.
      
      On Windows, offsets for memory mapped files need to match the allocation
      granularity. Take this into account when calculating the packed git-
      windowsize and file offsets. At the moment, the only function which makes
      use of offsets in conjunction with mmap is use_pack() in sha1-file.c.
      
      Git fast-import's code path tries to map a portion of the temporary
      packfile that exceeds the current filesize, i.e. offset+length is
      greater than the filesize. The NO_MMAP code worked with that since pread()
      just reads the file content until EOF and returns gracefully, while
      MapViewOfFile() aborts the mapping and returns 'Access Denied'.
      Working around that by determining the filesize and adjusting the length
      parameter.
      Signed-off-by: NJanos Laube <janos.dev@gmail.com>
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b130a72b
  6. 09 3月, 2009 2 次提交
  7. 08 3月, 2009 1 次提交
    • K
      Record ns-timestamps if possible, but do not use it without USE_NSEC · c06ff490
      Kjetil Barvik 提交于
      Traditionally, the lack of USE_NSEC meant "do not record nor use the
      nanosecond resolution part of the file timestamps".  To avoid problems on
      filesystems that lose the ns part when the metadata is flushed to the disk
      and then later read back in, disabling USE_NSEC has been a good idea in
      general.
      
      If you are on a filesystem without such an issue, it does not hurt to read
      and store them in the cached stat data in the index entries even if your
      git is compiled without USE_NSEC.  The index left with such a version of
      git can be read by git compiled with USE_NSEC and it can make use of the
      nanosecond part to optimize the check to see if the path on the filesystem
      hsa been modified since we last looked at.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c06ff490
  8. 26 2月, 2009 1 次提交
    • J
      add basic http clone/fetch tests · 119c8eee
      Jeff King 提交于
      This was mostly being tested implicitly by the "http push"
      tests. But making a separate test script means that:
      
        - we will run fetch tests even when http pushing support
          is not built
      
        - when there are failures on fetching, they are easier to
          see and isolate, as they are not in the middle of push
          tests
      
      This script defaults to running the webserver on port 5550,
      and puts the original t5540 on port 5540, so that the two
      can be run simultaneously without conflict (but both still
      respect an externally set LIB_HTTPD_PORT).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      119c8eee
  9. 25 2月, 2009 1 次提交
  10. 20 2月, 2009 1 次提交
    • T
      Support coverage testing with GCC/gcov · 901c369a
      Thomas Rast 提交于
      With gcc's --coverage option, we can perform automatic coverage data
      collection for the test suite.
      
      Add a new Makefile target 'coverage' that scraps all previous coverage
      results, recompiles git with the required compiler/linker flags (in
      addition to any flags you specify manually), then runs the test suite
      and compiles a report.
      
      The compilation must be done with all optimizations disabled, since
      inlined functions (and for line-by-line coverage, also optimized
      branches/loops) break coverage tracking.
      
      The tests are run serially (with -j1).  The coverage code should
      theoretically allow concurrent access to its data files, but the
      author saw random test failures.  Obviously this could be improved.
      
      The report currently consists of a list of functions that were never
      executed during the tests, which is written to
      'coverage-untested-functions'.  Once this list becomes reasonably
      short, we would also want to look at branches that were never taken.
      
      Currently only toplevel *.c files are considered.  It would be nice to
      at least include xdiff, but --coverage did not save data to
      subdirectories on the system used to write this (gcc 4.3.2).
      Signed-off-by: NThomas Rast <trast@student.ethz.ch>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      901c369a
  11. 11 2月, 2009 3 次提交
  12. 05 2月, 2009 2 次提交
    • J
      Makefile: minor improvements for Mac OS X (Darwin) · 7233d221
      Jay Soffian 提交于
      1) Instead of requesting OLD_ICONV on all Mac OS X versions except for 10.5
      (which will break when 10.6 is released), exlicitly request it for versions
      older than 10.5.
      
      2) NO_STRLCPY is not needed since Mac OS X 10.2. Noticed by Benjamin Kramer.
      
      Note that uname -r returns the underlying Darwin version, which can be mapped
      to Mac OS X version at http://www.opensource.apple.com/darwinsource/Signed-off-by: NJay Soffian <jaysoffian@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7233d221
    • J
      Makefile: fix misdetection of relative pathnames · 0c0ead7e
      Junio C Hamano 提交于
      The installation rules wanted to differentiate between a template_dir that
      is given as an absolute path (e.g. /usr/share/git-core/templates) and a
      relative one (e.g. share/git-core/templates) but it was done by checking
      if $(abspath $(template_dir)) and $(template_dir) yield the same string.
      
      This was wrong in at least two ways.
      
       * The user can give template_dir with a trailing slash from the command
         line to invoke make or from the included config.mak.  A directory path
         ought to mean the same thing with or without such a trailing slash but
         use of $(abspath) means an absolute path with a trailing slash fails
         the test.
      
       * Versions of GNU make older than 3.81 do not have $(abspath) to begin
         with.
      
      This changes the detection logic to see if the given path begins with a
      slash.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0c0ead7e
  13. 04 2月, 2009 1 次提交
  14. 29 1月, 2009 1 次提交
  15. 27 1月, 2009 1 次提交
  16. 26 1月, 2009 3 次提交
    • S
      Windows: Revert to default paths and convert them by RUNTIME_PREFIX · 25655221
      Steffen Prohaska 提交于
      The RUNTIME_PREFIX mechanism allows us to use the default paths on
      Windows too.  Defining RUNTIME_PREFIX explicitly requests for
      translation of paths relative to the executable at runtime.
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Acked-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      25655221
    • S
      Compute prefix at runtime if RUNTIME_PREFIX is set · 35fb0e86
      Steffen Prohaska 提交于
      This commit adds support for relocatable binaries (called
      RUNTIME_PREFIX).  Such binaries can be moved together with the
      system configuration files to a different directory, as long as the
      relative paths from the binary to the configuration files is
      preserved.  This functionality is essential on Windows where we
      deliver git binaries with an installer that allows to freely choose
      the installation location.
      
      If RUNTIME_PREFIX is unset we use the static prefix.  This will be
      the default on Unix.  Thus, the behavior on Unix will remain
      identical to the old implementation, which used to add the prefix
      in the Makefile.
      
      If RUNTIME_PREFIX is set the prefix is computed from the location
      of the executable.  In this case, system_path() tries to strip
      known directories that executables can be located in from the path
      of the executable.  If the path is successfully stripped it is used
      as the prefix.  For example, if the executable is
      "/msysgit/bin/git" and BINDIR is "bin", then the prefix computed is
      "/msysgit".
      
      If the runtime prefix computation fails, we fall back to the static
      prefix specified in the makefile.  This can be the case if the
      executable is not installed at a known location.  Note that our
      test system sets GIT_CONFIG_NOSYSTEM to tell git to ignore global
      configuration files during testing.  Hence testing does not trigger
      the fall back.
      
      Note that RUNTIME_PREFIX only works on Windows, though adding
      support on Unix should not be too hard.  The implementation
      requires argv0_path to be set to an absolute path.  argv0_path must
      point to the directory of the executable.  We use assert() to
      verify this in debug builds.  On Windows, the wrapper for main()
      (see compat/mingw.h) guarantees that argv0_path is correctly
      initialized.  On Unix, further work is required before
      RUNTIME_PREFIX can be enabled.
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Acked-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      35fb0e86
    • S
      Move computation of absolute paths from Makefile to runtime (in preparation for RUNTIME_PREFIX) · 026fa0d5
      Steffen Prohaska 提交于
      This commit prepares the Makefile for relocatable binaries (called
      RUNTIME_PREFIX).  Such binaries will be able to be moved together
      with the system configuration files to a different directory,
      requiring to compute the prefix at runtime.
      
      In a first step, we make all paths relative in the Makefile and
      teach system_path() to add the prefix instead.  We used to compute
      absolute paths in the Makefile and passed them to C as defines.  We
      now pass relative paths to C and call system_path() to add the
      prefix at runtime.
      Signed-off-by: NSteffen Prohaska <prohaska@zib.de>
      Acked-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      026fa0d5
  17. 22 1月, 2009 1 次提交
    • J
      chain kill signals for cleanup functions · 4a16d072
      Jeff King 提交于
      If a piece of code wanted to do some cleanup before exiting
      (e.g., cleaning up a lockfile or a tempfile), our usual
      strategy was to install a signal handler that did something
      like this:
      
        do_cleanup(); /* actual work */
        signal(signo, SIG_DFL); /* restore previous behavior */
        raise(signo); /* deliver signal, killing ourselves */
      
      For a single handler, this works fine. However, if we want
      to clean up two _different_ things, we run into a problem.
      The most recently installed handler will run, but when it
      removes itself as a handler, it doesn't put back the first
      handler.
      
      This patch introduces sigchain, a tiny library for handling
      a stack of signal handlers. You sigchain_push each handler,
      and use sigchain_pop to restore whoever was before you in
      the stack.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      4a16d072
  18. 20 1月, 2009 1 次提交
    • B
      Makefile: use shell for-loop rather than Make's foreach loop during install · b56c79cc
      Brandon Casey 提交于
      The install target uses a foreach loop to generate a single long shell
      command line to handle installation of the built-in git commands.  The
      maximum length of the argument list varies by platform, and this use of
      foreach quickly grows the length of the argument list.  Current git can
      exceed the default maximum argument list length on IRIX 6.5 of 20480
      depending on the installation path.
      
      Rather than using make's foreach loop to pre-generate the shell command
      line, use a shell for-loop and allow the shell to iterate through each of
      the built-in commands.
      Signed-off-by: NBrandon Casey <casey@nrlssc.navy.mil>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b56c79cc
  19. 18 1月, 2009 1 次提交
    • R
      Add ctype test · b4285c71
      René Scharfe 提交于
      Manipulating the character class table in ctype.c by hand is error prone.
      To ensure that typos are found quickly, add a test program and script.
      
      test-ctype checks the output of the character class macros isspace() et.
      al. by applying them on all possible char values and consulting a list of
      all characters in the particular class.  It doesn't check tolower() and
      toupper(); this could be added later.
      
      The test script t0070-fundamental.sh is created because there is no good
      place for the ctype test, yet -- except for t0000-basic.sh perhaps, but
      it doesn't run well on Windows, yet.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b4285c71
  20. 12 1月, 2009 1 次提交
  21. 08 1月, 2009 1 次提交
  22. 21 12月, 2008 2 次提交
  23. 18 12月, 2008 1 次提交
  24. 11 12月, 2008 1 次提交
  25. 03 12月, 2008 2 次提交
    • J
      Install git-stage in exec-path · 24b1f65f
      Junio C Hamano 提交于
      Earlier the plan was to eventually eradicate git-foo executables from the
      filesystem for all the built-in commands, but when we released 1.6.0 we
      decided not to do so.  Instead, it has been promised that by prepending
      the output from $(git --exec-path) to your $PATH, you can keep using the
      dashed form of commands.
      
      This also allows "git stage" to appear in the autogenerated command list,
      which is used to offer man pages by "git help" command.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      24b1f65f
    • J
      Makefile: introduce NO_PTHREADS · 46059cc6
      Junio C Hamano 提交于
      This introduces make variable NO_PTHREADS for platforms that lack the
      support for pthreads library or people who do not want to use it for
      whatever reason.  When defined, it makes the multi-threaded index
      preloading into a no-op, and also disables threaded delta searching by
      pack-objects.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NMike Ralphson <mike@abacus.co.uk>
      Tested-by: Johannes Sixt <j6t@kdbg.org> (AIX 4.3.x)
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      46059cc6
  26. 24 11月, 2008 1 次提交
  27. 15 11月, 2008 1 次提交
    • L
      Add cache preload facility · 671c9b7e
      Linus Torvalds 提交于
      This can do the lstat() storm in parallel, giving potentially much
      improved performance for cold-cache cases or things like NFS that have
      weak metadata caching.
      
      Just use "read_cache_preload()" instead of "read_cache()" to force an
      optimistic preload of the index stat data.  The function takes a
      pathspec as its argument, allowing us to preload only the relevant
      portion of the index.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      671c9b7e
  28. 12 11月, 2008 1 次提交
  29. 03 11月, 2008 2 次提交
  30. 02 11月, 2008 2 次提交