1. 19 9月, 2009 1 次提交
  2. 20 8月, 2009 1 次提交
  3. 19 8月, 2009 1 次提交
  4. 23 7月, 2009 2 次提交
  5. 11 7月, 2009 1 次提交
    • B
      git-compat-util.h: adjust for SGI IRIX 6.5 · 9398b859
      Brandon Casey 提交于
      Don't define _XOPEN_SOURCE
      Do    define _SGI_SOURCE
      
      Defining _XOPEN_SOURCE prevents many of the common functions and macros
      from being defined. _Not_ setting _XOPEN_SOURCE, and instead setting
      _SGI_SOURCE, provides all of the XPG4, XPG5, BSD, POSIX functions and
      declarations, _BUT_ provides a horribly broken snprintf(). SGI does have
      a working snprintf(), but it is only provided when _NO_XOPEN5 evaluates
      to zero, and this only happens if _XOPEN_SOURCE is defined which, as
      mentioned above, prevents many other common functions and defines.
      
      The broken snprintf will be worked around with SNPRINTF_RETURNS_BOGUS in
      the Makefile in a later patch.
      Signed-off-by: NBrandon Casey <casey@nrlssc.navy.mil>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9398b859
  6. 28 6月, 2009 1 次提交
  7. 09 6月, 2009 1 次提交
    • B
      git-compat-util.h: avoid using c99 flex array feature with Sun compiler 5.8 · 203ee91f
      Brandon Casey 提交于
      The Sun c99 compiler as recent as version 5.8 Patch 121016-06 2007/08/01
      produces an error when compiling diff-delta.c.  This source file #includes
      the delta.h header file which pre-declares a struct which is later defined
      to contain a flex array member.  The Sun c99 compiler fails to compile
      diff-delta.c and gives the following error:
      
        "diff-delta.c", line 314: identifier redeclared: create_delta
                current : function(pointer to const struct delta_index {unsigned long memsize, pointer to const void src_buf, unsigned long src_size, unsigned int hash_mask, array[-1] of pointer to struct index_entry {..} hash}, pointer to const void, unsigned long, pointer to unsigned long, unsigned long) returning pointer to void
                previous: function(pointer to const struct delta_index {unsigned long memsize, pointer to const void src_buf, unsigned long src_size, unsigned int hash_mask, array[-1] of pointer to struct index_entry {..} hash}, pointer to const void, unsigned long, pointer to unsigned long, unsigned long) returning pointer to void : "delta.h", line 44
        c99: acomp failed for diff-delta.c
      
      So, avoid using this c99 feature when compiling with the Sun c compilers
      version 5.8 and older (the most recent version tested).
      Signed-off-by: NBrandon Casey <drafnel@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      203ee91f
  8. 07 6月, 2009 1 次提交
  9. 01 6月, 2009 2 次提交
  10. 23 5月, 2009 1 次提交
    • J
      Teach Solaris that _XOPEN_SOURCE=600 really menas XPG6 · 30d8080c
      Junio C Hamano 提交于
      In git-compat-util.h, we do
      
          #define _XOPEN_SOURCE 600
          #define _XOPEN_SOURCE_EXTENDED 1
      
      unless we are on BSD or SCO.
      
      On OpenSolaris (200811), /usr/include/sys/feature_tests.h has this nice
      table:
      
          Feature Test Macro				     Specification
          ------------------------------------------------  -------------
          _XOPEN_SOURCE                                         XPG3
          _XOPEN_SOURCE && _XOPEN_VERSION = 4                   XPG4
          _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED = 1           XPG4v2
          _XOPEN_SOURCE = 500                                   XPG5
          _XOPEN_SOURCE = 600  (or POSIX_C_SOURCE=200112L)      XPG6
      
      Later in the same header, compilation with -c99 is made to fail if _XPG6 is
      not set, like this:
      
          #if defined(_STDC_C99) && (defined(__XOPEN_OR_POSIX) && !defined(_XPG6))
          #error "Compiler or options invalid for pre-UNIX 03 X/Open applications \
                  and pre-2001 POSIX applications"
          #elif ...
      
      The problem is that they check things in an order that is inconvenient for
      us.  When they see _XOPEN_SOURCE_EXTENDED, they declare that we are XPG4v2,
      regardless of the value of _XOPEN_SOURCE.
      
      To work around this problem, do not define _XOPEN_SOURCE_EXTENDED on
      Sun's.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      30d8080c
  11. 30 4月, 2009 1 次提交
  12. 28 4月, 2009 1 次提交
  13. 21 4月, 2009 1 次提交
    • J
      Windows: Skip fstat/lstat optimization in write_entry() · 34779c53
      Johannes Sixt 提交于
      Commit e4c72923 (write_entry(): use fstat() instead of lstat() when file
      is open, 2009-02-09) introduced an optimization of write_entry().
      Unfortunately, we cannot take advantage of this optimization on Windows
      because there is no guarantee that the time stamps are updated before the
      file is closed:
      
        "The only guarantee about a file timestamp is that the file time is
         correctly reflected when the handle that makes the change is closed."
      
      (http://msdn.microsoft.com/en-us/library/ms724290(VS.85).aspx)
      
      The failure of this optimization on Windows can be observed most easily by
      running a 'git checkout' that has to update several large files. In this
      case, 'git checkout' will report modified files, but infact only the
      timestamps were incorrectly recorded in the index, as can be verified by a
      subsequent 'git diff', which shows no change.
      
      Dmitry Potapov reports the same fix needs on Cygwin; this commit contains
      his updates for that.
      Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      34779c53
  14. 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
  15. 09 3月, 2009 1 次提交
  16. 08 3月, 2009 2 次提交
    • 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
    • R
      cleanup: add isascii() · c2e9364a
      René Scharfe 提交于
      Add a standard definition of isascii() and use it to replace an open
      coded high-bit test in pretty.c.  While we're there, write the ESC
      char as the more commonly used '\033' instead of as 0x1b to enhance
      its grepability.
      Signed-off-by: NRene Scharfe <rene.scharfe@lsrfire.ath.cx>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c2e9364a
  17. 26 2月, 2009 1 次提交
    • J
      Make sure objects/pack exists before creating a new pack · 6e180cdc
      Junio C Hamano 提交于
      In a repository created with git older than f49fb35d (git-init-db: create
      "pack" subdirectory under objects, 2005-06-27), objects/pack/ directory is
      not created upon initialization.  It was Ok because subdirectories are
      created as needed inside directories init-db creates, and back then,
      packfiles were recent invention.
      
      After the said commit, new codepaths started relying on the presense of
      objects/pack/ directory in the repository.  This was exacerbated with
      8b4eb6b6 (Do not perform cross-directory renames when creating packs,
      2008-09-22) that moved the location temporary pack files are created from
      objects/ directory to objects/pack/ directory, because moving temporary to
      the final location was done carefully with lazy leading directory creation.
      
      Many packfile related operations in such an old repository can fail
      mysteriously because of this.
      
      This commit introduces two helper functions to make things work better.
      
       - odb_mkstemp() is a specialized version of mkstemp() to refactor the
         code and teach it to create leading directories as needed;
      
       - odb_pack_keep() refactors the code to create a ".keep" file while
         create leading directories as needed.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6e180cdc
  18. 18 1月, 2009 2 次提交
  19. 01 10月, 2008 1 次提交
    • D
      cygwin: Use native Win32 API for stat · adbc0b6b
      Dmitry Potapov 提交于
      lstat/stat functions in Cygwin are very slow, because they try to emulate
      some *nix things that Git does not actually need. This patch adds Win32
      specific implementation of these functions for Cygwin.
      
      This implementation handles most situation directly but in some rare cases
      it falls back on the implementation provided for Cygwin. This is necessary
      for two reasons:
      
      - Cygwin has its own file hierarchy, so absolute paths used in Cygwin is
        not suitable to be used Win32 API. cygwin_conv_to_win32_path can not be
        used because it automatically dereference Cygwin symbol links, also it
        causes extra syscall. Fortunately Git rarely use absolute paths, so we
        always use Cygwin implementation for absolute paths.
      
      - Support of symbol links. Cygwin stores symbol links as ordinary using
        one of two possible formats. Therefore, the fast implementation falls
        back to Cygwin functions if it detects potential use of symbol links.
      
      The speed of this implementation should be the same as mingw_lstat for
      common cases, but it is considerable slower when the specified file name
      does not exist.
      
      Despite all efforts to make the fast implementation as robust as possible,
      it may not work well for some very rare situations. I am aware only one
      situation: use Cygwin mount to bind unrelated paths inside repository
      together.  Therefore, the core.ignoreCygwinFSTricks configuration option is
      provided, which controls whether native or Cygwin version of stat is used.
      Signed-off-by: NDmitry Potapov <dpotapov@gmail.com>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      adbc0b6b
  20. 29 9月, 2008 1 次提交
  21. 29 8月, 2008 1 次提交
  22. 19 8月, 2008 1 次提交
  23. 26 7月, 2008 1 次提交
  24. 10 7月, 2008 1 次提交
  25. 01 7月, 2008 1 次提交
  26. 26 6月, 2008 1 次提交
  27. 23 6月, 2008 4 次提交
    • J
      Make my_mktime() public and rename it to tm_to_time_t() · bb5799d6
      Johannes Sixt 提交于
      We will use it from the MinGW port's gettimeofday() substitution.
      Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
      bb5799d6
    • J
      Windows: Strip ".exe" from the program name. · 23326d14
      Johannes Sixt 提交于
      Before we can successfully parse a builtin command from the program name
      we must strip off unneeded parts, that is, the file extension.
      
      Furthermore, we must take Windows style path names into account when we
      parse the program name.
      Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
      23326d14
    • J
      Windows: Treat Windows style path names. · 25fe217b
      Johannes Sixt 提交于
      GIT's guts work with a forward slash as a path separators. We do not change
      that. Rather we make sure that only "normalized" paths enter the depths
      of the machinery.
      
      We have to translate backslashes to forward slashes in the prefix and in
      command line arguments. Fortunately, all of them are passed through
      functions in setup.c.
      
      A macro has_dos_drive_path() is defined that checks whether a path begins
      with a drive letter+colon combination. This predicate is always false on
      Unix. Another macro is_dir_sep() abstracts that a backslash is also a
      directory separator on Windows.
      Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
      25fe217b
    • L
      Shrink the git binary a bit by avoiding unnecessary inline functions · 112db553
      Linus Torvalds 提交于
      So I was looking at the disgusting size of the git binary, and even with
      the debugging removed, and using -Os instead of -O2, the size of the text
      section was pretty high. In this day and age I guess almost a megabyte of
      text isn't really all that surprising, but it still doesn't exactly make
      me think "lean and mean".
      
      With -Os, a surprising amount of text space is wasted on inline functions
      that end up just being replicated multiple times, and where performance
      really isn't a valid reason to inline them. In particular, the trivial
      wrapper functions like "xmalloc()" are used _everywhere_, and making them
      inline just duplicates the text (and the string we use to 'die()' on
      failure) unnecessarily.
      
      So this just moves them into a "wrapper.c" file, getting rid of a tiny bit
      of unnecessary bloat. The following numbers are both with "CFLAGS=-Os":
      
      Before:
      	[torvalds@woody git]$ size git
      	   text	   data	    bss	    dec	    hex	filename
      	 700460	  15160	 292184	1007804	  f60bc	git
      
      After:
      	[torvalds@woody git]$ size git
      	   text	   data	    bss	    dec	    hex	filename
      	 670540	  15160	 292184	 977884	  eebdc	git
      
      so it saves almost 30k of text-space (it actually saves more than that
      with the default -O2, but I don't think that's necessarily a very relevant
      number from a "try to shrink git" standpoint).
      
      It might conceivably have a performance impact, but none of this should be
      _that_ performance critical. The real cost is not generally in the wrapper
      anyway, but in the code it wraps (ie the cost of "xread()" is all in the
      read itself, not in the trivial wrapping of it).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      112db553
  28. 22 6月, 2008 2 次提交
  29. 09 6月, 2008 1 次提交
    • B
      Port to 12 other Platforms. · 457bb452
      Boyd Lynn Gerber 提交于
      This patch adds support to compile and run git on 12 additional platforms.
      The platforms are based on UNIX Systems Labs (USL)/Novell/SYS V code base.
      The most common are Novell UnixWare 2.X.X, SCO UnixWare 7.X.X,
      OpenServer 5.0.X, OpenServer 6.0.X, and SCO pre OSR 5 platforms.
      
      Looking at the the various platform headers, I find:
      
      	#if defined(_KERNEL) || !defined(_POSIX_SOURCE) \
      	     && !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)
      
      which hides u_short and other typedefs that other header files on these
      platforms depend on.  WIth _XOPEN_SOURCE defined, sources that include
      system header files that depend on the typedefs such as u_short cannot be
      compiled on these platforms.
      
      __USLC__ indicates UNIX System Labs Corperation (USLC), or a Novell-derived
      compiler and/or some SysV based OS's.
      
      __M_UNIX indicates XENIX/SCO UNIX/OpenServer 5.0.7 and prior releases
      of the SCO OS's.  It is used just like Apple and BSD, both of these
      shouldn't have _XOPEN_SOURCE defined.
      
      This is with suggestions and modifications from
      
      Daniel Barkalow, Junio C Hamano, Thomas Harning, and Jeremy Maitin-Shepard.
      Signed-off-by: NBoyd Lynn Gerber <gerberb@zenez.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      457bb452
  30. 09 5月, 2008 1 次提交
  31. 28 4月, 2008 1 次提交
  32. 14 3月, 2008 1 次提交
    • N
      pack-objects: proper pack time stamping with --max-pack-size · f746bae8
      Nicolas Pitre 提交于
      Runtime pack access is done in the pack file mtime order since recent
      packs are more likely to contain frequently used objects than old packs.
      However the --max-pack-size option can produce multiple packs with mtime
      in the reversed order as newer objects are always written first.
      
      Let's modify mtime of later pack files (when any) so they appear older
      than preceding ones when a repack creates multiple packs.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      f746bae8