]> source.dussan.org Git - jgit.git/commit
Add support for built-in clean filters 82/71982/11
authorChristian Halstrick <christian.halstrick@sap.com>
Mon, 2 May 2016 13:24:26 +0000 (15:24 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 20 Sep 2016 07:57:48 +0000 (09:57 +0200)
commitb5bec73715e28cac6a08c98ec1499f02e6095cfc
tree7baacb466ca924fbd98db9915d58b6b2b86840de
parent9d4ffcc1ab28de54c3919ce7aced3e891d125a2c
Add support for built-in clean filters

JGit supports clean filters defined in repository configuration. The
filters are implemented as external programs filtering content by
accepting the original content (as seen in the working tree) on stdin
and which emit the filtered content on stdout. To run such a filter JGit
has to start an external process and pump data into/from this process.

This commit adds support for clean filters which are implemented
in Java and which are executed by jgit's main thread. When a filter is
defined in the configuration as
"jgit://builtin/<filterDriverName>/clean" then JGit will lookup in a
static map whether a filter is registered under this name. If found
such a filter is called to do the filtering.

The functionality in this commit requires that a program using JGit
explicitly calls the JGit API to register built-in implementations for
specific clean filters. In follow-up commits configuration parameters
will be added which trigger such registrations. Other commits will add
implementations for lfs filters.

Change-Id: I0344d3c54801c9a46e5a606c5df17e5f2e17b2be
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/FilterCommandsTest.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommand.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandFactory.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/attributes/FilterCommandRegistry.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java