1. 28 2月, 2009 1 次提交
  2. 11 12月, 2008 1 次提交
  3. 13 11月, 2008 3 次提交
  4. 31 10月, 2008 2 次提交
  5. 27 10月, 2008 2 次提交
  6. 20 10月, 2008 1 次提交
  7. 18 10月, 2008 1 次提交
    • J
      refactor handling of "other" files in ls-files and status · 98fa4738
      Jeff King 提交于
      When the "git status" display code was originally converted
      to C, we copied the code from ls-files to discover whether a
      pathname returned by read_directory was an "other", or
      untracked, file.
      
      Much later, 5698454e updated the code in ls-files to handle
      some new cases caused by gitlinks.  This left the code in
      wt-status.c broken: it would display submodule directories
      as untracked directories. Nobody noticed until now, however,
      because unless status.showUntrackedFiles was set to "all",
      submodule directories were not actually reported by
      read_directory. So the bug was only triggered in the
      presence of a submodule _and_ this config option.
      
      This patch pulls the ls-files code into a new function,
      cache_name_is_other, and uses it in both places. This should
      leave the ls-files functionality the same and fix the bug
      in status.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      98fa4738
  8. 24 8月, 2008 1 次提交
    • J
      unpack_trees(): protect the handcrafted in-core index from read_cache() · 913e0e99
      Junio C Hamano 提交于
      unpack_trees() rebuilds the in-core index from scratch by allocating a new
      structure and finishing it off by copying the built one to the final
      index.
      
      The resulting in-core index is Ok for most use, but read_cache() does not
      recognize it as such.  The function is meant to be no-op if you already
      have loaded the index, until you call discard_cache().
      
      This change the way read_cache() detects an already initialized in-core
      index, by introducing an extra bit, and marks the handcrafted in-core
      index as initialized, to avoid this problem.
      
      A better fix in the longer term would be to change the read_cache() API so
      that it will always discard and re-read from the on-disk index to avoid
      confusion.  But there are higher level API that have relied on the current
      semantics, and they and their users all need to get converted, which is
      outside the scope of 'maint' track.
      
      An example of such a higher level API is write_cache_as_tree(), which is
      used by git-write-tree as well as later Porcelains like git-merge, revert
      and cherry-pick.  In the longer term, we should remove read_cache() from
      there and add one to cmd_write_tree(); other callers expect that the
      in-core index they prepared is what gets written as a tree so no other
      change is necessary for this particular codepath.
      
      The original version of this patch marked the index by pointing an
      otherwise wasted malloc'ed memory with o->result.alloc, but this version
      uses Linus's idea to use a new "initialized" bit, which is conceptually
      much cleaner.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      913e0e99
  9. 29 7月, 2008 1 次提交
    • A
      Make use of stat.ctime configurable · 1ce4790b
      Alex Riesen 提交于
      A new configuration variable 'core.trustctime' is introduced to
      allow ignoring st_ctime information when checking if paths
      in the working tree has changed, because there are situations where
      it produces too much false positives.  Like when file system crawlers
      keep changing it when scanning and using the ctime for marking scanned
      files.
      
      The default is to notice ctime changes.
      Signed-off-by: NAlex Riesen <raa.lkml@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1ce4790b
  10. 28 7月, 2008 1 次提交
    • P
      git-mv: Keep moved index entries inact · 81dc2307
      Petr Baudis 提交于
      The rewrite of git-mv from a shell script to a builtin was perhaps
      a little too straightforward: the git add and git rm queues were
      emulated directly, which resulted in a rather complicated code and
      caused an inconsistent behaviour when moving dirty index entries;
      git mv would update the entry based on working tree state,
      except in case of overwrites, where the new entry would still have
      sha1 of the old file.
      
      This patch introduces rename_index_entry_at() into the index toolkit,
      which will rename an entry while removing any entries the new entry
      might render duplicate. This is then used in git mv instead
      of all the file queues, resulting in a major simplification
      of the code and an inevitable change in git mv -n output format.
      
      Also the code used to refuse renaming overwriting symlink with a regular
      file and vice versa; there is no need for that.
      
      A few new tests have been added to the testsuite to reflect this change.
      Signed-off-by: NPetr Baudis <pasky@suse.cz>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      81dc2307
  11. 21 7月, 2008 1 次提交
    • J
      "needs update" considered harmful · d14e7407
      Junio C Hamano 提交于
      "git update-index --refresh", "git reset" and "git add --refresh" have
      reported paths that have local modifications as "needs update" since the
      beginning of git.
      
      Although this is logically correct in that you need to update the index at
      that path before you can commit that change, it is now becoming more and
      more clear, especially with the continuous push for user friendliness
      since 1.5.0 series, that the message is suboptimal.  After all, the change
      may be something the user might want to get rid of, and "updating" would
      be absolutely a wrong thing to do if that is the case.
      
      I prepared two alternatives to solve this.  Both aim to reword the message
      to more neutral "locally modified".
      
      This patch is a more intrusive variant that changes the message for only
      Porcelain commands ("add" and "reset") while keeping the plumbing
      "update-index" intact.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      d14e7407
  12. 20 7月, 2008 1 次提交
  13. 15 7月, 2008 1 次提交
    • N
      restore legacy behavior for read_sha1_file() · ac939109
      Nicolas Pitre 提交于
      Since commit 8eca0b47, it is possible
      for read_sha1_file() to return NULL even with existing objects when they
      are corrupted.  Previously a corrupted object would have terminated the
      program immediately, effectively making read_sha1_file() return NULL
      only when specified object is not found.
      
      Let's restore this behavior for all users of read_sha1_file() and
      provide a separate function with the ability to not terminate when
      bad objects are encountered.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ac939109
  14. 01 7月, 2008 3 次提交
  15. 27 6月, 2008 2 次提交
  16. 26 6月, 2008 1 次提交
    • J
      clone: create intermediate directories of destination repo · 2beebd22
      Jeff King 提交于
      The shell version used to use "mkdir -p" to create the repo
      path, but the C version just calls "mkdir". Let's replicate
      the old behavior. We have to create the git and worktree
      leading dirs separately; while most of the time, the
      worktree dir contains the git dir (as .git), the user can
      override this using GIT_WORK_TREE.
      
      We can reuse safe_create_leading_directories, but we need to
      make a copy of our const buffer to do so. Since
      merge-recursive uses the same pattern, we can factor this
      out into a global function. This has two other cleanup
      advantages for merge-recursive:
      
        1. mkdir_p wasn't a very good name. "mkdir -p foo/bar" actually
           creates bar, but this function just creates the leading
           directories.
      
        2. mkdir_p took a mode argument, but it was completely
           ignored.
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2beebd22
  17. 25 6月, 2008 2 次提交
    • N
      optimize verify-pack a bit · 99093238
      Nicolas Pitre 提交于
      Using find_pack_entry_one() to get object offsets is rather suboptimal
      when nth_packed_object_offset() can be used directly.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      99093238
    • J
      clone: create intermediate directories of destination repo · 8e21d63b
      Jeff King 提交于
      The shell version used to use "mkdir -p" to create the repo
      path, but the C version just calls "mkdir". Let's replicate
      the old behavior. We have to create the git and worktree
      leading dirs separately; while most of the time, the
      worktree dir contains the git dir (as .git), the user can
      override this using GIT_WORK_TREE.
      
      We can reuse safe_create_leading_directories, but we need to
      make a copy of our const buffer to do so. Since
      merge-recursive uses the same pattern, we can factor this
      out into a global function. This has two other cleanup
      advantages for merge-recursive:
      
        1. mkdir_p wasn't a very good name. "mkdir -p foo/bar" actually
           creates bar, but this function just creates the leading
           directories.
      
        2. mkdir_p took a mode argument, but it was completely
           ignored.
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8e21d63b
  18. 24 6月, 2008 1 次提交
    • N
      implement some resilience against pack corruptions · 8eca0b47
      Nicolas Pitre 提交于
      We should be able to fall back to loose objects or alternative packs when
      a pack becomes corrupted.  This is especially true when an object exists
      in one pack only as a delta but its base object is corrupted.  Currently
      there is no way to retrieve the former object even if the later is
      available in another pack or loose.
      
      This patch allows for a delta to be resolved (with a performance cost)
      using a base object from a source other than the pack where that delta
      is located.  Same thing for non-delta objects: rather than failing
      outright, a search is made in other packs or used loose when the
      currently active pack has it but corrupted.
      
      Of course git will become extremely noisy with error messages when that
      happens.  However, if the operation succeeds nevertheless, a simple
      'git repack -a -f -d' will "fix" the corrupted repository given that all
      corrupted objects have a good duplicate somewhere in the object store,
      possibly manually copied from another source.
      Signed-off-by: NNicolas Pitre <nico@cam.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8eca0b47
  19. 23 6月, 2008 1 次提交
    • 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
  20. 20 6月, 2008 3 次提交
    • config.c: make git_env_bool() static · e4bffb5a
      しらいしななこ 提交于
      This function is not used by any other file.
      Signed-off-by: NNanako Shiraishi <nanako3@lavabit.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e4bffb5a
    • environment.c: remove unused function · 78d0f5d2
      しらいしななこ 提交于
      get_refs_directory() is not used anywhere.
      Signed-off-by: NNanako Shiraishi <nanako3@lavabit.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      78d0f5d2
    • L
      Make git_dir a path relative to work_tree in setup_work_tree() · 044bbbcb
      Linus Torvalds 提交于
      Once we find the absolute paths for git_dir and work_tree, we can make
      git_dir a relative path since we know pwd will be work_tree. This should
      save the kernel some time traversing the path to work_tree all the time
      if git_dir is inside work_tree.
      
      Daniel's patch didn't apply for me as-is, so I recreated it with some
      differences, and here are the numbers from ten runs each.
      
      There is some IO for me - probably due to more-or-less random flushing of
      the journal - so the variation is bigger than I'd like, but whatever:
      
      	Before:
      		real    0m8.135s
      		real    0m7.933s
      		real    0m8.080s
      		real    0m7.954s
      		real    0m7.949s
      		real    0m8.112s
      		real    0m7.934s
      		real    0m8.059s
      		real    0m7.979s
      		real    0m8.038s
      
      	After:
      		real    0m7.685s
      		real    0m7.968s
      		real    0m7.703s
      		real    0m7.850s
      		real    0m7.995s
      		real    0m7.817s
      		real    0m7.963s
      		real    0m7.955s
      		real    0m7.848s
      		real    0m7.969s
      
      Now, going by "best of ten" (on the assumption that the longer numbers
      are all due to IO), I'm saying a 7.933s -> 7.685s reduction, and it does
      seem to be outside of the noise (ie the "after" case never broke 8s, while
      the "before" case did so half the time).
      
      So looks like about 3% to me.
      
      Doing it for a slightly smaller test-case (just the "arch" subdirectory)
      gets more stable numbers probably due to not filling the journal with
      metadata updates, so we have:
      
      	Before:
      		real    0m1.633s
      		real    0m1.633s
      		real    0m1.633s
      		real    0m1.632s
      		real    0m1.632s
      		real    0m1.630s
      		real    0m1.634s
      		real    0m1.631s
      		real    0m1.632s
      		real    0m1.632s
      
      	After:
      		real    0m1.610s
      		real    0m1.609s
      		real    0m1.610s
      		real    0m1.608s
      		real    0m1.607s
      		real    0m1.610s
      		real    0m1.609s
      		real    0m1.611s
      		real    0m1.608s
      		real    0m1.611s
      
      where I'ld just take the averages and say 1.632 vs 1.610, which is just
      over 1% peformance improvement.
      
      So it's not in the noise, but it's not as big as I initially thought and
      measured.
      
      (That said, it obviously depends on how deep the working directory path is
      too, and whether it is behind NFS or something else that might need to
      cause more work to look up).
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      044bbbcb
  21. 19 6月, 2008 1 次提交
    • L
      Add config option to enable 'fsync()' of object files · aafe9fba
      Linus Torvalds 提交于
      As explained in the documentation[*] this is totally useless on
      filesystems that do ordered/journalled data writes, but it can be a
      useful safety feature on filesystems like HFS+ that only journal the
      metadata, not the actual file contents.
      
      It defaults to off, although we could presumably in theory some day
      auto-enable it on a per-filesystem basis.
      
      [*] Yes, I updated the docs for the thing.  Hell really _has_ frozen
          over, and the four horsemen are probably just beyond the horizon.
          EVERYBODY PANIC!
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      aafe9fba
  22. 17 6月, 2008 1 次提交
  23. 14 6月, 2008 1 次提交
  24. 07 6月, 2008 1 次提交
  25. 01 6月, 2008 1 次提交
  26. 24 5月, 2008 2 次提交
  27. 22 5月, 2008 1 次提交
  28. 16 5月, 2008 1 次提交
  29. 15 5月, 2008 1 次提交