{"thread":{"id":"15912","subject":"[BUG] git status doesn't handle submodules properly on OSX","startedAt":"2008-10-15T12:07:17Z","lastAt":"2008-10-17T23:58:45Z","messageCount":21,"participants":["Lars Hoss","Jeff King","Pieter de Bie","Richard Bubel","Pedro Melo","Johannes Sixt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"93085","messageId":"c60a85c1297be6446ad92a3e7723ddc8.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":null,"subject":"[BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-15T12:07:17Z","receivedAt":"2008-10-15T12:07:17Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"Greetings all,\n\ntwo days ago I posted about an issue:\nhttp://thread.gmane.org/gmane.comp.version-control.git/98171\n\nAfter more testing I can confirm it is indeed a bug.\n\n1.6.0.2 on OSX Leopard doesn't work. After adding a submodule\nthe folder of the submodule will always get listed under\n\"Untracked files\" when calling git status.\n\n1.5.6, however, works fine. I have not tested trunk yet.\n\nSo as a workaround I have to go back to 1.5.6 for now.\n\nYours,\nLars\n"},{"id":"93089","messageId":"20081015124943.GA10816@sigill.intra.peff.net","threadId":"15912","inReplyTo":"c60a85c1297be6446ad92a3e7723ddc8.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-15T12:49:43Z","receivedAt":"2008-10-15T12:49:43Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Oct 15, 2008 at 02:07:17PM +0200, Lars Hoss wrote:\n\n> two days ago I posted about an issue:\n> http://thread.gmane.org/gmane.comp.version-control.git/98171\n> \n> After more testing I can confirm it is indeed a bug.\n> \n> 1.6.0.2 on OSX Leopard doesn't work. After adding a submodule\n> the folder of the submodule will always get listed under\n> \"Untracked files\" when calling git status.\n> \n> 1.5.6, however, works fine. I have not tested trunk yet.\n\nI wasn't able to reproduce your bug on my Linux box. Can you bisect to\nfind the faulty commit?\n\n-Peff\n"},{"id":"93092","messageId":"5c7e37ffe7f7648398c2ddb313fdcf2a.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"20081015124943.GA10816@sigill.intra.peff.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-15T14:30:03Z","receivedAt":"2008-10-15T14:30:03Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"> I wasn't able to reproduce your bug on my Linux box. Can you bisect to\n> find the faulty commit?\n\nYes, you are right. This bug does neither appear on Linux nor on Windows\n(mysysgit). So far it seems to be a OSX only bug.\n\nNever used bisect myself before since I am new to git. But will try to do\nmy best - hehehe :)\n\nYours,\nLars\n"},{"id":"93094","messageId":"5D0481A4-D173-4CF8-B855-5E58978210F8@ai.rug.nl","threadId":"15912","inReplyTo":"c60a85c1297be6446ad92a3e7723ddc8.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-10-15T14:38:23Z","receivedAt":"2008-10-15T14:38:23Z","isPatch":false,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"\nOn 15 okt 2008, at 14:07, Lars Hoss wrote:\n\n> two days ago I posted about an issue:\n> http://thread.gmane.org/gmane.comp.version-control.git/98171\n>\n> After more testing I can confirm it is indeed a bug.\n>\n> 1.6.0.2 on OSX Leopard doesn't work. After adding a submodule\n> the folder of the submodule will always get listed under\n> \"Untracked files\" when calling git status.\n>\n> 1.5.6, however, works fine. I have not tested trunk yet.\n>\n> So as a workaround I have to go back to 1.5.6 for now.\n\nWorks for me on Leopard\n\nVienna:a pieter$ git submodule add ~/projects/GitX/ gitx\nInitialized empty Git repository in /Users/pieter/a/gitx/.git/\nVienna:a pieter$ git st\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#\tnew file:   .gitmodules\n#\tnew file:   gitx\n#\nVienna:a pieter$ git --version\ngit version 1.6.0.2.415.gf9137\n\n- Pieter\n"},{"id":"93095","messageId":"6ca24750ca8d7bd9e995d023e78e0d71.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"5D0481A4-D173-4CF8-B855-5E58978210F8@ai.rug.nl","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-15T14:51:13Z","receivedAt":"2008-10-15T14:51:13Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"> Works for me on Leopard\n>\n> Vienna:a pieter$ git submodule add ~/projects/GitX/ gitx\n> Initialized empty Git repository in /Users/pieter/a/gitx/.git/\n> Vienna:a pieter$ git st\n> # On branch master\n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #\tnew file:   .gitmodules\n> #\tnew file:   gitx\n> #\n> Vienna:a pieter$ git --version\n> git version 1.6.0.2.415.gf9137\n\nMy git version \"1.6.0.2\" says:\n\n# On branch master\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#\tnew file:   .gitmodules\n#\tnew file:   lib\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#\tlib/\ngit --version\ngit version 1.6.0.2\n\nGit was build from macports.\n\nYours,\nLars\n"},{"id":"93097","messageId":"A0A3837E-7F85-4172-A8BA-969BFD46CF48@ai.rug.nl","threadId":"15912","inReplyTo":"6ca24750ca8d7bd9e995d023e78e0d71.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-10-15T14:59:39Z","receivedAt":"2008-10-15T14:59:39Z","isPatch":false,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"\nOn 15 okt 2008, at 16:51, Lars Hoss wrote:\n> My git version \"1.6.0.2\" says:\n>\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> #\tlib/\n> git --version\n> git version 1.6.0.2\n\n\nI just tested 1.6.0.2, and had no problems. Perhaps macports is doing  \nsomething odd?\n"},{"id":"93098","messageId":"DE453BEE-6749-4892-BFAA-3B37CFAADD3E@cs.chalmers.se","threadId":"15912","inReplyTo":"6ca24750ca8d7bd9e995d023e78e0d71.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Richard Bubel","fromEmail":"bubel@cs.chalmers.se","sentAt":"2008-10-15T15:01:44Z","receivedAt":"2008-10-15T15:01:44Z","isPatch":false,"sender":{"key":"bubel@cs.chalmers.se","avatar":null},"body":"Hi,\n\nOn Oct 15, 2008, at 16:51 , Lars Hoss wrote:\n\n>> Works for me on Leopard\n>> [...]\n>> Vienna:a pieter$ git --version\n>> git version 1.6.0.2.415.gf9137\n>\n> My git version \"1.6.0.2\" says:\n>\n> # On branch master\n> [...]\n> git --version\n> git version 1.6.0.2\n>\n> Git was build from macports.\n\n\nworks for me too on OS X 10.5.5 with git 1.6.0.2 from MacPorts. As it  \ndeviates from the default, it might be worth mentioning that the  \nfilesystem in use here is the case-sensitive version of HFS+.\n\nBest Regards,\n   Richard\n"},{"id":"93099","messageId":"cb12ad6f061a80750569e3f8b9d9b9d0.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"A0A3837E-7F85-4172-A8BA-969BFD46CF48@ai.rug.nl","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-15T15:14:21Z","receivedAt":"2008-10-15T15:14:21Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"> I just tested 1.6.0.2, and had no problems. Perhaps macports is doing\n> something odd?\n\nActually this was my idea first. Thus I build git from the sources the\nportfile links to myself. The bug, however, remains.\n\nThe link is: http://www.kernel.org/pub/software/scm/git/git-1.6.0.2.tar.bz2.\n\nI've tested this on two machines, both using latest version of Leopard.\nAnd there was another poster on this forum who had the very same issue.\n\nNow the interesting question is what is different between Pieter's system\nand mine? And why does 1.5.6 work fine?\n\nAs soon as I am at home I will try bisect. I am currently at work behind a\nbig bad firewall ;)\n\nYours,\nLars\n"},{"id":"93100","messageId":"c84d2f2498509bfb916c060317892998.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"DE453BEE-6749-4892-BFAA-3B37CFAADD3E@cs.chalmers.se","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-15T15:21:14Z","receivedAt":"2008-10-15T15:21:14Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"Ok, this might be the difference. I am pretty sure my\nfilesystem is not case-sensitive (default?).\nAt least \"mkdir Foo\" fails when \"foo\" exists.\n\nYours,\nLars\n\n> Hi,\n>\n> On Oct 15, 2008, at 16:51 , Lars Hoss wrote:\n>\n>>> Works for me on Leopard\n>>> [...]\n>>> Vienna:a pieter$ git --version\n>>> git version 1.6.0.2.415.gf9137\n>>\n>> My git version \"1.6.0.2\" says:\n>>\n>> # On branch master\n>> [...]\n>> git --version\n>> git version 1.6.0.2\n>>\n>> Git was build from macports.\n>\n>\n> works for me too on OS X 10.5.5 with git 1.6.0.2 from MacPorts. As it\n> deviates from the default, it might be worth mentioning that the\n> filesystem in use here is the case-sensitive version of HFS+.\n>\n> Best Regards,\n>    Richard\n>\n"},{"id":"93175","messageId":"B6E3AB69-374D-403A-8451-341C4B516506@simplicidade.org","threadId":"15912","inReplyTo":"c60a85c1297be6446ad92a3e7723ddc8.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Pedro Melo","fromEmail":"melo@simplicidade.org","sentAt":"2008-10-16T09:43:01Z","receivedAt":"2008-10-16T09:43:01Z","isPatch":false,"sender":{"key":"melo@simplicidade.org","avatar":"https://gravatar.com/avatar/13ddbb01e300285a93aa1e3739653a81f9b1d3438bd03a4ac36b88e4ffeeafc3?d=mp&s=160"},"body":"Hi,\n\nOn Oct 15, 2008, at 1:07 PM, Lars Hoss wrote:\n\n> Greetings all,\n>\n> two days ago I posted about an issue:\n> http://thread.gmane.org/gmane.comp.version-control.git/98171\n>\n> After more testing I can confirm it is indeed a bug.\n>\n> 1.6.0.2 on OSX Leopard doesn't work. After adding a submodule\n> the folder of the submodule will always get listed under\n> \"Untracked files\" when calling git status.\n\nI'm using  1.6.0.2.526.g5c283 on Leopard with lots of submodules  \nwithout any problems at all.\n\nI was going to reply to your original message but it slipped my mind  \n(commuting et al).\n\nCan you provide a sequence of commands that demonstrate the problem so  \nthat I can try?\n\nBest regards,\n-- \nPedro Melo\nBlog: http://www.simplicidade.org/notes/\nXMPP ID: melo@simplicidade.org\nUse XMPP!\n"},{"id":"93176","messageId":"524C98C8-C3A5-4501-932A-2F0ACDE2886A@simplicidade.org","threadId":"15912","inReplyTo":"6ca24750ca8d7bd9e995d023e78e0d71.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Pedro Melo","fromEmail":"melo@simplicidade.org","sentAt":"2008-10-16T09:48:04Z","receivedAt":"2008-10-16T09:48:04Z","isPatch":false,"sender":{"key":"melo@simplicidade.org","avatar":"https://gravatar.com/avatar/13ddbb01e300285a93aa1e3739653a81f9b1d3438bd03a4ac36b88e4ffeeafc3?d=mp&s=160"},"body":"\nOn Oct 15, 2008, at 3:51 PM, Lars Hoss wrote:\n\n>> Works for me on Leopard\n>>\n>> Vienna:a pieter$ git submodule add ~/projects/GitX/ gitx\n>> Initialized empty Git repository in /Users/pieter/a/gitx/.git/\n>> Vienna:a pieter$ git st\n>> # On branch master\n>> # Changes to be committed:\n>> #   (use \"git reset HEAD <file>...\" to unstage)\n>> #\n>> #\tnew file:   .gitmodules\n>> #\tnew file:   gitx\n>> #\n>> Vienna:a pieter$ git --version\n>> git version 1.6.0.2.415.gf9137\n>\n> My git version \"1.6.0.2\" says:\n>\n> # On branch master\n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #\tnew file:   .gitmodules\n> #\tnew file:   lib\n> #\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> #\tlib/\n> git --version\n> git version 1.6.0.2\n>\n> Git was build from macports.\n\nhmms.. Really, I know about fink and Macports and all others, but I'm  \nusing Mac OS X since version 10.1 (when compiling OSS software was  \nnear impossible due to Apple decisions) and I've always had better  \nresults with compiling my own than using any of those OSS repositories.\n\nI understand the appeal, it seems easier, but I would recommend that  \nyou compile yourself the software packages you depend on.\n\nRegarding git, I saw a git-build.sh script floating around. If you  \ncannot find it, you might want to try my own recipe (http://tinyurl.com/4ayze6 \n). I compile git master every day (cron) and thats the one I use on my  \nmain machine.\n\nBest regards,\n-- \nPedro Melo\nBlog: http://www.simplicidade.org/notes/\nXMPP ID: melo@simplicidade.org\nUse XMPP!\n"},{"id":"93177","messageId":"EF4CC05B-894C-40FB-B803-E30F07284C1C@simplicidade.org","threadId":"15912","inReplyTo":"c84d2f2498509bfb916c060317892998.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Pedro Melo","fromEmail":"melo@simplicidade.org","sentAt":"2008-10-16T09:49:45Z","receivedAt":"2008-10-16T09:49:45Z","isPatch":false,"sender":{"key":"melo@simplicidade.org","avatar":"https://gravatar.com/avatar/13ddbb01e300285a93aa1e3739653a81f9b1d3438bd03a4ac36b88e4ffeeafc3?d=mp&s=160"},"body":"Hi,\n\nOn Oct 15, 2008, at 4:21 PM, Lars Hoss wrote:\n\n> Ok, this might be the difference. I am pretty sure my\n> filesystem is not case-sensitive (default?).\n> At least \"mkdir Foo\" fails when \"foo\" exists.\n\nMy filesystem is Mac OS Extended (Journaled) case-insensitive like  \nyours, and submodules work.\n\nBest regards,\n\n\n>\n>\n> Yours,\n> Lars\n>\n>> Hi,\n>>\n>> On Oct 15, 2008, at 16:51 , Lars Hoss wrote:\n>>\n>>>> Works for me on Leopard\n>>>> [...]\n>>>> Vienna:a pieter$ git --version\n>>>> git version 1.6.0.2.415.gf9137\n>>>\n>>> My git version \"1.6.0.2\" says:\n>>>\n>>> # On branch master\n>>> [...]\n>>> git --version\n>>> git version 1.6.0.2\n>>>\n>>> Git was build from macports.\n>>\n>>\n>> works for me too on OS X 10.5.5 with git 1.6.0.2 from MacPorts. As it\n>> deviates from the default, it might be worth mentioning that the\n>> filesystem in use here is the case-sensitive version of HFS+.\n>>\n>> Best Regards,\n>>   Richard\n>>\n>\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n-- \nPedro Melo\nBlog: http://www.simplicidade.org/notes/\nXMPP ID: melo@simplicidade.org\nUse XMPP!\n"},{"id":"93182","messageId":"fa8b32c2ff1d10914c5f3f24f79db91b.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"524C98C8-C3A5-4501-932A-2F0ACDE2886A@simplicidade.org","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-16T10:30:19Z","receivedAt":"2008-10-16T10:30:19Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"Hi!\n\nI've cloned git this morning in order to try a build from this.\nBut chances are small that it will make a difference. Because from\nthe portfile I can see that macports just downloads 1.6.0.2 release\nand builds it without any special patches or configure options.\n\nAs I said before, 1.5.6 works fine for me. But why 1.6.0.2 does not\nwork on my box - I don't know yet. Since Pedro uses a case-insensitive\nvolume as well, the problem seems not be related to sensitve/insensitive.\n\nNow that I have a git clone on my box I might try bisect as well.\n\nYours,\nLars\n\n> On Oct 15, 2008, at 3:51 PM, Lars Hoss wrote:\n>\n>>> Works for me on Leopard\n>>>\n>>> Vienna:a pieter$ git submodule add ~/projects/GitX/ gitx\n>>> Initialized empty Git repository in /Users/pieter/a/gitx/.git/\n>>> Vienna:a pieter$ git st\n>>> # On branch master\n>>> # Changes to be committed:\n>>> #   (use \"git reset HEAD <file>...\" to unstage)\n>>> #\n>>> #\tnew file:   .gitmodules\n>>> #\tnew file:   gitx\n>>> #\n>>> Vienna:a pieter$ git --version\n>>> git version 1.6.0.2.415.gf9137\n>>\n>> My git version \"1.6.0.2\" says:\n>>\n>> # On branch master\n>> # Changes to be committed:\n>> #   (use \"git reset HEAD <file>...\" to unstage)\n>> #\n>> #\tnew file:   .gitmodules\n>> #\tnew file:   lib\n>> #\n>> # Untracked files:\n>> #   (use \"git add <file>...\" to include in what will be committed)\n>> #\n>> #\tlib/\n>> git --version\n>> git version 1.6.0.2\n>>\n>> Git was build from macports.\n>\n> hmms.. Really, I know about fink and Macports and all others, but I'm\n> using Mac OS X since version 10.1 (when compiling OSS software was\n> near impossible due to Apple decisions) and I've always had better\n> results with compiling my own than using any of those OSS repositories.\n>\n> I understand the appeal, it seems easier, but I would recommend that\n> you compile yourself the software packages you depend on.\n>\n> Regarding git, I saw a git-build.sh script floating around. If you\n> cannot find it, you might want to try my own recipe\n> (http://tinyurl.com/4ayze6\n> ). I compile git master every day (cron) and thats the one I use on my\n> main machine.\n>\n> Best regards,\n> --\n> Pedro Melo\n> Blog: http://www.simplicidade.org/notes/\n> XMPP ID: melo@simplicidade.org\n> Use XMPP!\n>\n>\n>\n"},{"id":"93185","messageId":"3520b7a9009f072cfc3aeb82ae205e6b.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"524C98C8-C3A5-4501-932A-2F0ACDE2886A@simplicidade.org","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-16T11:23:21Z","receivedAt":"2008-10-16T11:23:21Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"Update:\n\nOk, I compiled several git versions from the git repo with the following\nresults:\n\nv1.5.6.5 works\nv1.6.0.2 fails\nv1.6.0 fails\nv1.6.0-rc0 fails\n\nGiven a git repo with a submodule 1.5.6.5 works (no untracked files) but\nthe same repo fails with 1.6.0-rc0 (lists submodule folders under\nuntracked files).\n\nSo something between 1.5.6.5 and 1.6.0-rc0 broke it for me.\nA quick diff between the two version revealed a lot of changes. Thus\ntracking down the issue might not be easy for someone who is not involved\nin the code.\n\nMaybe someone can give me a hint where to look? For example where does\n\"git status\" decide whether a given filesystem folder should be ignored\nwith regard to .gitmodules?\n\nYours,\nLars\n\n>\n> On Oct 15, 2008, at 3:51 PM, Lars Hoss wrote:\n>\n>>> Works for me on Leopard\n>>>\n>>> Vienna:a pieter$ git submodule add ~/projects/GitX/ gitx\n>>> Initialized empty Git repository in /Users/pieter/a/gitx/.git/\n>>> Vienna:a pieter$ git st\n>>> # On branch master\n>>> # Changes to be committed:\n>>> #   (use \"git reset HEAD <file>...\" to unstage)\n>>> #\n>>> #\tnew file:   .gitmodules\n>>> #\tnew file:   gitx\n>>> #\n>>> Vienna:a pieter$ git --version\n>>> git version 1.6.0.2.415.gf9137\n>>\n>> My git version \"1.6.0.2\" says:\n>>\n>> # On branch master\n>> # Changes to be committed:\n>> #   (use \"git reset HEAD <file>...\" to unstage)\n>> #\n>> #\tnew file:   .gitmodules\n>> #\tnew file:   lib\n>> #\n>> # Untracked files:\n>> #   (use \"git add <file>...\" to include in what will be committed)\n>> #\n>> #\tlib/\n>> git --version\n>> git version 1.6.0.2\n>>\n>> Git was build from macports.\n>\n> hmms.. Really, I know about fink and Macports and all others, but I'm\n> using Mac OS X since version 10.1 (when compiling OSS software was\n> near impossible due to Apple decisions) and I've always had better\n> results with compiling my own than using any of those OSS repositories.\n>\n> I understand the appeal, it seems easier, but I would recommend that\n> you compile yourself the software packages you depend on.\n>\n> Regarding git, I saw a git-build.sh script floating around. If you\n> cannot find it, you might want to try my own recipe\n> (http://tinyurl.com/4ayze6\n> ). I compile git master every day (cron) and thats the one I use on my\n> main machine.\n>\n> Best regards,\n> --\n> Pedro Melo\n> Blog: http://www.simplicidade.org/notes/\n> XMPP ID: melo@simplicidade.org\n> Use XMPP!\n>\n>\n>\n"},{"id":"93188","messageId":"48F7280C.3080205@viscovery.net","threadId":"15912","inReplyTo":"3520b7a9009f072cfc3aeb82ae205e6b.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-10-16T11:39:56Z","receivedAt":"2008-10-16T11:39:56Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Lars Hoss schrieb:\n> Ok, I compiled several git versions from the git repo with the following\n> results:\n> \n> v1.5.6.5 works\n> v1.6.0.2 fails\n> v1.6.0 fails\n> v1.6.0-rc0 fails\n...\n> So something between 1.5.6.5 and 1.6.0-rc0 broke it for me.\n> A quick diff between the two version revealed a lot of changes. Thus\n> tracking down the issue might not be easy for someone who is not involved\n> in the code.\n\nStart with:\n\n$ git bisect start v1.6.0-rc0 v1.5.6.5 v1.6.0~6^2 v1.6.0.2~16^2  # [*]\n\nand test the version that this command gives you. Then say either\n\n$ git bisect good  # if the version works\n$ git bisect bad   # if the version fails\n\nTest again and repeat until the command tells you \"First bad revision\nis...\" and report back. (Finally, say 'git bisect reset' to get you back\nto where you started.)\n\n[*] The revisions v1.6.0~6^2 v1.6.0.2~16^2 are from gitk and git-gui,\nwhich we assume are good.\n\n-- Hannes\n"},{"id":"93189","messageId":"c0d0f236cf60a006a7780058835737e2.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"48F7280C.3080205@viscovery.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-16T11:53:03Z","receivedAt":"2008-10-16T11:53:03Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":">> So something between 1.5.6.5 and 1.6.0-rc0 broke it for me.\n>> A quick diff between the two version revealed a lot of changes. Thus\n>> tracking down the issue might not be easy for someone who is not\n>> involved\n>> in the code.\n>\n> Start with:\n>\n> $ git bisect start v1.6.0-rc0 v1.5.6.5 v1.6.0~6^2 v1.6.0.2~16^2  # [*]\n>\n> and test the version that this command gives you. Then say either\n>\n> $ git bisect good  # if the version works\n> $ git bisect bad   # if the version fails\n>\n> Test again and repeat until the command tells you \"First bad revision\n> is...\" and report back. (Finally, say 'git bisect reset' to get you back\n> to where you started.)\n>\n> [*] The revisions v1.6.0~6^2 v1.6.0.2~16^2 are from gitk and git-gui,\n> which we assume are good.\n>\n> -- Hannes\n\nWow, thank you Hannes! Will do so.\n"},{"id":"93193","messageId":"8199b7ae4c441c4311045141ddaaa36f.squirrel@webmail.highteq.net","threadId":"15912","inReplyTo":"48F7280C.3080205@viscovery.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Lars Hoss","fromEmail":"lars@woeye.net","sentAt":"2008-10-16T12:30:00Z","receivedAt":"2008-10-16T12:30:00Z","isPatch":false,"sender":{"key":"lars@woeye.net","avatar":"https://gravatar.com/avatar/e862a9093727061e069dc50151eb0aed62bb0f09443a391113f93ee532bc4af8?d=mp&s=160"},"body":"Thanks again for your feedback, guys!\n\nOk, I've done it and tracked it down. Unfortunately my MacBook\nhas no access to the company network or internet (must get an iPhone ;-),\nso I cannot copy&paste my finding.\n\nFor now I can you give this:\n1.5.6.rc1.24.gd629 fails\n1.5.6.rc1.23.g6c2ce works\n\nThe commit was on Jun 5, 14:47:50 by Marius Storm-Olsen and the relevant\nfile is wt-status.c.\n\nOk, I think I found the issue. I enabled showUntrackedFiles in my gitconfig:\n\nstatus.showUntrackedFiles = all\n\nOn the one hand it makes sense to list submodule folder as untracked\nfiles. Then again it feels wrong because it is a registered submodule. Hm\n:-)\n\nAnyway, bisect is really impressive!\n\nYours,\nLars\n"},{"id":"93202","messageId":"20081016141812.GA30026@sigill.intra.peff.net","threadId":"15912","inReplyTo":"8199b7ae4c441c4311045141ddaaa36f.squirrel@webmail.highteq.net","subject":"Re: [BUG] git status doesn't handle submodules properly on OSX","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-16T14:18:13Z","receivedAt":"2008-10-16T14:18:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 16, 2008 at 02:30:00PM +0200, Lars Hoss wrote:\n\n> The commit was on Jun 5, 14:47:50 by Marius Storm-Olsen and the relevant\n> file is wt-status.c.\n> \n> Ok, I think I found the issue. I enabled showUntrackedFiles in my gitconfig:\n> \n> status.showUntrackedFiles = all\n\nAh, OK. I see what is going on. All code paths call the read_directory\ninfrastructure to find untracked files. If status.showUntrackedFiles is\n\"normal\", then we set dir.show_other_directories, to indicate that we\nwant to see the directories, but not their constituent files.\n\nIf status.showuntrackedfiles is set to \"all\", then we don't set the\nshow_other_directories flag, because we want each file. But the code in\ndir.c:treat_directory uses the \"show_other_directories\" flag to say \"oh,\nwe're just interested in untracked files\" and decide whether to ignore\ngitlinks.\n\nMeaning that we must still filter the results of read_directory based on\nthe cache. And indeed, this is what \"git ls-files -o\" does, as explained\nin 5698454e (Fix some \"git ls-files -o\" fallout from gitlinks). It's\nalso what the code in wt_status_print_untracked is _supposed_ to do, but\nit was never updated to handle this case when git-ls-files was. Which is\nprobably my fault a long time ago for cutting and pasting the 5 lines of\n\"is this thing in the cache\" when writing wt-status.c.\n\nSo the quick fix is to re-cut-and-paste the code:\n\ndiff --git a/wt-status.c b/wt-status.c\nindex d2eac36..792d5f1 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -280,10 +280,14 @@ static void wt_status_print_untracked(struct wt_status *s)\n \t\t/* check for matching entry, which is unmerged; lifted from\n \t\t * builtin-ls-files:show_other_files */\n \t\tstruct dir_entry *ent = dir.entries[i];\n-\t\tint pos = cache_name_pos(ent->name, ent->len);\n+\t\tint len, pos;\n+\t\tlen = ent->len;\n+\t\tif (len && ent->name[len-1] == '/')\n+\t\t\tlen--;\n+\t\tpos = cache_name_pos(ent->name, len);\n \t\tstruct cache_entry *ce;\n \t\tif (0 <= pos)\n-\t\t\tdie(\"bug in wt_status_print_untracked\");\n+\t\t\tcontinue;\n \t\tpos = -pos - 1;\n \t\tif (pos < active_nr) {\n \t\t\tce = active_cache[pos];\n\nBut the right solution is to refactor this so the code isn't duplicated.\nAnd I'll post a patch for that in a second.\n\nI do have to wonder, though, whether an even better solution would be to\nmore explicitly tell read_directory \"I'm interested only in 'other'\nfiles\" rather than relying on guessing based on\ndir.show_other_directories. Then we could just avoid ever passing these\ngitlinks back to ls-files and status in the first place.\n\n-Peff\n"},{"id":"93206","messageId":"20081016145916.GA31859@sigill.intra.peff.net","threadId":"15912","inReplyTo":"20081016141812.GA30026@sigill.intra.peff.net","subject":"[PATCH] refactor handling of \"other\" files in ls-files and status","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-16T14:59:16Z","receivedAt":"2008-10-16T14:59:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"When the \"git status\" display code was originally converted\nto C, we copied the code from ls-files to discover whether a\npathname returned by read_directory was an \"other\", or\nuntracked, file.\n\nMuch later, 5698454e updated the code in ls-files to handle\nsome new cases caused by gitlinks.  This left the code in\nwt-status.c broken: it would display submodule directories\nas untracked directories. Nobody noticed until now, however,\nbecause unless status.showUntrackedFiles was set to \"all\",\nsubmodule directories were not actually reported by\nread_directory. So the bug was only triggered in the\npresence of a submodule _and_ this config option.\n\nThis patch pulls the ls-files code into a new function,\ncache_name_is_other, and uses it in both places. This should\nleave the ls-files functionality the same and fix the bug\nin status.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nOn Thu, Oct 16, 2008 at 10:18:13AM -0400, Jeff King wrote:\n\n> But the right solution is to refactor this so the code isn't duplicated.\n> And I'll post a patch for that in a second.\n\nHere it is.\n\n> I do have to wonder, though, whether an even better solution would be to\n> more explicitly tell read_directory \"I'm interested only in 'other'\n> files\" rather than relying on guessing based on\n> dir.show_other_directories. Then we could just avoid ever passing these\n> gitlinks back to ls-files and status in the first place.\n\nI was thinking such a change would get rid of the need for my patch,\nsince all files returned _would_ be \"others\". However, we would still\nneed to deal with the \"unmerged entries\" problem, so I think this\nrefactoring is worth it regardless.\n\n builtin-ls-files.c |   33 ++-------------------------------\n cache.h            |    2 ++\n read-cache.c       |   27 +++++++++++++++++++++++++++\n t/t7502-status.sh  |    6 ++++++\n wt-status.c        |   15 ++-------------\n 5 files changed, 39 insertions(+), 44 deletions(-)\n\ndiff --git a/builtin-ls-files.c b/builtin-ls-files.c\nindex 068f424..b48327d 100644\n--- a/builtin-ls-files.c\n+++ b/builtin-ls-files.c\n@@ -91,39 +91,10 @@ static void show_other_files(struct dir_struct *dir)\n {\n \tint i;\n \n-\n-\t/*\n-\t * Skip matching and unmerged entries for the paths,\n-\t * since we want just \"others\".\n-\t *\n-\t * (Matching entries are normally pruned during\n-\t * the directory tree walk, but will show up for\n-\t * gitlinks because we don't necessarily have\n-\t * dir->show_other_directories set to suppress\n-\t * them).\n-\t */\n \tfor (i = 0; i < dir->nr; i++) {\n \t\tstruct dir_entry *ent = dir->entries[i];\n-\t\tint len, pos;\n-\t\tstruct cache_entry *ce;\n-\n-\t\t/*\n-\t\t * Remove the '/' at the end that directory\n-\t\t * walking adds for directory entries.\n-\t\t */\n-\t\tlen = ent->len;\n-\t\tif (len && ent->name[len-1] == '/')\n-\t\t\tlen--;\n-\t\tpos = cache_name_pos(ent->name, len);\n-\t\tif (0 <= pos)\n-\t\t\tcontinue;\t/* exact match */\n-\t\tpos = -pos - 1;\n-\t\tif (pos < active_nr) {\n-\t\t\tce = active_cache[pos];\n-\t\t\tif (ce_namelen(ce) == len &&\n-\t\t\t    !memcmp(ce->name, ent->name, len))\n-\t\t\t\tcontinue; /* Yup, this one exists unmerged */\n-\t\t}\n+\t\tif (!cache_name_is_other(ent->name, ent->len))\n+\t\t\tcontinue;\n \t\tshow_dir_entry(tag_other, ent);\n \t}\n }\ndiff --git a/cache.h b/cache.h\nindex 991544c..ae6647e 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -277,6 +277,7 @@ static inline void remove_name_hash(struct cache_entry *ce)\n #define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))\n #define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))\n #define cache_name_exists(name, namelen, igncase) index_name_exists(&the_index, (name), (namelen), (igncase))\n+#define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))\n #endif\n \n enum object_type {\n@@ -393,6 +394,7 @@ extern int add_to_index(struct index_state *, const char *path, struct stat *, i\n extern int add_file_to_index(struct index_state *, const char *path, int flags);\n extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, int refresh);\n extern int ce_same_name(struct cache_entry *a, struct cache_entry *b);\n+extern int index_name_is_other(const struct index_state *, const char *, int);\n \n /* do stat comparison even if CE_VALID is true */\n #define CE_MATCH_IGNORE_VALID\t\t01\ndiff --git a/read-cache.c b/read-cache.c\nindex c229fd4..780f2c7 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1565,3 +1565,30 @@ int add_files_to_cache(const char *prefix, const char **pathspec, int flags)\n \treturn !!data.add_errors;\n }\n \n+/*\n+ * Returns 1 if the path is an \"other\" path with respect to\n+ * the index; that is, the path is not mentioned in the index at all,\n+ * either as a file, a directory with some files in the index,\n+ * or as an unmerged entry.\n+ *\n+ * We helpfully remove a trailing \"/\" from directories so that\n+ * the output of read_directory can be used as-is.\n+ */\n+int index_name_is_other(const struct index_state *istate, const char *name,\n+\t\tint namelen)\n+{\n+\tint pos;\n+\tif (namelen && name[namelen - 1] == '/')\n+\t\tnamelen--;\n+\tpos = index_name_pos(istate, name, namelen);\n+\tif (0 <= pos)\n+\t\treturn 0;\t/* exact match */\n+\tpos = -pos - 1;\n+\tif (pos < istate->cache_nr) {\n+\t\tstruct cache_entry *ce = istate->cache[pos];\n+\t\tif (ce_namelen(ce) == namelen &&\n+\t\t    !memcmp(ce->name, name, namelen))\n+\t\t\treturn 0; /* Yup, this one exists unmerged */\n+\t}\n+\treturn 1;\n+}\ndiff --git a/t/t7502-status.sh b/t/t7502-status.sh\nindex 1905fb3..93f875f 100755\n--- a/t/t7502-status.sh\n+++ b/t/t7502-status.sh\n@@ -292,6 +292,12 @@ test_expect_success 'status submodule summary is disabled by default' '\n \ttest_cmp expect output\n '\n \n+# we expect the same as the previous test\n+test_expect_success 'status --untracked-files=all does not show submodule' '\n+\tgit status --untracked-files=all >output &&\n+\ttest_cmp expect output\n+'\n+\n head=$(cd sm && git rev-parse --short=7 --verify HEAD)\n \n cat >expect <<EOF\ndiff --git a/wt-status.c b/wt-status.c\nindex d2eac36..c3a9cab 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -277,20 +277,9 @@ static void wt_status_print_untracked(struct wt_status *s)\n \n \tread_directory(&dir, \".\", \"\", 0, NULL);\n \tfor(i = 0; i < dir.nr; i++) {\n-\t\t/* check for matching entry, which is unmerged; lifted from\n-\t\t * builtin-ls-files:show_other_files */\n \t\tstruct dir_entry *ent = dir.entries[i];\n-\t\tint pos = cache_name_pos(ent->name, ent->len);\n-\t\tstruct cache_entry *ce;\n-\t\tif (0 <= pos)\n-\t\t\tdie(\"bug in wt_status_print_untracked\");\n-\t\tpos = -pos - 1;\n-\t\tif (pos < active_nr) {\n-\t\t\tce = active_cache[pos];\n-\t\t\tif (ce_namelen(ce) == ent->len &&\n-\t\t\t    !memcmp(ce->name, ent->name, ent->len))\n-\t\t\t\tcontinue;\n-\t\t}\n+\t\tif (!cache_name_is_other(ent->name, ent->len))\n+\t\t\tcontinue;\n \t\tif (!shown_header) {\n \t\t\ts->workdir_untracked = 1;\n \t\t\twt_status_print_untracked_header(s);\n-- \n1.6.0.2.710.gc3f34.dirty\n"},{"id":"93208","messageId":"20081016150726.GB31859@sigill.intra.peff.net","threadId":"15912","inReplyTo":"20081016145916.GA31859@sigill.intra.peff.net","subject":"Re: [PATCH] refactor handling of \"other\" files in ls-files and status","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-16T15:07:26Z","receivedAt":"2008-10-16T15:07:26Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 16, 2008 at 10:59:16AM -0400, Jeff King wrote:\n\n> This patch pulls the ls-files code into a new function,\n> cache_name_is_other, and uses it in both places. This should\n> leave the ls-files functionality the same and fix the bug\n> in status.\n\nBTW, this is probably maint-worthy, but I prepared it on 'master'.\nUnfortunately, there is a purely textual conflict when applying to\nmaint. For your convenience, here's a rebase to maint:\n\n-- >8 --\nrefactor handling of \"other\" files in ls-files and status\n\nWhen the \"git status\" display code was originally converted\nto C, we copied the code from ls-files to discover whether a\npathname returned by read_directory was an \"other\", or\nuntracked, file.\n\nMuch later, 5698454e updated the code in ls-files to handle\nsome new cases caused by gitlinks.  This left the code in\nwt-status.c broken: it would display submodule directories\nas untracked directories. Nobody noticed until now, however,\nbecause unless status.showUntrackedFiles was set to \"all\",\nsubmodule directories were not actually reported by\nread_directory. So the bug was only triggered in the\npresence of a submodule _and_ this config option.\n\nThis patch pulls the ls-files code into a new function,\ncache_name_is_other, and uses it in both places. This should\nleave the ls-files functionality the same and fix the bug\nin status.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n builtin-ls-files.c |   33 ++-------------------------------\n cache.h            |    2 ++\n read-cache.c       |   28 ++++++++++++++++++++++++++++\n t/t7502-status.sh  |    6 ++++++\n wt-status.c        |   15 ++-------------\n 5 files changed, 40 insertions(+), 44 deletions(-)\n\ndiff --git a/builtin-ls-files.c b/builtin-ls-files.c\nindex 068f424..b48327d 100644\n--- a/builtin-ls-files.c\n+++ b/builtin-ls-files.c\n@@ -91,39 +91,10 @@ static void show_other_files(struct dir_struct *dir)\n {\n \tint i;\n \n-\n-\t/*\n-\t * Skip matching and unmerged entries for the paths,\n-\t * since we want just \"others\".\n-\t *\n-\t * (Matching entries are normally pruned during\n-\t * the directory tree walk, but will show up for\n-\t * gitlinks because we don't necessarily have\n-\t * dir->show_other_directories set to suppress\n-\t * them).\n-\t */\n \tfor (i = 0; i < dir->nr; i++) {\n \t\tstruct dir_entry *ent = dir->entries[i];\n-\t\tint len, pos;\n-\t\tstruct cache_entry *ce;\n-\n-\t\t/*\n-\t\t * Remove the '/' at the end that directory\n-\t\t * walking adds for directory entries.\n-\t\t */\n-\t\tlen = ent->len;\n-\t\tif (len && ent->name[len-1] == '/')\n-\t\t\tlen--;\n-\t\tpos = cache_name_pos(ent->name, len);\n-\t\tif (0 <= pos)\n-\t\t\tcontinue;\t/* exact match */\n-\t\tpos = -pos - 1;\n-\t\tif (pos < active_nr) {\n-\t\t\tce = active_cache[pos];\n-\t\t\tif (ce_namelen(ce) == len &&\n-\t\t\t    !memcmp(ce->name, ent->name, len))\n-\t\t\t\tcontinue; /* Yup, this one exists unmerged */\n-\t\t}\n+\t\tif (!cache_name_is_other(ent->name, ent->len))\n+\t\t\tcontinue;\n \t\tshow_dir_entry(tag_other, ent);\n \t}\n }\ndiff --git a/cache.h b/cache.h\nindex 884fae8..76730ce 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -270,6 +270,7 @@ static inline void remove_name_hash(struct cache_entry *ce)\n #define ce_match_stat(ce, st, options) ie_match_stat(&the_index, (ce), (st), (options))\n #define ce_modified(ce, st, options) ie_modified(&the_index, (ce), (st), (options))\n #define cache_name_exists(name, namelen, igncase) index_name_exists(&the_index, (name), (namelen), (igncase))\n+#define cache_name_is_other(name, namelen) index_name_is_other(&the_index, (name), (namelen))\n #endif\n \n enum object_type {\n@@ -382,6 +383,7 @@ extern int add_to_index(struct index_state *, const char *path, struct stat *, i\n extern int add_file_to_index(struct index_state *, const char *path, int flags);\n extern struct cache_entry *make_cache_entry(unsigned int mode, const unsigned char *sha1, const char *path, int stage, int refresh);\n extern int ce_same_name(struct cache_entry *a, struct cache_entry *b);\n+extern int index_name_is_other(const struct index_state *, const char *, int);\n \n /* do stat comparison even if CE_VALID is true */\n #define CE_MATCH_IGNORE_VALID\t\t01\ndiff --git a/read-cache.c b/read-cache.c\nindex 8f96fd1..4e067e4 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1480,3 +1480,31 @@ int read_index_unmerged(struct index_state *istate)\n \tistate->cache_nr = dst - istate->cache;\n \treturn !!last;\n }\n+\n+/*\n+ * Returns 1 if the path is an \"other\" path with respect to\n+ * the index; that is, the path is not mentioned in the index at all,\n+ * either as a file, a directory with some files in the index,\n+ * or as an unmerged entry.\n+ *\n+ * We helpfully remove a trailing \"/\" from directories so that\n+ * the output of read_directory can be used as-is.\n+ */\n+int index_name_is_other(const struct index_state *istate, const char *name,\n+\t\tint namelen)\n+{\n+\tint pos;\n+\tif (namelen && name[namelen - 1] == '/')\n+\t\tnamelen--;\n+\tpos = index_name_pos(istate, name, namelen);\n+\tif (0 <= pos)\n+\t\treturn 0;\t/* exact match */\n+\tpos = -pos - 1;\n+\tif (pos < istate->cache_nr) {\n+\t\tstruct cache_entry *ce = istate->cache[pos];\n+\t\tif (ce_namelen(ce) == namelen &&\n+\t\t    !memcmp(ce->name, name, namelen))\n+\t\t\treturn 0; /* Yup, this one exists unmerged */\n+\t}\n+\treturn 1;\n+}\ndiff --git a/t/t7502-status.sh b/t/t7502-status.sh\nindex c8e4c2e..187a13e 100755\n--- a/t/t7502-status.sh\n+++ b/t/t7502-status.sh\n@@ -285,6 +285,12 @@ test_expect_success 'status submodule summary is disabled by default' '\n \ttest_cmp expect output\n '\n \n+# we expect the same as the previous test\n+test_expect_success 'status --untracked-files=all does not show submodule' '\n+\tgit status --untracked-files=all >output &&\n+\ttest_cmp expect output\n+'\n+\n head=$(cd sm && git rev-parse --short=7 --verify HEAD)\n \n cat >expect <<EOF\ndiff --git a/wt-status.c b/wt-status.c\nindex 889e50f..64cedfc 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -275,20 +275,9 @@ static void wt_status_print_untracked(struct wt_status *s)\n \n \tread_directory(&dir, \".\", \"\", 0, NULL);\n \tfor(i = 0; i < dir.nr; i++) {\n-\t\t/* check for matching entry, which is unmerged; lifted from\n-\t\t * builtin-ls-files:show_other_files */\n \t\tstruct dir_entry *ent = dir.entries[i];\n-\t\tint pos = cache_name_pos(ent->name, ent->len);\n-\t\tstruct cache_entry *ce;\n-\t\tif (0 <= pos)\n-\t\t\tdie(\"bug in wt_status_print_untracked\");\n-\t\tpos = -pos - 1;\n-\t\tif (pos < active_nr) {\n-\t\t\tce = active_cache[pos];\n-\t\t\tif (ce_namelen(ce) == ent->len &&\n-\t\t\t    !memcmp(ce->name, ent->name, ent->len))\n-\t\t\t\tcontinue;\n-\t\t}\n+\t\tif (!cache_name_is_other(ent->name, ent->len))\n+\t\t\tcontinue;\n \t\tif (!shown_header) {\n \t\t\ts->workdir_untracked = 1;\n \t\t\twt_status_print_header(s, \"Untracked files\",\n-- \n1.6.0.2.710.gc3f34.dirty\n"},{"id":"93325","messageId":"7vtzbaepu2.fsf@gitster.siamese.dyndns.org","threadId":"15912","inReplyTo":"20081016145916.GA31859@sigill.intra.peff.net","subject":"Re: [PATCH] refactor handling of \"other\" files in ls-files and status","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-10-17T23:58:45Z","receivedAt":"2008-10-17T23:58:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}