1. 09 3月, 2008 2 次提交
  2. 23 2月, 2008 1 次提交
  3. 22 2月, 2008 1 次提交
  4. 10 2月, 2008 1 次提交
  5. 22 1月, 2008 1 次提交
    • L
      Make on-disk index representation separate from in-core one · 7a51ed66
      Linus Torvalds 提交于
      This converts the index explicitly on read and write to its on-disk
      format, allowing the in-core format to contain more flags, and be
      simpler.
      
      In particular, the in-core format is now host-endian (as opposed to the
      on-disk one that is network endian in order to be able to be shared
      across machines) and as a result we can dispense with all the
      htonl/ntohl on accesses to the cache_entry fields.
      
      This will make it easier to make use of various temporary flags that do
      not exist in the on-disk format.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7a51ed66
  6. 17 1月, 2008 1 次提交
  7. 17 8月, 2007 1 次提交
  8. 16 8月, 2007 1 次提交
  9. 10 8月, 2007 1 次提交
    • L
      Start moving unpack-trees to "struct tree_desc" · 933bf40a
      Linus Torvalds 提交于
      This doesn't actually change any real code, but it changes the interface
      to unpack_trees() to take an array of "struct tree_desc" entries, the same
      way the tree-walk.c functions do.
      
      The reason for this is that we would be much better off if we can do the
      tree-unpacking using the generic "traverse_trees()" functionality instead
      of having to the special "unpack" infrastructure.
      
      This really is a pretty minimal diff, just to change the calling
      convention. It passes all the tests, and looks sane. There were only two
      users of "unpack_trees()": builtin-read-tree and merge-recursive, and I
      tried to keep the changes minimal.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      933bf40a
  10. 03 8月, 2007 1 次提交
  11. 17 6月, 2007 1 次提交
  12. 04 4月, 2007 3 次提交
    • J
      Fix read-tree --prefix=dir/. · 2960a1d9
      Junio C Hamano 提交于
      The existing code is not wrong per-se, but it started scanning the index
      from a location that does not match the tree being read, and wasted
      cycles.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      2960a1d9
    • J
      git-read-tree --index-output=<file> · 5e7f56ac
      Junio C Hamano 提交于
      This corrects the interface mistake of the previous one, and
      gives a command line parameter to the only plumbing command that
      currently needs it: "git-read-tree".
      
      We can add the calls to set_alternate_index_output() to other
      plumbing commands that update the index if/when needed.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      5e7f56ac
    • J
      _GIT_INDEX_OUTPUT: allow plumbing to output to an alternative index file. · 30ca07a2
      Junio C Hamano 提交于
      When defined, this allows plumbing commands that update the
      index (add, apply, checkout-index, merge-recursive, mv,
      read-tree, rm, update-index, and write-tree) to write their
      resulting index to an alternative index file while holding a
      lock to the original index file.  With this, git-commit that
      jumps the index does not have to make an extra copy of the index
      file, and more importantly, it can do the update while holding
      the lock on the index.
      
      However, I think the interface to let an environment variable
      specify the output is a mistake, as shown in the documentation.
      If a curious user has the environment variable set to something
      other than the file GIT_INDEX_FILE points at, almost everything
      will break.  This should instead be a command line parameter to
      tell these plumbing commands to write the result in the named
      file, to prevent stupid mistakes.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      30ca07a2
  13. 28 3月, 2007 1 次提交
  14. 22 3月, 2007 1 次提交
  15. 21 2月, 2007 1 次提交
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      This mechanically converts strncmp() to use prefixcmp(), but only when
      the parameters match specific patterns, so that they can be verified
      easily.  Leftover from this will be fixed in a separate step, including
      idiotic conversions like
      
          if (!strncmp("foo", arg, 3))
      
        =>
      
          if (!(-prefixcmp(arg, "foo")))
      
      This was done by using this script in px.perl
      
         #!/usr/bin/perl -i.bak -p
         if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
                 s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
         }
         if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
                 s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
         }
      
      and running:
      
         $ git grep -l strncmp -- '*.c' | xargs perl px.perl
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cc44c765
  16. 06 12月, 2006 2 次提交
  17. 24 8月, 2006 1 次提交
    • S
      Convert memcpy(a,b,20) to hashcpy(a,b). · e702496e
      Shawn Pearce 提交于
      This abstracts away the size of the hash values when copying them
      from memory location to memory location, much as the introduction
      of hashcmp abstracted away hash value comparsion.
      
      A few call sites were using char* rather than unsigned char* so
      I added the cast rather than open hashcpy to be void*.  This is a
      reasonable tradeoff as most call sites already use unsigned char*
      and the existing hashcmp is also declared to be unsigned char*.
      
      [jc: Splitted the patch to "master" part, to be followed by a
       patch for merge-recursive.c which is not in "master" yet.
      
       Fixed the cast in the latter hunk to combine-diff.c which was
       wrong in the original.
      
       Also converted ones left-over in combine-diff.c, diff-lib.c and
       upload-pack.c ]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      e702496e
  18. 16 8月, 2006 1 次提交
  19. 13 8月, 2006 1 次提交
    • J
      Better error message when we are unable to lock the index file · 40aaae88
      Junio C Hamano 提交于
      Most of the callers except the one in refs.c use the function to
      update the index file.  Among the index writers, everybody
      except write-tree dies if they cannot open it for writing.
      
      This gives the function an extra argument, to tell it to die
      when it cannot create a new file as the lockfile.
      
      The only caller that does not have to die is write-tree, because
      updating the index for the cache-tree part is optional and not
      being able to do so does not affect the correctness.  I think we
      do not have to be so careful and make the failure into die() the
      same way as other callers, but that would be a different patch.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      40aaae88
  20. 04 8月, 2006 1 次提交
  21. 31 7月, 2006 2 次提交
  22. 29 7月, 2006 1 次提交
  23. 17 7月, 2006 1 次提交
  24. 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
  25. 08 7月, 2006 1 次提交
  26. 19 6月, 2006 1 次提交
  27. 07 6月, 2006 1 次提交
  28. 06 6月, 2006 1 次提交
  29. 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
  30. 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
  31. 30 5月, 2006 4 次提交