1. 09 Mar, 2008 3 commits
  2. 02 Dec, 2007 1 commit
    • Junio C Hamano's avatar
      rename: Break filepairs with different types. · b45563a2
      Junio C Hamano authored
      When we consider if a path has been totally rewritten, we did not
      touch changes from symlinks to files or vice versa.  But a change
      that modifies even the type of a blob surely should count as a
      complete rewrite.
      
      While we are at it, modernise diffcore-break to be aware of gitlinks (we
      do not want to touch them).
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      b45563a2
  3. 17 Nov, 2007 1 commit
    • Linus Torvalds's avatar
      Fix rev-list when showing objects involving submodules · 481f0ee6
      Linus Torvalds authored
      The function mark_tree_uninteresting() assumed that the tree entries
      are blob when they are not trees.  This is not so.  Since we do
      not traverse into submodules (yet), the gitlinks should be ignored.
      
      In general, we should try to start moving away from using the
      "S_ISLNK()" like things for internal git state. It was a mistake to
      just assume the numbers all were same across all systems in the first
      place.  This implementation converts to the "object_type", and then
      uses a case statement.
      
      Noticed by Ilari on IRC.
      Test script taken from an earlier version by Dscho.
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      481f0ee6
  4. 14 Nov, 2007 1 commit
    • Linus Torvalds's avatar
      Fix rev-list when showing objects involving submodules · 4d1012c3
      Linus Torvalds authored
      The function mark_tree_uninteresting() assumed that the tree entries
      are blob when they are not trees.  This is not so.  Since we do
      not traverse into submodules (yet), the gitlinks should be ignored.
      
      In general, we should try to start moving away from using the
      "S_ISLNK()" like things for internal git state. It was a mistake to
      just assume the numbers all were same across all systems in the first
      place.  This implementation converts to the "object_type", and then
      uses a case statement.
      
      Noticed by Ilari on IRC.
      Test script taken from an earlier version by Dscho.
      Signed-off-by: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      4d1012c3
  5. 23 Jun, 2007 1 commit
  6. 13 May, 2007 1 commit
  7. 21 Mar, 2007 3 commits
  8. 18 Mar, 2007 1 commit
    • Linus Torvalds's avatar
      Avoid unnecessary strlen() calls · 304de2d2
      Linus Torvalds authored
      This is a micro-optimization that grew out of the mailing list discussion
      about "strlen()" showing up in profiles.
      
      We used to pass regular C strings around to the low-level tree walking
      routines, and while this worked fine, it meant that we needed to call
      strlen() on strings that the caller always actually knew the size of
      anyway.
      
      So pass the length of the string down wih the string, and avoid
      unnecessary calls to strlen(). Also, when extracting a pathname from a
      tree entry, use "tree_entry_len()" instead of strlen(), since the length
      of the pathname is directly calculable from the decoded tree entry itself
      without having to actually do another strlen().
      
      This shaves off another ~5-10% from some loads that are very tree
      intensive (notably doing commit filtering by a pathspec).
      
      Signed-off-by: Linus Torvalds  <[email protected]>"
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      304de2d2
  9. 31 May, 2006 1 commit
    • Linus Torvalds's avatar
      tree_entry(): new tree-walking helper function · 4c068a98
      Linus Torvalds authored
      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: default avatarLinus Torvalds <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      4c068a98
  10. 19 Apr, 2006 1 commit
  11. 30 Mar, 2006 1 commit
    • Junio C Hamano's avatar
      tree/diff header cleanup. · 1b0c7174
      Junio C Hamano authored
      Introduce tree-walk.[ch] and move "struct tree_desc" and
      associated functions from various places.
      
      Rename DIFF_FILE_CANON_MODE(mode) macro to canon_mode(mode) and
      move it to cache.h.  This macro returns the canonicalized
      st_mode value in the host byte order for files, symlinks and
      directories -- to be compared with a tree_desc entry.
      create_ce_mode(mode) in cache.h is similar but is intended to be
      used for index entries (so it does not work for directories) and
      returns the value in the network byte order.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      1b0c7174