1. 24 12月, 2005 2 次提交
    • J
      Adjust to ls-tree --full-name when run from a subdirectory. · d0d14cf3
      Junio C Hamano 提交于
      A proposed change to show cwd relative paths by default from
      ls-tree when run from a subdirectory means we would need to
      give --full-name option to it.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d0d14cf3
    • J
      ls-tree: chomp leading directories when run from a subdirectory · a69dd585
      Junio C Hamano 提交于
      When run from a subdirectory, even though we filtered the output
      based on where we were using pathspec, we wrote out the
      repository relative paths, not subtree relative paths.  This
      changes things so that it shows only the current subdirectory
      relative paths.
      
      For example, in Documentation subdirectory of git itself, this
      used to be the case:
      
          $ git-ls-tree --name-only HEAD | grep how
          Documentation/git-show-branch.txt
          Documentation/git-show-index.txt
          Documentation/howto-index.sh
          Documentation/howto
      
      But now it does this instead:
      
          $ git-ls-tree --name-only HEAD | grep how
          git-show-branch.txt
          git-show-index.txt
          howto-index.sh
          howto
      
      There are two things to keep in mind.
      
      1. This shows nothing.
      
         $ git-ls-tree --name-only HEAD ../ppc/
      
         This is to make things consistent with ls-files, which
         refuses relative path that goes uplevel.
      
      2. These show things in full repository relative paths.  In this
         case, paths outside the current subdirectory are also shown.
      
         $ git-ls-tree --name-only --full-name HEAD | grep how
         Documentation/git-show-branch.txt
         Documentation/git-show-index.txt
         Documentation/howto-index.sh
         Documentation/howto
      
         $ git-ls-tree --name-only --full-name HEAD ../ppc/
         ppc/sha1.c
         ppc/sha1.h
         ppc/sha1ppc.S
      
      The flag --full-name gives the same behaviour as 1.0, so it
      ought to be the default if we really care about the backward
      compatibility, but in practice no Porcelain runs ls-tree from a
      subdirectory yet, and without --full-name is more human
      friendly, so hopefully the default being not --full-name would
      be acceptable.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a69dd585
  2. 23 12月, 2005 10 次提交
  3. 22 12月, 2005 18 次提交
  4. 21 12月, 2005 5 次提交
  5. 20 12月, 2005 5 次提交
    • J
      Racy GIT · 29e4d363
      Junio C Hamano 提交于
      This fixes the longstanding "Racy GIT" problem, which was pretty
      much there from the beginning of time, but was first
      demonstrated by Pasky in this message on October 24, 2005:
      
          http://marc.theaimsgroup.com/?l=git&m=113014629716878
      
      If you run the following sequence of commands:
      
      	echo frotz >infocom
              git update-index --add infocom
              echo xyzzy >infocom
      
      so that the second update to file "infocom" does not change
      st_mtime, what is recorded as the stat information for the cache
      entry "infocom" exactly matches what is on the filesystem
      (owner, group, inum, mtime, ctime, mode, length).  After this
      sequence, we incorrectly think "infocom" file still has string
      "frotz" in it, and get really confused.  E.g. git-diff-files
      would say there is no change, git-update-index --refresh would
      not even look at the filesystem to correct the situation.
      
      Some ways of working around this issue were already suggested by
      Linus in the same thread on the same day, including waiting
      until the next second before returning from update-index if a
      cache entry written out has the current timestamp, but that
      means we can make at most one commit per second, and given that
      the e-mail patch workflow used by Linus needs to process at
      least 5 commits per second, it is not an acceptable solution.
      Linus notes that git-apply is primarily used to update the index
      while processing e-mailed patches, which is true, and
      git-apply's up-to-date check is fooled by the same problem but
      luckily in the other direction, so it is not really a big issue,
      but still it is disturbing.
      
      The function ce_match_stat() is called to bypass the comparison
      against filesystem data when the stat data recorded in the cache
      entry matches what stat() returns from the filesystem.  This
      patch tackles the problem by changing it to actually go to the
      filesystem data for cache entries that have the same mtime as
      the index file itself.  This works as long as the index file and
      working tree files are on the filesystems that share the same
      monotonic clock.  Files on network mounted filesystems sometimes
      get skewed timestamps compared to "date" output, but as long as
      working tree files' timestamps are skewed the same way as the
      index file's, this approach still works.  The only problematic
      files are the ones that have the same timestamp as the index
      file's, because two file updates that sandwitch the index file
      update must happen within the same second to trigger the
      problem.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      29e4d363
    • J
      format-patch: make sure header and body are separated. · a5c21d6e
      Junio C Hamano 提交于
      Since log message in a commit object is defined to be binary
      blob, it could be something without an empty line between the
      title line and the body text.  Be careful to format such into
      a form suitable for e-mail submission.  There must be an empty
      line between the headers and the body.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a5c21d6e
    • J
      diff --abbrev: document --abbrev=<n> form. · 913419fc
      Junio C Hamano 提交于
      It was implemented there but was not advertised.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      913419fc
    • J
      diff: --abbrev option · 47dd0d59
      Junio C Hamano 提交于
      When I show transcripts to explain how something works, I often
      find myself hand-editing the diff-raw output to shorten various
      object names in the output.
      
      This adds --abbrev option to the diff family, which shortens
      diff-raw output and diff-tree commit id headers.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      47dd0d59
    • J
      xread/xwrite: do not worry about EINTR at calling sites. · 1c15afb9
      Junio C Hamano 提交于
      We had errno==EINTR check after read(2)/write(2) sprinkled all
      over the places, always doing continue.  Consolidate them into
      xread()/xwrite() wrapper routines.
      
      Credits for suggestion goes to HPA -- bugs are mine.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      1c15afb9