git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [JGIT PATCH 00/14] TreeWalk D/F conflict detection
@ 2008-08-19 22:51 Shawn O. Pearce
  2008-08-19 22:51 ` [JGIT PATCH] Support path names longer than 4095 bytes in DirCache Shawn O. Pearce
  2008-08-19 22:54 ` [JGIT PATCH 00/14] TreeWalk D/F conflict detection Shawn O. Pearce
  0 siblings, 2 replies; 6+ messages in thread
From: Shawn O. Pearce @ 2008-08-19 22:51 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git

This series is about fixing the "mistake" in Git trees where
subtrees sort as through their name is "path/" and not "path".

Within a TreeWalk this is a problem because the tree contents:

    Tree 1     Tree 2
  ------------------------
    100644 a
               100644 a.c
               040000 a
    100644 b

needs to merge together both "a" paths from tree 1 and tree 2, but
these appear at different points in time when we merge-sort the two
trees together.

We use an infinite look-ahead and look-behind to identify these cases
and make the iteration look like this instead:

    Tree 1     Tree 2
  ------------------------
    100644 a   040000 a
               100644 a.c
    100644 b

which allows the application to handle the D/F conflict in a single
step, even though the contents of "a" may now be out-of-order within
the DirCache.  Fortunately DirCacheBuilder can automatically fix this
sort of ordering problem.


