{"thread":{"id":"3321","subject":"Quick question","startedAt":"2006-02-13T16:36:07Z","lastAt":"2006-02-14T07:52:18Z","messageCount":9,"participants":["Radoslaw Szkodzinski","Linus Torvalds","Alex Riesen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"16050","messageId":"43F0B577.4070608@gorzow.mm.pl","threadId":"3321","inReplyTo":null,"subject":"Quick question","fromName":"Radoslaw Szkodzinski","fromEmail":"astralstorm@gorzow.mm.pl","sentAt":"2006-02-13T16:36:07Z","receivedAt":"2006-02-13T16:36:07Z","isPatch":false,"sender":{"key":"astralstorm@gorzow.mm.pl","avatar":null},"body":"How to display ignored files of the whole project using only core git?\n\nI've tried:\n\ngit-ls-files -o -i -X .git/info/exclude\n\nand it only showed me the excluded files in the current directory...\n\n-- \nGPG Key id:  0xD1F10BA2\nFingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2\n\nAstralStorm\n\n"},{"id":"16052","messageId":"Pine.LNX.4.64.0602130848220.3691@g5.osdl.org","threadId":"3321","inReplyTo":"43F0B577.4070608@gorzow.mm.pl","subject":"Re: Quick question","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-02-13T16:54:31Z","receivedAt":"2006-02-13T16:54:31Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 13 Feb 2006, Radoslaw Szkodzinski wrote:\n>\n> How to display ignored files of the whole project using only core git?\n> \n> I've tried:\n> \n> git-ls-files -o -i -X .git/info/exclude\n> \n> and it only showed me the excluded files in the current directory...\n\nWell, since you're telling it to only show excluded files, it will also \nonly show excluded directories.\n\nWhich is admittedly insane. You don't want to exclude directories. Or \nmaybe you do, but then we should add the \"/\" to the end before we do the \nexclusion.\n\nThis patch (untested) will never exclude directories. Which may or may not \nbe the right thing. \n\nJunio? Others? Comments?\n\n\t\tLinus\n\n---\ndiff --git a/ls-files.c b/ls-files.c\nindex 7024cf1..b923f92 100644\n--- a/ls-files.c\n+++ b/ls-files.c\n@@ -276,8 +276,6 @@ static void read_directory(const char *p\n \t\t\t\tcontinue;\n \t\t\tlen = strlen(de->d_name);\n \t\t\tmemcpy(fullname + baselen, de->d_name, len+1);\n-\t\t\tif (excluded(fullname) != show_ignored)\n-\t\t\t\tcontinue;\n \n \t\t\tswitch (DTYPE(de)) {\n \t\t\tstruct stat st;\n@@ -304,6 +302,8 @@ static void read_directory(const char *p\n \t\t\tcase DT_LNK:\n \t\t\t\tbreak;\n \t\t\t}\n+\t\t\tif (excluded(fullname) != show_ignored)\n+\t\t\t\tcontinue;\n \t\t\tadd_name(fullname, baselen + len);\n \t\t}\n \t\tclosedir(dir);\n"},{"id":"16053","messageId":"43F0CF3B.6040807@gorzow.mm.pl","threadId":"3321","inReplyTo":"Pine.LNX.4.64.0602130848220.3691@g5.osdl.org","subject":"Re: Quick question","fromName":"Radoslaw Szkodzinski","fromEmail":"astralstorm@gorzow.mm.pl","sentAt":"2006-02-13T18:26:03Z","receivedAt":"2006-02-13T18:26:03Z","isPatch":false,"sender":{"key":"astralstorm@gorzow.mm.pl","avatar":null},"body":"Linus Torvalds wrote:\n> \n> Well, since you're telling it to only show excluded files, it will also \n> only show excluded directories.\n> \n> Which is admittedly insane. You don't want to exclude directories. Or \n> maybe you do, but then we should add the \"/\" to the end before we do the \n> exclusion.\n> \n> This patch (untested) will never exclude directories. Which may or may not \n> be the right thing. \n> \n> Junio? Others? Comments?\n> \n\nFor me it seems to do the right thing, although I have no need to exclude directories.\nIf I really needed to, I'd say something like:\n\n/excluded_dir/*\n\nin .git/info/exclude, and it would show the files as being excluded.\n\n-- \nGPG Key id:  0xD1F10BA2\nFingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2\n\nAstralStorm\n\n"},{"id":"16054","messageId":"20060213201709.GB5935@steel.home","threadId":"3321","inReplyTo":"43F0CF3B.6040807@gorzow.mm.pl","subject":"Re: Quick question","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-02-13T20:17:09Z","receivedAt":"2006-02-13T20:17:09Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Radoslaw Szkodzinski, Mon, Feb 13, 2006 19:26:03 +0100:\n> Linus Torvalds wrote:\n> > \n> > Well, since you're telling it to only show excluded files, it will also \n> > only show excluded directories.\n> > \n> > Which is admittedly insane. You don't want to exclude directories. Or \n> > maybe you do, but then we should add the \"/\" to the end before we do the \n> > exclusion.\n> > \n> > This patch (untested) will never exclude directories. Which may or may not \n> > be the right thing. \n\nI actually quiet like it how it is.\n\n> > Junio? Others? Comments?\n> > \n> \n> For me it seems to do the right thing, although I have no need to exclude directories.\n> If I really needed to, I'd say something like:\n> \n> /excluded_dir/*\n> \n> in .git/info/exclude, and it would show the files as being excluded.\n> \n\nWhat's wrong with .gitignore in the excluded_dir containing everything\nyou don't want to see, or even just \"*\"?\n"},{"id":"16068","messageId":"7vy80eydq0.fsf@assigned-by-dhcp.cox.net","threadId":"3321","inReplyTo":"43F0B577.4070608@gorzow.mm.pl","subject":"Re: Quick question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-14T00:40:39Z","receivedAt":"2006-02-14T00:40:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl> writes:\n\n> How to display ignored files of the whole project using only core git?\n>\n> I've tried:\n>\n> git-ls-files -o -i -X .git/info/exclude\n>\n> and it only showed me the excluded files in the current directory...\n\nWith the git.git repository itself, I tried:\n\n$ cat /var/tmp/i\n*.c\n$ git ls-files -i -X /var/tmp/i | head -n 6\napply.c\narm/sha1.c\nblob.c\ncat-file.c\ncheck-ref-format.c\ncheckout-index.c\n\nSo I am not sure what you mean.  You wanted to \"display ignored\nfiles of the whole project\", right?  I am getting arm/sha1.c\nhere in my output, so I do not understand the issue here...\n"},{"id":"16073","messageId":"43F13776.9000501@gorzow.mm.pl","threadId":"3321","inReplyTo":"7vy80eydq0.fsf@assigned-by-dhcp.cox.net","subject":"Re: Quick question","fromName":"Radoslaw Szkodzinski","fromEmail":"astralstorm@gorzow.mm.pl","sentAt":"2006-02-14T01:50:46Z","receivedAt":"2006-02-14T01:50:46Z","isPatch":false,"sender":{"key":"astralstorm@gorzow.mm.pl","avatar":null},"body":"Junio C Hamano wrote:\n> With the git.git repository itself, I tried:\n> \n> $ cat /var/tmp/i\n> *.c\n> $ git ls-files -i -X /var/tmp/i | head -n 6\n> apply.c\n> arm/sha1.c\n> blob.c\n> cat-file.c\n> check-ref-format.c\n> checkout-index.c\n> \n> So I am not sure what you mean.  You wanted to \"display ignored\n> files of the whole project\", right?  I am getting arm/sha1.c\n> here in my output, so I do not understand the issue here...\n> \n\nWrong. I wanted to display files that are ignored and not checked in.\n(unlike your example)\n\nThat's why I used the -o (--others).\n\nTry your example with git repo's .gitignore and any .o file.\nI would like to use it for backup~ hunting purposes in a script\nand not have to worry about find and other less portable tools.\n\n-- \nGPG Key id:  0xD1F10BA2\nFingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2\n\nAstralStorm\n\n"},{"id":"16075","messageId":"7v3bimy9wn.fsf@assigned-by-dhcp.cox.net","threadId":"3321","inReplyTo":"43F13776.9000501@gorzow.mm.pl","subject":"Re: Quick question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-14T02:03:04Z","receivedAt":"2006-02-14T02:03:04Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Radoslaw Szkodzinski <astralstorm@gorzow.mm.pl> writes:\n\n> Wrong. I wanted to display files that are ignored and not checked in.\n> (unlike your example)\n\nWow, you have a strong voice.\n\n> That's why I used the -o (--others).\n\nYou asked it to show either ignored or others.\n\n\n> I would like to use it for backup~ hunting purposes in a script\n> and not have to worry about find and other less portable tools.\n\nI usually do this for that:\n\n\tgit ls-files -o '*~'\n"},{"id":"16077","messageId":"43F13EC2.7040909@gorzow.mm.pl","threadId":"3321","inReplyTo":"7v3bimy9wn.fsf@assigned-by-dhcp.cox.net","subject":"Re: Quick question","fromName":"Radoslaw Szkodzinski","fromEmail":"astralstorm@gorzow.mm.pl","sentAt":"2006-02-14T02:21:54Z","receivedAt":"2006-02-14T02:21:54Z","isPatch":false,"sender":{"key":"astralstorm@gorzow.mm.pl","avatar":null},"body":"Junio C Hamano wrote:\n> Wow, you have a strong voice.\n>\nI didn't want to sound rude at all, of course.\n\n>> That's why I used the -o (--others).\n> \n> You asked it to show either ignored or others.\n> \n\nSo here's the catch? I don't think so.\nBut the manpage isn't totally clear in this matter.\n\nWhen I specify just -o, it gives me files which weren't ignored too.\n-o -i gives me only ignored files.\nPlain -i returns nothing.\n\nWith git directory, compare:\ngit-ls-files -o -i -X .gitignore\n\nwith:\ngit-ls-files -o\n\nThe remainder is:\ngit-ls-files -o -X .gitignore\n\nI have the documentation built.\n(Yes, I'm not including its .gitignore on purpose)\n\n> \n>> I would like to use it for backup~ hunting purposes in a script\n>> and not have to worry about find and other less portable tools.\n> \n> I usually do this for that:\n> \n> \tgit ls-files -o '*~'\n> \n\nAlso good. I have *~ in ignored too, so I think -o -i will suffice.\n\n-- \nGPG Key id:  0xD1F10BA2\nFingerprint: 96E2 304A B9C4 949A 10A0  9105 9543 0453 D1F1 0BA2\n\nAstralStorm\n\n"},{"id":"16102","messageId":"7voe1atm19.fsf@assigned-by-dhcp.cox.net","threadId":"3321","inReplyTo":"Pine.LNX.4.64.0602130848220.3691@g5.osdl.org","subject":"Re: Quick question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-14T07:52:18Z","receivedAt":"2006-02-14T07:52:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@osdl.org> writes:\n\n> Which is admittedly insane. You don't want to exclude directories. Or \n> maybe you do, but then we should add the \"/\" to the end before we do the \n> exclusion.\n>\n> This patch (untested) will never exclude directories. Which may or may not \n> be the right thing. \n>\n> Junio? Others? Comments?\n>\n> \t\tLinus\n\nI might have sounded negative or happy with status quo in my\nearlier messages but that was not intended.  I am swamped and\nhave not formed an opinion.\n"}]}