denio7 / egit

Automatically exported from code.google.com/p/egit
0 stars 0 forks source link

History simplification bug with path limiting #46

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Perforoming a path-limited log from
4015412e7c7fb9a71a0a13060dfd0254e1b7e9dc in the egit repository with
org.spearce.jgit/src/org/spearce/jgit/revwalk/filter yields different
results with jgit and C git.

$ ./jgit log -- org.spearce.jgit/src/org/spearce/jgit/revwalk/filter|grep
^commit
commit 53a2cc3f6144ddcc10954d3abf68a5b90ed95248
commit d33979a3f4dc2ba38995a92804433d64c059ac9f
commit 5df542d766f54cfe0b94022235b63f201c7f103c
commit 1e64ada290fe7f8c44c194180cdeea1f9c9dbddb

$ git log -- org.spearce.jgit/src/org/spearce/jgit/revwalk/filter|grep
^commit
commit 53a2cc3f6144ddcc10954d3abf68a5b90ed95248
commit d33979a3f4dc2ba38995a92804433d64c059ac9f
commit 5df542d766f54cfe0b94022235b63f201c7f103c
commit 1e64ada290fe7f8c44c194180cdeea1f9c9dbddb
commit dec665dd29232700c399ae70f980e41cb81b1ebd
commit 3fef352d0da070611e7b91d2bc04934b29a630d2
commit e29fa468e8488660d64644a34510e87db012df44
commit 0db8ce97500cee152d98a6b28377564d778d0ebc
commit d3d48592d2f74b464baa281c2bbe8708471bd82f
commit 043586808cc74047de71088e9968e135bb5a5bc3
commit 80e4d15045c6fe69da4c53e56d47e36ff0849cf9

Original issue reported on code.google.com by robin.ro...@gmail.com on 18 Nov 2008 at 8:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Original comment by robin.ro...@gmail.com on 24 Nov 2008 at 11:48

GoogleCodeExporter commented 8 years ago
This is a fairly useful optimization in git.  Most people use it,
because most people don't pass "--full-history" when they run
"git log -- path".  So I think we really want to do it by default
in jgit.

Enabling this optimization again probably requires adding a new
method to TreeFilter which allows the filter graph to return only
nodes which select paths by name, and then do something like:

  else if (chgs == adds && isPathSetEmpty(c.getTree())) {
    c.parents = RevCommit.NO_PARENTS;
    return true;
  }

where isPathSetEmpty runs a second TreeWalk iteration but uses the
new (smaller) filter graph that only matches on paths.

I'm not going to write that out today.  But I thought I'd at least
write an email while the idea was fresh in my head.

Original comment by sop+code@google.com on 25 Nov 2008 at 12:14

GoogleCodeExporter commented 8 years ago

Original comment by robin.ro...@gmail.com on 26 Nov 2008 at 8:15