Shawn O. Pearce (14):
  Detect path names which overflow the name length field in the index
  Fix NB.decodeUInt16 to correctly handle the high byte
  Add test cases for NB.encode and NB.decode family of routines
  Fix DirCache's skip over null byte padding when reading a DIRC file
  Fix usage of assertEquals in DirCacheIteratorTest
  Refactor AbstractTreeIterator.pathCompare to force another mode
  Micro-optimize AbstractTreeIterator.pathCompare
  Optimize path comparsion within subtrees during TreeWalk
  Refactor AbstractTreeIterator semantics to start on first entry
  Make all AbstractTreeIterator implementations bi-directional
  Expose beginning of iterator indication from AbstractTreeIterator
  Allow application code to set ObjectIds in DirCacheEntry
  Create NameConflictTreeWalk to transparently detect D/F conflicts
  Add test case for NameConflictTreeWalk

 .../spearce/egit/core/ContainerTreeIterator.java   |    9 +-
 .../jgit/dircache/DirCacheBuilderIteratorTest.java |    2 +-
 .../jgit/dircache/DirCacheIteratorTest.java        |   28 +-
 .../jgit/treewalk/CanonicalTreeParserTest.java     |  261 ++++++++++++++++
 .../jgit/treewalk/NameConflictTreeWalkTest.java    |  205 ++++++++++++
 .../tst/org/spearce/jgit/util/NBTest.java          |  328 ++++++++++++++++++++
 .../src/org/spearce/jgit/dircache/DirCache.java    |    2 +-
 .../jgit/dircache/DirCacheBuildIterator.java       |    9 +-
 .../org/spearce/jgit/dircache/DirCacheEntry.java   |   41 +++-
 .../spearce/jgit/dircache/DirCacheIterator.java    |   84 +++--
 .../jgit/treewalk/AbstractTreeIterator.java        |  129 +++++---
 .../spearce/jgit/treewalk/CanonicalTreeParser.java |   94 +++++-
 .../spearce/jgit/treewalk/EmptyTreeIterator.java   |   12 +-
 .../spearce/jgit/treewalk/FileTreeIterator.java    |    5 +-
 .../jgit/treewalk/NameConflictTreeWalk.java        |  237 ++++++++++++++
 .../src/org/spearce/jgit/treewalk/TreeWalk.java    |   18 +-
 .../spearce/jgit/treewalk/WorkingTreeIterator.java |  132 ++++-----
 org.spearce.jgit/src/org/spearce/jgit/util/NB.java |   29 ++-
 18 files changed, 1418 insertions(+), 207 deletions(-)
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/treewalk/CanonicalTreeParserTest.java
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/treewalk/NameConflictTreeWalkTest.java
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/util/NBTest.java
 create mode 100644 org.spearce.jgit/src/org/spearce/jgit/treewalk/NameConflictTreeWalk.java

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [JGIT PATCH 00/14] TreeWalk D/F conflict detection
@ 2008-08-18 23:53 Shawn O. Pearce
  2008-08-19  8:52 ` David Woodhouse
  0 siblings, 1 reply; 6+ messages in thread
From: Shawn O. Pearce @ 2008-08-18 23:53 UTC (permalink / raw)
  To: Robin Rosenberg; +Cc: git

This series is about fixing the "mistake" in Git trees where
subtrees sort as through their name is "path/" and not "path".

Within a TreeWalk this is a problem because the tree contents:

    Tree 1     Tree 2
  ------------------------
    100644 a
               100644 a.c
               040000 a
    100644 b

needs to merge together both "a" paths from tree 1 and tree 2, but
these appear at different points in time when we merge-sort the two
trees together.

We use an infinite look-ahead and look-behind to identify these cases
and make the iteration look like this instead:

    Tree 1     Tree 2
  ------------------------
    100644 a   040000 a
               100644 a.c
    100644 b

which allows the application to handle the D/F conflict in a single
step, even though the contents of "a" may now be out-of-order within
the DirCache.  Fortunately DirCacheBuilder can automatically fix this
sort of ordering problem.


Shawn O. Pearce (14):
  Detect path names which overflow the name length field in the index
  Fix NB.decodeUInt16 to correctly handle the high byte
  Add test cases for NB.encode and NB.decode family of routines
  Fix DirCache's skip over null byte padding when reading a DIRC file
  Fix usage of assertEquals in DirCacheIteratorTest
  Refactor AbstractTreeIterator.pathCompare to force another mode
  Micro-optimize AbstractTreeIterator.pathCompare
  Optimize path comparsion within subtrees during TreeWalk
  Refactor AbstractTreeIterator semantics to start on first entry
  Make all AbstractTreeIterator implementations bi-directional
  Expose beginning of iterator indication from AbstractTreeIterator
  Allow application code to set ObjectIds in DirCacheEntry
  Create NameConflictTreeWalk to transparently detect D/F conflicts
  Add test case for NameConflictTreeWalk

 .../spearce/egit/core/ContainerTreeIterator.java   |    9 +-
 .../jgit/dircache/DirCacheBuilderIteratorTest.java |    2 +-
 .../jgit/dircache/DirCacheIteratorTest.java        |   28 +-
 .../jgit/treewalk/CanonicalTreeParserTest.java     |  261 ++++++++++++++++
 .../jgit/treewalk/NameConflictTreeWalkTest.java    |  205 ++++++++++++
 .../tst/org/spearce/jgit/util/NBTest.java          |  328 ++++++++++++++++++++
 .../src/org/spearce/jgit/dircache/DirCache.java    |    2 +-
 .../jgit/dircache/DirCacheBuildIterator.java       |    9 +-
 .../org/spearce/jgit/dircache/DirCacheEntry.java   |   41 +++-
 .../spearce/jgit/dircache/DirCacheIterator.java    |   84 +++--
 .../jgit/treewalk/AbstractTreeIterator.java        |  129 +++++---
 .../spearce/jgit/treewalk/CanonicalTreeParser.java |   94 +++++-
 .../spearce/jgit/treewalk/EmptyTreeIterator.java   |   12 +-
 .../spearce/jgit/treewalk/FileTreeIterator.java    |    5 +-
 .../jgit/treewalk/NameConflictTreeWalk.java        |  237 ++++++++++++++
 .../src/org/spearce/jgit/treewalk/TreeWalk.java    |   18 +-
 .../spearce/jgit/treewalk/WorkingTreeIterator.java |  132 ++++-----
 org.spearce.jgit/src/org/spearce/jgit/util/NB.java |   29 ++-
 18 files changed, 1418 insertions(+), 207 deletions(-)
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/treewalk/CanonicalTreeParserTest.java
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/treewalk/NameConflictTreeWalkTest.java
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/util/NBTest.java
 create mode 100644 org.spearce.jgit/src/org/spearce/jgit/treewalk/NameConflictTreeWalk.java

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-08-19 22:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 22:51 [JGIT PATCH 00/14] TreeWalk D/F conflict detection Shawn O. Pearce
2008-08-19 22:51 ` [JGIT PATCH] Support path names longer than 4095 bytes in DirCache Shawn O. Pearce
2008-08-19 22:54 ` [JGIT PATCH 00/14] TreeWalk D/F conflict detection Shawn O. Pearce
  -- strict thread matches above, loose matches on Subject: below --
2008-08-18 23:53 Shawn O. Pearce
2008-08-19  8:52 ` David Woodhouse
2008-08-19 14:24   ` Shawn O. Pearce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).