{"thread":{"id":"5692","subject":"[PATCH] Clarified documentation of --exclude-per-directory.","startedAt":"2006-09-25T15:58:21Z","lastAt":"2006-09-26T21:41:50Z","messageCount":3,"participants":["Shawn Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27623","messageId":"20060925155821.GC26844@spearce.org","threadId":"5692","inReplyTo":null,"subject":"[PATCH] Clarified documentation of --exclude-per-directory.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-09-25T15:58:21Z","receivedAt":"2006-09-25T15:58:21Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Tommi Virtanen noted on #git today that\n\n  git ls-files --exclude-per-directory\n\ndoesn't appear to work as advertised by the documentation unless\n--others is also used.  According to the current source code this\nis the case as the --exclude-per-directory file isn't read unless\nwe are iterating over the working directory, which only happens\nwith --others.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n Documentation/git-ls-files.txt |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt\nindex 8520b97..2a0b9f8 100644\n--- a/Documentation/git-ls-files.txt\n+++ b/Documentation/git-ls-files.txt\n@@ -75,7 +75,8 @@ OPTIONS\n \n --exclude-per-directory=<file>::\n \tread additional exclude patterns that apply only to the\n-\tdirectory and its subdirectories in <file>.\n+\tdirectory and its subdirectories in <file>.  This option\n+\tonly takes effect if -o or --others is also used.\n \n --error-unmatch::\n \tIf any <file> does not appear in the index, treat this as an\n@@ -167,7 +168,7 @@ time.  They are built and ordered in the\n  * lines read from --exclude-from=<file>; patterns are ordered\n    in the same order as they appear in the file.\n \n- * When --exclude-per-directory=<name> is specified, upon\n+ * When --exclude-per-directory=<name> and --others is specified, upon\n    entering a directory that has such a file, its contents are\n    appended at the end of the current \"list of patterns\".  They\n    are popped off when leaving the directory.\n-- \n1.4.2.1.g7a39b\n"},{"id":"27657","messageId":"7v3baftdp0.fsf@assigned-by-dhcp.cox.net","threadId":"5692","inReplyTo":"20060925155821.GC26844@spearce.org","subject":"Re: [PATCH] Clarified documentation of --exclude-per-directory.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-26T05:11:07Z","receivedAt":"2006-09-26T05:11:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shawn Pearce <spearce@spearce.org> writes:\n\n> Tommi Virtanen noted on #git today that\n>\n>   git ls-files --exclude-per-directory\n>\n> doesn't appear to work as advertised by the documentation unless\n> --others is also used.  According to the current source code this\n> is the case as the --exclude-per-directory file isn't read unless\n> we are iterating over the working directory, which only happens\n> with --others.\n\nI am puzzled by this problem description.\n\nIf we _were_ to read --exclude-per-directory file when we are\nnot doing --others, what better behaviour would we get out of\nthe command?\n"},{"id":"27710","messageId":"20060926214150.GB8177@spearce.org","threadId":"5692","inReplyTo":"7v3baftdp0.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Clarified documentation of --exclude-per-directory.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-09-26T21:41:50Z","receivedAt":"2006-09-26T21:41:50Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n> Shawn Pearce <spearce@spearce.org> writes:\n> \n> > Tommi Virtanen noted on #git today that\n> >\n> >   git ls-files --exclude-per-directory\n> >\n> > doesn't appear to work as advertised by the documentation unless\n> > --others is also used.  According to the current source code this\n> > is the case as the --exclude-per-directory file isn't read unless\n> > we are iterating over the working directory, which only happens\n> > with --others.\n> \n> I am puzzled by this problem description.\n> \n> If we _were_ to read --exclude-per-directory file when we are\n> not doing --others, what better behaviour would we get out of\n> the command?\n \nFrom what I was able to gather on #git Tommi was trying to do:\n\n\tmkdir foo ; cd foo ; git init-db\n\techo foo >foo\n\techo foo >ignore\n\tgit add foo ignore\n\tgit commit -a -m create\n\trm *\n\tgit ls-files --exclude-per-directory=ignore \\\n\t\t| git checkout-index\n\nand not see \"foo\" come back into the working directory.  I don't\nknow what circumstances lead him to want to create an exclude file\npattern on a per-directory basis for use with checkout-index but\nthat seems to be what he was trying to do.\n\n\nI don't really see a problem with applying --exclude-per-directory\nall of time (like we apply --exclude=.git/info/exclude all of\ntime), its just not what the code does today.  I just personally\ndon't need that and don't have the time to fix ls-files to do so.\nSo I took the shorter approach and updated the documentation. :)\n\n-- \nShawn.\n"}]}