[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Veryfing paths in the incoming pack

Hi!

I'm looking into ways of veryfing incoming pack. The requirement is to
scan incoming trees and reject the pack if certain path patterns are
present in one of the trees. What I'm looking for here is the way to
prevent people from pushing commits with certain file types (for
example - jar files).

Was browsing through jgit sources and I can see that there is a
org.eclipse.jgit.lib.ObjectChecker that I can set on the PackParser.
My idea was along those lines: subclass ObjectChecker  and override
the checkTree method. Am I on the right track here? I wonder if the
ObjectChecker  is a proper place to perform such paths-checks?

Alternativelly I was looking into the PreReceiveHook but my impression
is that this hook is called when all the object are alredy in the git
object database and the only thing I could do is to prevent updating a
ref.

Would be greteful if you could you advice the best method of filtering
file paths in the incoming pack?

Cheers,
Pawel Kozlowski

PS Thnx for the work done on the upcoming 1.2 release, the objects
size-checking saved my day :-)