1. 19 Nov, 2018 1 commit
  2. 29 Jun, 2018 2 commits
  3. 14 Mar, 2018 1 commit
  4. 13 Jun, 2017 1 commit
  5. 08 May, 2017 2 commits
  6. 01 Jun, 2015 1 commit
    • Jeff King's avatar
      add quieter versions of parse_{tree,commit} · 9cc2b07a
      Jeff King authored
      When we call parse_commit, it will complain to stderr if the
      object does not exist or cannot be read. This means that we
      may produce useless error messages if this situation is
      expected (e.g., because the object is marked UNINTERESTING,
      or because revs->ignore_missing_links is set).
      We can fix this by adding a new "parse_X_gently" form that
      takes a flag to suppress the messages. The existing
      "parse_X" form is already gentle in the sense that it
      returns an error rather than dying, and we could in theory
      just add a "quiet" flag to it (with existing callers passing
      "0"). But doing it this way means we do not have to disturb
      existing callers.
      Note also that the new flag is "quiet_on_missing", and not
      just "quiet". We could add a flag to suppress _all_ errors,
      but besides being a more invasive change (we would have to
      pass the flag down to sub-functions, too), there is a good
      reason not to: we would never want to use it. Missing a
      linked object is expected in some circumstances, but it is
      never expected to have a malformed commit, or to get a tree
      when we wanted a commit.  We should always complain about
      these corruptions.
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  7. 01 Dec, 2014 1 commit
  8. 15 Jul, 2013 1 commit
  9. 06 Jun, 2013 1 commit
    • Jeff King's avatar
      clear parsed flag when we free tree buffers · 6e454b9a
      Jeff King authored
      Many code paths will free a tree object's buffer and set it
      to NULL after finishing with it in order to keep memory
      usage down during a traversal. However, out of 8 sites that
      do this, only one actually unsets the "parsed" flag back.
      Those sites that don't are setting a trap for later users of
      the tree object; even after calling parse_tree, the buffer
      will remain NULL, causing potential segfaults.
      It is not known whether this is triggerable in the current
      code. Most commands do not do an in-memory traversal
      followed by actually using the objects again. However, it
      does not hurt to be safe for future callers.
      In most cases, we can abstract this out to a
      "free_tree_buffer" helper. However, there are two
        1. The fsck code relies on the parsed flag to know that we
           were able to parse the object at one point. We can
           switch this to using a flag in the "flags" field.
        2. The index-pack code sets the buffer to NULL but does
           not free it (it is freed by a caller). We should still
           unset the parsed flag here, but we cannot use our
           helper, as we do not want to free the buffer.
      Signed-off-by: default avatarJeff King <peff@peff.net>
      Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
  10. 25 Mar, 2011 1 commit
  11. 15 Jul, 2008 1 commit
  12. 30 May, 2006 5 commits
  13. 29 May, 2006 3 commits
    • Linus Torvalds's avatar
      Remove "tree->entries" tree-entry list from tree parser · 097dc3d8
      Linus Torvalds authored
      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: default avatarLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
    • Linus Torvalds's avatar
      Make "tree_entry" have a SHA1 instead of a union of object pointers · a755dfe4
      Linus Torvalds authored
      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: default avatarLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
    • Linus Torvalds's avatar
      Add raw tree buffer info to "struct tree" · d2eafb76
      Linus Torvalds authored
      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: default avatarLinus Torvalds <torvalds@osdl.org>
      Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
  14. 26 Jan, 2006 1 commit
  15. 05 Dec, 2005 1 commit
  16. 29 Nov, 2005 1 commit
    • Linus Torvalds's avatar
      ls-tree: major rewrite to do pathspec · 3c5e8468
      Linus Torvalds authored
      git-ls-tree should be rewritten to use a pathspec the same way everybody
      else does. Right now it's the odd man out: if you do
      	git-ls-tree HEAD divers/char drivers/
      it will show the same files _twice_, which is not how pathspecs in general
      How about this patch? It breaks some of the git-ls-tree tests, but it
      makes git-ls-tree work a lot more like other git pathspec commands, and it
      removes more than 150 lines by re-using the recursive tree traversal (but
      the "-d" flag is gone for good, so I'm not pushing this too hard).
  17. 11 Sep, 2005 1 commit
  18. 03 Aug, 2005 1 commit
  19. 28 Jul, 2005 1 commit
  20. 08 Jun, 2005 1 commit
  21. 29 May, 2005 1 commit
    • Junio C Hamano's avatar
      [PATCH] Rewrite ls-tree to behave more like "/bin/ls -a" · 6af1f019
      Junio C Hamano authored
      This is a complete rewrite of ls-tree to make it behave more
      like what "/bin/ls -a" does in the current working directory.
      Namely, the changes are:
       - Unlike the old ls-tree behaviour that used paths arguments to
         restrict output (not that it worked as intended---as pointed
         out in the mailing list discussion, it was quite incoherent),
         this rewrite uses paths arguments to specify what to show.
       - Without arguments, it implicitly uses the root level as its
         sole argument ("/bin/ls -a" behaves as if "." is given
         without argument).
       - Without -r (recursive) flag, it shows the named blob (either
         file or symlink), or the named tree and its immediate
       - With -r flag, it shows the named path, and recursively
         descends into it if it is a tree.
       - With -d flag, it shows the named path and does not show its
         children even if the path is a tree, nor descends into it
      This is still request-for-comments patch.  There is no mailing
      list consensus that this proposed new behaviour is a good one.
      The patch to t/t3100-ls-tree-restrict.sh illustrates
      user-visible behaviour changes.  Namely:
       * "git-ls-tree $tree path1 path0" lists path1 first and then
         path0.  It used to use paths as an output restrictor and
         showed output in cache entry order (i.e. path0 first and then
         path1) regardless of the order of paths arguments.
       * "git-ls-tree $tree path2" lists path2 and its immediate
         children but having explicit paths argument does not imply
         recursive behaviour anymore, hence paths/baz is shown but not
      Signed-off-by: default avatarJunio C Hamano <junkio@cox.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
  22. 06 May, 2005 1 commit
    • Nicolas Pitre's avatar
      [PATCH] don't load and decompress objects twice with parse_object() · bd2c39f5
      Nicolas Pitre authored
      It turns out that parse_object() is loading and decompressing given
      object to free it just before calling the specific object parsing
      function which does mmap and decompress the same object again. This
      patch introduces the ability to parse specific objects directly from a
      memory buffer.
      Without this patch, running git-fsck-cache on the kernel repositorytake:
      	real    0m13.006s
      	user    0m11.421s
      	sys     0m1.218s
      With this patch applied:
      	real    0m8.060s
      	user    0m7.071s
      	sys     0m0.710s
      The performance increase is significant, and this is kind of a
      prerequisite for sane delta object support with fsck.
      Signed-off-by: default avatarNicolas Pitre <nico@cam.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
  23. 05 May, 2005 1 commit
    • Linus Torvalds's avatar
      Be more careful about tree entry modes. · 42ea9cb2
      Linus Torvalds authored
      The tree object parsing used to get the executable bit wrong,
      and didn't know about symlinks. Also, fsck really wants the
      full mode value so that it can verify the other bits for sanity,
      so save it all in struct tree_entry.
  24. 02 May, 2005 1 commit
    • Linus Torvalds's avatar
      Make fsck-cache do better tree checking. · 85003492
      Linus Torvalds authored
      We check the ordering of the entries, and we verify that none
      of the entries has a slash in it (this allows us to remove the
      hacky "has_full_path" member from the tree structure, since we
      now just test it by walking the tree entries instead).
  25. 24 Apr, 2005 1 commit
  26. 18 Apr, 2005 1 commit