{"thread":{"id":"37819","subject":"git ls-files -o seems to ignore .gitignore","startedAt":"2014-10-27T06:16:49Z","lastAt":"2014-10-27T09:22:03Z","messageCount":4,"participants":["Richard PALO","Charles Bailey","Matthieu Moy","richard.palo@free.fr"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"251090","messageId":"544DE351.9060800@netbsd.org","threadId":"37819","inReplyTo":null,"subject":"git ls-files -o seems to ignore .gitignore","fromName":"Richard PALO","fromEmail":"richard@netbsd.org","sentAt":"2014-10-27T06:16:49Z","receivedAt":"2014-10-27T06:16:49Z","isPatch":false,"sender":{"key":"richard@netbsd.org","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nI'm having an issue in that 'git ls-files -o' seems to ignore\n[parts of] .gitignore whereas other commands, such as 'git status'\nseem fine.\n\nHere is an example:\n> richard@omnis:/home/richard/src/pkgsrc$ export LANG=C \n> richard@omnis:/home/richard/src/pkgsrc$ git --version git version\n> 2.1.2 richard@omnis:/home/richard/src/pkgsrc$ cat .gitignore \n> pkgchk*.conf* .#* README*.html \n> richard@omnis:/home/richard/src/pkgsrc$ git status On branch dev\n> \n> It took 6.82 seconds to enumerate untracked files. 'status -uno' \n> may speed it up, but you have to be careful not to forget to add \n> new files yourself (see 'git help status'). nothing to commit,\n> working directory clean richard@omnis:/home/richard/src/pkgsrc$ git\n> ls-files -o |grep -c README 12393\n\nKnown issue?\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJUTeNRAAoJECAB22fHtp27hckH+wdDHV3oZqatSIqNdhUCUxsJ\njR8tZpQxoKfV944aPBgH4/CXkCtFFSvnGKfH+plij+Y5ggZwfDQ3lXIg1qOsH3qj\n9mvudRuFxwujXfFSTHdReqQxFT8p3roZjB0GdwoiFeBIsQ8CLfGjxfQZDQU18i3/\nIfR682UbzuiR6kodhD5oX/I2S5l5dRRuabQq5t2zJL9BHmGleLaBgOjnne7T26PC\nJpNMt+60J93J9VzBN9kQABAO5BMUE4mN6g2141N9JXlMsg6DSGHPN5vQD7t7IxE1\nmtNX9iMrjFa1Hsm2neXqvjb95ZGbZwTnxFcI7To6P3V/+v9QMpKrrBWu/AFNdF0=\n=84q1\n-----END PGP SIGNATURE-----\n"},{"id":"251092","messageId":"20141027064747.GA7773@hashpling.org","threadId":"37819","inReplyTo":"544DE351.9060800@netbsd.org","subject":"Re: git ls-files -o seems to ignore .gitignore","fromName":"Charles Bailey","fromEmail":"charles@hashpling.org","sentAt":"2014-10-27T06:47:47Z","receivedAt":"2014-10-27T06:47:47Z","isPatch":false,"sender":{"key":"charles@hashpling.org","avatar":"https://avatars.githubusercontent.com/u/1668475?v=4"},"body":"On Mon, Oct 27, 2014 at 07:16:49AM +0100, Richard PALO wrote:\n> Hash: SHA1\n> \n> I'm having an issue in that 'git ls-files -o' seems to ignore\n> [parts of] .gitignore whereas other commands, such as 'git status'\n> seem fine.\n\nThis is, as far as I am aware, by design. If you want to apply the\nstandard ignore rules to the output of ls-files -o then you can use the\n--exclude-standard option.\n"},{"id":"251093","messageId":"vpq8uk1lxqb.fsf@anie.imag.fr","threadId":"37819","inReplyTo":"20141027064747.GA7773@hashpling.org","subject":"Re: git ls-files -o seems to ignore .gitignore","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-10-27T08:31:56Z","receivedAt":"2014-10-27T08:31:56Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Charles Bailey <charles@hashpling.org> writes:\n\n> On Mon, Oct 27, 2014 at 07:16:49AM +0100, Richard PALO wrote:\n>> Hash: SHA1\n>> \n>> I'm having an issue in that 'git ls-files -o' seems to ignore\n>> [parts of] .gitignore whereas other commands, such as 'git status'\n>> seem fine.\n>\n> This is, as far as I am aware, by design.\n\nI would not call that \"by design\", but indeed \"git ls\" was written this\nway, and it's a plumbing command for which we do not want\nbackward-incompatible changes. So, --exclude-standard is available, but\nnot activated by default.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"251095","messageId":"391421950.105620016.1414401723677.JavaMail.root@zimbra7-e1.priv.proxad.net","threadId":"37819","inReplyTo":"vpq8uk1lxqb.fsf@anie.imag.fr","subject":"Re: git ls-files -o seems to ignore .gitignore","fromName":"","fromEmail":"richard.palo@free.fr","sentAt":"2014-10-27T09:22:03Z","receivedAt":"2014-10-27T09:22:03Z","isPatch":false,"sender":{"key":"richard.palo@free.fr","avatar":null},"body":"Well, ok.  Not very intuitive, so I added an alias in .gitconfig... \n'ls = ls-files --exclude-standard' and that seems to work now alright for me.\n\nThanks\n\n----- Mail original -----\n> De: \"Matthieu Moy\" <Matthieu.Moy@grenoble-inp.fr>\n> À: \"Charles Bailey\" <charles@hashpling.org>\n> Cc: \"Richard PALO\" <richard@netbsd.org>, git@vger.kernel.org\n> Envoyé: Lundi 27 Octobre 2014 09:31:56\n> Objet: Re: git ls-files -o seems to ignore .gitignore\n> \n> Charles Bailey <charles@hashpling.org> writes:\n> \n> > On Mon, Oct 27, 2014 at 07:16:49AM +0100, Richard PALO wrote:\n> >> Hash: SHA1\n> >> \n> >> I'm having an issue in that 'git ls-files -o' seems to ignore\n> >> [parts of] .gitignore whereas other commands, such as 'git status'\n> >> seem fine.\n> >\n> > This is, as far as I am aware, by design.\n> \n> I would not call that \"by design\", but indeed \"git ls\" was written\n> this\n> way, and it's a plumbing command for which we do not want\n> backward-incompatible changes. So, --exclude-standard is available,\n> but\n> not activated by default.\n> \n> --\n> Matthieu Moy\n> http://www-verimag.imag.fr/~moy/\n> \n"}]}