From: Jeff King Date: Fri, 19 Feb 2010 06:02:49 GMT Subject: Re: 'git add' regression in git-1.7? Message-ID: <20100219060249.GD22645@coredump.intra.peff.net> In-Reply-To: <20100219053431.GB22645@coredump.intra.peff.net> On Fri, Feb 19, 2010 at 12:34:31AM -0500, Jeff King wrote: > > On Fri, Feb 19, 2010 at 12:04 AM, SungHyun Nam wrote: > > > Well, before sending the previous email, I checked the > > > RelNotes-1.7.*.txt,  and could not find such a change by searching > > > 'git add'.  So, I thought it's a regression. > > > > As far as I know, git add has refused to add ignored files for as long > > as I can remember. Maybe there was briefly a bug in this behaviour > > that was later fixed... > > > > If you use 'git bisect' on the git repo, you could probably discover > > what happened, in case you're interested. > > It was intentional. Try 48ffef9 (ls-files: fix overeager pathspec > optimization, 2010-01-08). But this is a little disturbing still: $ git init $ mkdir dir $ touch dir/sub $ touch root $ echo dir >.gitignore $ echo root >>.gitignore $ git add root The following paths are ignored by one of your .gitignore files: root Use -f if you really want to add them. fatal: no files added $ echo $? 128 $ git add dir The following paths are ignored by one of your .gitignore files: dir Use -f if you really want to add them. fatal: no files added $ echo $? 128 $ git add dir/sub $ echo $? 0 but we didn't actually add the file. -Peff