Junio C Hamano <junkio@xxxxxxx> wrote: > Shawn Pearce <spearce@xxxxxxxxxxx> writes: > > > Tommi Virtanen noted on #git today that > > > > git ls-files --exclude-per-directory > > > > doesn't appear to work as advertised by the documentation unless > > --others is also used. According to the current source code this > > is the case as the --exclude-per-directory file isn't read unless > > we are iterating over the working directory, which only happens > > with --others. > > I am puzzled by this problem description. > > If we _were_ to read --exclude-per-directory file when we are > not doing --others, what better behaviour would we get out of > the command? >From what I was able to gather on #git Tommi was trying to do: mkdir foo ; cd foo ; git init-db echo foo >foo echo foo >ignore git add foo ignore git commit -a -m create rm * git ls-files --exclude-per-directory=ignore \ | git checkout-index and not see "foo" come back into the working directory. I don't know what circumstances lead him to want to create an exclude file pattern on a per-directory basis for use with checkout-index but that seems to be what he was trying to do. I don't really see a problem with applying --exclude-per-directory all of time (like we apply --exclude=.git/info/exclude all of time), its just not what the code does today. I just personally don't need that and don't have the time to fix ls-files to do so. So I took the shorter approach and updated the documentation. :) -- Shawn. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html