Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Change 59345 in jgit/jgit[master]: bug 342372 - Patch adding end-of-line-conversion using .gita...

On Tue, Nov 10, 2015 at 1:25 PM, Ivan Motsch
<Ivan.Motsch@xxxxxxxxxxxxxxxx> wrote:
> Thanks for the comments.
>
> Let me just justify one topic you mentioned:
>>>> I am not sure whether we really need .git* file listeners. Up to know we had no performance problems checking config/gitattribute files once in the beginning of at git command.
>
> When doing a checkout of  a branch, the .gitattributes are not yet in the working tree (but in dir cache).
> So the file detection would be used there in order to incrementally and correctly checkout text files / binaries.
>
> Question 1: Does Arthurs patch collect the .gitattributes from the dir-cache BEFORE the files are actually checked out?
> If yes, then you're right, I will not need a file detection in the tree since then the .gitattributes are already collected.

As usual we want to traverse the trees only once. So during checkout
(in CheckoutCommand.java) we have a TreeWalk which walks over (HEAD,
index, working-tree, merge=tree-of the-commit-to-be-checked-out). So
we are looking at 4 different states for each path. We need to do that
anyhow to detect checkout conflicts, skip pathes where
HEAD==newCommit, etc. I think that such a walk should have enough
information detect for every path effective attributes and
configuration.
To answer your question: The treewalk in Arturs change collects
attributes before the new index is written. But the treewalk knows
also the tree to be checked out and knows from there the gitattributes
which will be effective even if the current index does not have
gitattributes. (In fact I added this feature into this change). E.g.
that is also important during a clone where we checkout a branch but
have an empty index and workingtree. Please ask this questions in
gerrit directly on Arthurs change.

> Question 2: I strongly assume that Arthurs patch will be the base. Ok? So I can base the next proposal on it.
Yes, right. I'll update that change today but you can already starting
rebasing on that one.


Back to the top