1. 29 7月, 2006 1 次提交
  2. 17 7月, 2006 1 次提交
  3. 10 7月, 2006 1 次提交
    • S
      Avoid C99 initializers · 344c52ae
      Shawn Pearce 提交于
      In a handful places, we use C99 structure and array
      initializers, which some compilers do not support.
      
      This can be handy when you are trying to compile GIT on a
      Solaris system that has an older C compiler, for example.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      344c52ae
  4. 08 7月, 2006 1 次提交
  5. 19 6月, 2006 1 次提交
  6. 07 6月, 2006 1 次提交
  7. 06 6月, 2006 1 次提交
  8. 04 6月, 2006 2 次提交
    • J
      Fix earlier mismerges. · b266b123
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b266b123
    • J
      read-tree --reset: update working tree file for conflicted paths. · b0d6e646
      Junio C Hamano 提交于
      The earlier "git reset --hard" simplification stopped removing
      leftover working tree files from a failed automerge, when
      switching back to the HEAD version that does not have the
      paths.
      
      This patch, instead of removing the unmerged paths from the
      index, drops them down to stage#0 but marks them with mode=0
      (the same "to be deleted" marker we internally use for paths
      deleted by the merge).  one_way_merge() function and the
      functions it calls already know what to do with them -- if the
      tree we are reading has the path the working tree file is
      overwritten, and if it doesn't the working tree file is
      removed.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b0d6e646
  9. 31 5月, 2006 1 次提交
    • L
      tree_entry(): new tree-walking helper function · 4c068a98
      Linus Torvalds 提交于
      This adds a "tree_entry()" function that combines the common operation of
      doing a "tree_entry_extract()" + "update_tree_entry()".
      
      It also has a simplified calling convention, designed for simple loops
      that traverse over a whole tree: the arguments are pointers to the tree
      descriptor and a name_entry structure to fill in, and it returns a boolean
      "true" if there was an entry left to be gotten in the tree.
      
      This allows tree traversal with
      
      	struct tree_desc desc;
      	struct name_entry entry;
      
      	desc.buf = tree->buffer;
      	desc.size = tree->size;
      	while (tree_entry(&desc, &entry) {
      		... use "entry.{path, sha1, mode, pathlen}" ...
      	}
      
      which is not only shorter than writing it out in full, it's hopefully less
      error prone too.
      
      [ It's actually a tad faster too - we don't need to recalculate the entry
        pathlength in both extract and update, but need to do it only once.
        Also, some callers can avoid doing a "strlen()" on the result, since
        it's returned as part of the name_entry structure.
      
        However, by now we're talking just 1% speedup on "git-rev-list --objects
        --all", and we're definitely at the point where tree walking is no
        longer the issue any more. ]
      
      NOTE! Not everybody wants to use this new helper function, since some of
      the tree walkers very much on purpose do the descriptor update separately
      from the entry extraction. So the "extract + update" sequence still
      remains as the core sequence, this is just a simplified interface.
      
      We should probably add a silly two-line inline helper function for
      initializing the descriptor from the "struct tree" too, just to cut down
      on the noise from that common "desc" initializer.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      4c068a98
  10. 30 5月, 2006 6 次提交
  11. 29 5月, 2006 3 次提交
    • L
      Remove "tree->entries" tree-entry list from tree parser · 097dc3d8
      Linus Torvalds 提交于
      This finally removes the tree-entry list from "struct tree", since most of
      the users can just use the tree-walk infrastructure to walk the raw tree
      buffers instead of the tree-entry list.
      
      The tree-entry list is inefficient, and generates tons of small
      allocations for no good reason. The tree-walk infrastructure is generally
      no harder to use than following a linked list, and allows us to do most
      tree parsing in-place.
      
      Some programs still use the old tree-entry lists, and are a bit painful to
      convert without major surgery. For them we have a helper function that
      creates a temporary tree-entry list on demand. We can convert those too
      eventually, but with this they no longer affect any users who don't need
      the explicit lists.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      097dc3d8
    • L
      Make "tree_entry" have a SHA1 instead of a union of object pointers · a755dfe4
      Linus Torvalds 提交于
      This is preparatory work for further cleanups, where we try to make
      tree_entry look more like the more efficient tree-walk descriptor.
      
      Instead of having a union of pointers to blob/tree/objects, this just
      makes "struct tree_entry" have the raw SHA1, and makes all the users use
      that instead (often that implies adding a "lookup_tree(..)" on the sha1,
      but sometimes the user just wanted the SHA1 in the first place, and it
      just avoids an unnecessary indirection).
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      a755dfe4
    • L
      Add raw tree buffer info to "struct tree" · d2eafb76
      Linus Torvalds 提交于
      This allows us to avoid allocating information for names etc, because
      we can just use the information from the tree buffer directly.
      
      We still keep the old "tree_entry_list" in struct tree as well, so old
      users aren't affected, apart from the fact that the allocations are
      different (if you free a tree entry, you should no longer free the name
      allocation for it, since it's allocated as part of "tree->buffer")
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d2eafb76
  12. 24 5月, 2006 1 次提交
  13. 17 5月, 2006 2 次提交
  14. 16 5月, 2006 1 次提交
  15. 15 5月, 2006 2 次提交
    • J
      read-tree -u one-way merge fix to check out locally modified paths. · 613f0273
      Junio C Hamano 提交于
      The "-u" flag means "update the working tree files", but to
      other types of merges, it also implies "I want to keep my local
      changes" -- because they prevent local changes from getting lost
      by using verify_uptodate.  The one-way merge is different from
      other merges in that its purpose is opposite of doing something
      else while keeping unrelated local changes.  The point of
      one-way merge is to nuke local changes.  So while it feels
      somewhat wrong that this actively loses local changes, it is the
      right thing to do.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      613f0273
    • L
      Allow one-way tree merge to remove old files · 76b99b81
      Linus Torvalds 提交于
      For some random reason (probably just because nobody noticed), the one-way
      merge strategy didn't mark deleted files as deleted, so if you used
      
      	git-read-tree -m -u <newtree>
      
      it would update the files that got changed in the index, but it would not
      delete the files that got deleted.
      
      This should fix it, and I can't imagine that anybody depends on the old
      strange "update only existing files" behaviour.
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      76b99b81
  16. 09 5月, 2006 1 次提交
  17. 08 5月, 2006 1 次提交
  18. 04 5月, 2006 1 次提交
  19. 02 5月, 2006 1 次提交
    • J
      read-tree: --prefix=<path>/ option. · f4c6f2d3
      Junio C Hamano 提交于
      With "--prefix=<path>/" option, read-tree keeps the current
      index contents, and reads the contents of named tree-ish under
      directory at `<prefix>`.  The original index file cannot have
      anything at the path `<prefix>` itself, and have nothing in
      `<prefix>/` directory.  This can be used to graft an
      independent tree into a subdirectory of the current index.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      f4c6f2d3
  20. 27 4月, 2006 2 次提交
    • J
      read-tree: teach 1-way merege and plain read to prime cache-tree. · 7927a55d
      Junio C Hamano 提交于
      This teaches read-tree to fully populate valid cache-tree when
      reading a tree from scratch, or reading a single tree into an
      existing index, reusing only the cached stat information (i.e.
      one-way merge).  We have already taught update-index about cache-tree,
      so "git checkout" followed by updates to a few path followed by
      a "git commit" would become very efficient.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      7927a55d
    • J
      read-tree: teach 1 and 2 way merges about cache-tree. · b34c39cf
      Junio C Hamano 提交于
      This teaches one-way and two-way "read-tree -m" (and its special
      form, "read-tree --reset" as well) not to discard cache-tree but
      invalidate only the changed parts of the tree.  When switching
      between related branches, this helps the eventual commit
      (i.e. write-tree) by keeping cache-tree valid as much as
      possible.
      
      This does not prime cache-tree yet, but we ought to be able to
      do that for no-merge (i.e. reading from a tree object) case and,
      and also perhaps 1 way merge case.
      
      With this patch applied, switching between the tip of Linux 2.6
      kernel tree and a branch that touches one path (fs/ext3/Makefile)
      from it invalidates only 3 paths out of 1201 cache-tree entries
      in the index, and subsequent write-tree takes about a half as
      much time as before.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      b34c39cf
  21. 25 4月, 2006 1 次提交
  22. 04 4月, 2006 2 次提交
  23. 24 3月, 2006 1 次提交
  24. 05 3月, 2006 1 次提交
  25. 02 3月, 2006 2 次提交
  26. 23 2月, 2006 2 次提交