1. 31 7月, 2007 1 次提交
  2. 02 7月, 2007 1 次提交
  3. 07 6月, 2007 1 次提交
    • J
      War on whitespace · a6080a0a
      Junio C Hamano 提交于
      This uses "git-apply --whitespace=strip" to fix whitespace errors that have
      crept in to our source files over time.  There are a few files that need
      to have trailing whitespaces (most notably, test vectors).  The results
      still passes the test, and build result in Documentation/ area is unchanged.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a6080a0a
  4. 22 5月, 2007 1 次提交
  5. 26 4月, 2007 1 次提交
  6. 23 4月, 2007 2 次提交
    • J
      Make read-cache.c "the_index" free. · 4aab5b46
      Junio C Hamano 提交于
      This makes all low-level functions defined in read-cache.c to
      take an explicit index_state structure as their first parameter,
      to specify which index to work on.  These functions
      traditionally operated on "the_index" and were named foo_cache();
      the counterparts this patch introduces are called foo_index().
      
      The traditional foo_cache() functions are made into macros that
      give "the_index" to their corresponding foo_index() functions.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4aab5b46
    • J
      Move index-related variables into a structure. · 228e94f9
      Junio C Hamano 提交于
      This defines a index_state structure and moves index-related
      global variables into it.  Currently there is one instance of
      it, the_index, and everybody accesses it, so there is no code
      change.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      228e94f9
  7. 14 4月, 2007 1 次提交
    • L
      Fix gitlink index entry filesystem matching · a8ee75bc
      Linus Torvalds 提交于
      The code to match up index entries with the filesystem was stupidly
      broken.  We shouldn't compare the filesystem stat() information with
      S_IFDIRLNK, since that's purely a git-internal value, and not what the
      filesystem uses (on the filesystem, it's just a regular directory).
      
      Also, don't bother to make the stat() time comparisons etc for DIRLNK
      entries in ce_match_stat_basic(), since we do an exact match for these
      things, and the hints in the stat data simply doesn't matter.
      
      This fixes "git status" with submodules that haven't been checked out in
      the supermodule.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a8ee75bc
  8. 12 4月, 2007 2 次提交
    • L
      Teach directory traversal about subprojects · 09595258
      Linus Torvalds 提交于
      This is the promised cleaned-up version of teaching directory traversal
      (ie the "read_directory()" logic) about subprojects. That makes "git add"
      understand to add/update subprojects.
      
      It now knows to look at the index file to see if a directory is marked as
      a subproject, and use that as information as whether it should be recursed
      into or not.
      
      It also generally cleans up the handling of directory entries when
      traversing the working tree, by splitting up the decision-making process
      into small functions of their own, and adding a fair number of comments.
      
      Finally, it teaches "add_file_to_cache()" that directory names can have
      slashes at the end, since the directory traversal adds them to make the
      difference between a file and a directory clear (it always did that, but
      my previous too-ugly-to-apply subproject patch had a totally different
      path for subproject directories and avoided the slash for that case).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      09595258
    • L
      Fix thinko in subproject entry sorting · 1833a925
      Linus Torvalds 提交于
      This fixes a total thinko in my original series: subprojects do *not* sort
      like directories, because the index is sorted purely by full pathname, and
      since a subproject shows up in the index as a normal NUL-terminated
      string, it never has the issues with sorting with the '/' at the end.
      
      So if you have a subproject "proj" and a file "proj.c", the subproject
      sorts alphabetically before the file in the index (and must thus also sort
      that way in a tree object, since trees sort as the index).
      
      In contrast, it you have two files "proj/file" and "proj.c", the "proj.c"
      will sort alphabetically before "proj/file" in the index. The index
      itself, of course, does not actually contain an entry "proj/", but in the
      *tree* that gets written out, the tree entry "proj" will sort after the
      file entry "proj.c", which is the only real magic sorting rule.
      
      In other words: the magic sorting rule only affects tree entries, and
      *only* affects tree entries that point to other trees (ie are of the type
      S_IFDIR).
      
      Anyway, that thinko just means that we should remove the special case to
      make S_ISDIRLNK entries sort like S_ISDIR entries. They don't.  They sort
      like normal files.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1833a925
  9. 11 4月, 2007 1 次提交
  10. 06 4月, 2007 3 次提交
    • J
      Rename add_file_to_index() to add_file_to_cache() · fd1c3bf0
      Junio C Hamano 提交于
      This function was not called "add_file_to_cache()" only because
      an ancient program, update-cache, used that name as an internal
      function name that does something slightly different.  Now that
      is gone, we can take over the better name.
      
      The plan is to name all functions that operate on the default
      index xxx_cache().  Later patches create a variant of them that
      take an explicit parameter xxx_index(), and then turn
      xxx_cache() functions into macros that use "the_index".
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      fd1c3bf0
    • J
      Propagate cache error internal to refresh_cache() via parameter. · ec0cc704
      Junio C Hamano 提交于
      The function refresh_cache() is the only user of cache_errno
      that switches its behaviour based on what internal function
      refresh_cache_entry() finds; pass the error status back in a
      parameter passed down to it, to get rid of the global variable
      cache_errno.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ec0cc704
    • J
      Fix bogus error message from merge-recursive error path · 0424138d
      Junio C Hamano 提交于
      This error message should not usually trigger, but the function
      make_cache_entry() called by add_cacheinfo() can return early
      without calling into refresh_cache_entry() that sets cache_errno.
      
      Also the error message had a wrong function name reported, and
      it did not say anything about which path failed either.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      0424138d
  11. 04 4月, 2007 1 次提交
  12. 08 3月, 2007 1 次提交
    • S
      Cast 64 bit off_t to 32 bit size_t · dc49cd76
      Shawn O. Pearce 提交于
      Some systems have sizeof(off_t) == 8 while sizeof(size_t) == 4.
      This implies that we are able to access and work on files whose
      maximum length is around 2^63-1 bytes, but we can only malloc or
      mmap somewhat less than 2^32-1 bytes of memory.
      
      On such a system an implicit conversion of off_t to size_t can cause
      the size_t to wrap, resulting in unexpected and exciting behavior.
      Right now we are working around all gcc warnings generated by the
      -Wshorten-64-to-32 option by passing the off_t through xsize_t().
      
      In the future we should make xsize_t on such problematic platforms
      detect the wrapping and die if such a file is accessed.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      dc49cd76
  13. 03 3月, 2007 1 次提交
    • J
      Add core.symlinks to mark filesystems that do not support symbolic links. · 78a8d641
      Johannes Sixt 提交于
      Some file systems that can host git repositories and their working copies
      do not support symbolic links. But then if the repository contains a symbolic
      link, it is impossible to check out the working copy.
      
      This patch enables partial support of symbolic links so that it is possible
      to check out a working copy on such a file system.  A new flag
      core.symlinks (which is true by default) can be set to false to indicate
      that the filesystem does not support symbolic links. In this case, symbolic
      links that exist in the trees are checked out as small plain files, and
      checking in modifications of these files preserve the symlink property in
      the database (as long as an entry exists in the index).
      
      Of course, this does not magically make symbolic links work on such defective
      file systems; hence, this solution does not help if the working copy relies
      on that an entry is a real symbolic link.
      Signed-off-by: NJohannes Sixt <johannes.sixt@telecom.at>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      78a8d641
  14. 01 3月, 2007 2 次提交
  15. 27 2月, 2007 1 次提交
    • N
      convert object type handling from a string to a number · 21666f1a
      Nicolas Pitre 提交于
      We currently have two parallel notation for dealing with object types
      in the code: a string and a numerical value.  One of them is obviously
      redundent, and the most used one requires more stack space and a bunch
      of strcmp() all over the place.
      
      This is an initial step for the removal of the version using a char array
      found in object reading code paths.  The patch is unfortunately large but
      there is no sane way to split it in smaller parts without breaking the
      system.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      21666f1a
  16. 17 2月, 2007 1 次提交
    • J
      Do not take mode bits from index after type change. · 185c975f
      Junio C Hamano 提交于
      When we do not trust executable bit from lstat(2), we copied
      existing ce_mode bits without checking if the filesystem object
      is a regular file (which is the only thing we apply the "trust
      executable bit" business) nor if the blob in the index is a
      regular file (otherwise, we should do the same as registering a
      new regular file, which is to default non-executable).
      
      Noticed by Johannes Sixt.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      185c975f
  17. 12 1月, 2007 1 次提交
  18. 09 1月, 2007 1 次提交
  19. 30 12月, 2006 2 次提交
    • S
      Cleanup read_cache_from error handling. · 5fe5c830
      Shawn O. Pearce 提交于
      When I converted the mmap() call to xmmap() I failed to cleanup the
      way this routine handles errors and left some crufty code behind.
      This is a small cleanup, suggested by Johannes.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5fe5c830
    • S
      Replace mmap with xmmap, better handling MAP_FAILED. · c4712e45
      Shawn O. Pearce 提交于
      In some cases we did not even bother to check the return value of
      mmap() and just assume it worked.  This is bad, because if we are
      out of virtual address space the kernel returned MAP_FAILED and we
      would attempt to dereference that address, segfaulting without any
      real error output to the user.
      
      We are replacing all calls to mmap() with xmmap() and moving all
      MAP_FAILED checking into that single location.  If a mmap call
      fails we try to release enough least-recently-used pack windows
      to possibly succeed, then retry the mmap() attempt.  If we cannot
      mmap even after releasing pack memory then we die() as none of our
      callers have any reasonable recovery strategy for a failed mmap.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c4712e45
  20. 17 12月, 2006 3 次提交
    • J
      Fix check_file_directory_conflict(). · 81a361be
      Junio C Hamano 提交于
      When replacing an existing file A with a directory A that has a
      file A/B in it in the index, 'update-index --replace --add A/B'
      did not properly remove the file to make room for the new
      directory.
      
      There was a trivial logic error, most likely a cut & paste one,
      dating back to quite early days of git.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      81a361be
    • J
      git-add: remove conflicting entry when adding. · c33ab0dd
      Junio C Hamano 提交于
      When replacing an existing file A with a directory A that has a
      file A/B in it in the index, 'git add' did not succeed because
      it forgot to pass the allow-replace flag to add_cache_entry().
      
      It might be safer to leave this as an error and require the user
      to explicitly remove the existing A first before adding A/B
      since it is an unusual case, but doing that automatically is
      much easier to use.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c33ab0dd
    • J
      update-index: make D/F conflict error a bit more verbose. · 790fa0e2
      Junio C Hamano 提交于
      When you remove a directory D that has a tracked file D/F out of the
      way to create a file D and try to "git update-index --add D", it used
      to say "cannot add" which was not very helpful.  This issues an extra
      error message to explain the situation before the final "fatal" message.
      
      Since D/F conflicts are relatively rare event, extra verbosity would
      not make things too noisy.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      790fa0e2
  21. 23 11月, 2006 1 次提交
  22. 19 11月, 2006 1 次提交
  23. 27 9月, 2006 1 次提交
  24. 18 8月, 2006 1 次提交
  25. 16 8月, 2006 3 次提交
  26. 15 8月, 2006 2 次提交
    • J
      avoid nanosleep(2) · 789a09b4
      Junio C Hamano 提交于
      On Solaris nanosleep(2) is not available in libc; you need to
      link with -lrt to get it.
      
      The purpose of the loop is to wait until the next filesystem
      timestamp granularity, and the code uses subsecond sleep in the
      hope that it can shorten the delay to 0.5 seconds on average
      instead of a full second.  It is probably not worth depending on
      an extra library for this.
      
      We might want to yank out the whole "racy-git avoidance is
      costly later at runtime, so let's delay writing the index out"
      codepath later, but that is a separate issue and needs some
      testing on large trees to figure it out.  After playing with the
      kernel tree, I have a feeling that the whole thing may not be
      worth it.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      789a09b4
    • D
      read-cache.c cleanup · 968a1d65
      David Rientjes 提交于
      Removes conditional returns.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      968a1d65
  27. 11 8月, 2006 1 次提交
  28. 09 8月, 2006 1 次提交
    • J
      read-cache: tweak racy-git delay logic · 6015c28b
      Junio C Hamano 提交于
      Instead of looping over the entries and writing out, use a
      separate loop after all entries have been written out to check
      how many entries are racily clean.  Make sure that the newly
      created index file gets the right timestamp when we check by
      flushing the buffered data by ce_write().
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      6015c28b
  29. 07 8月, 2006 1 次提交
    • J
      Racy git: avoid having to be always too careful · b7e58b17
      Junio C Hamano 提交于
      Immediately after a bulk checkout, most of the paths in the
      working tree would have the same timestamp as the index file,
      and this would force ce_match_stat() to take slow path for all
      of them.  When writing an index file out, if many of the paths
      have very new (read: the same timestamp as the index file being
      written out) timestamp, we are better off delaying the return
      from the command, to make sure that later command to touch the
      working tree files will leave newer timestamps than recorded in
      the index, thereby avoiding to take the slow path.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b7e58b17