{"thread":{"id":"35108","subject":"BUG - git clean","startedAt":"2013-10-11T18:53:08Z","lastAt":"2013-10-12T10:36:39Z","messageCount":2,"participants":["jones.noamle","Di Xu"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"228749","messageId":"52584914.6030103@gmail.com","threadId":"35108","inReplyTo":null,"subject":"BUG - git clean","fromName":"jones.noamle","fromEmail":"lenoam@gmail.com","sentAt":"2013-10-11T18:53:08Z","receivedAt":"2013-10-11T18:53:08Z","isPatch":false,"sender":{"key":"lenoam@gmail.com","avatar":null},"body":"Passing to git clean wrong (non-existent) paths together with valid \nones, causes it to delete stuff that it shouldn't.\nAm I right?\nScript to reproduce:\n\nmkdir test\ncd test\ngit init .\nmkdir ba\nmkdir ba/ca\n\n# So far so good.\n# Should clean directory \"ba/ca\"\ngit clean -dn -- ba/ca\n\n# Should clean \"ba/ca\" and ignore non-existent \"j\"\n# Instead, it wants to delete \"ba\" totally.\ngit clean -dn -- ba/ca j\n\ngit --version\n\n---------------------------------------------------------------------\nOutput:\n\n+ mkdir test\n+ cd test\n+ git init .\nInitialized empty Git repository in /home/notroot/test/.git/\n+ mkdir ba\n+ mkdir ba/ca\n+ git clean -dn -- ba/ca\nWould remove ba/ca/\n+ git clean -dn -- ba/ca j\nWould remove ba/\n+ git --version\ngit version 1.7.9.5\n\n---------------------------------------------------------------------\n\nThanks!\nNoam\n"},{"id":"228876","messageId":"loom.20131012T122854-19@post.gmane.org","threadId":"35108","inReplyTo":"52584914.6030103@gmail.com","subject":"Re: BUG - git clean","fromName":"Di Xu","fromEmail":"xudifsd@gmail.com","sentAt":"2013-10-12T10:36:39Z","receivedAt":"2013-10-12T10:36:39Z","isPatch":false,"sender":{"key":"xudifsd@gmail.com","avatar":"https://gravatar.com/avatar/260814589d486b8dba6ff105f193d831bf9de466d688a20c53f7a516c7ffe146?d=mp&s=160"},"body":"> mkdir test\n> cd test\n> git init .\n> mkdir ba\n> mkdir ba/ca\n> \n> # So far so good.\n> # Should clean directory \"ba/ca\"\n> git clean -dn -- ba/ca\n> \n> # Should clean \"ba/ca\" and ignore non-existent \"j\"\n> # Instead, it wants to delete \"ba\" totally.\n> git clean -dn -- ba/ca j\n\nactually, my git will also do it wrong when 'j' exist, do\nthese after your script:\n\n$ git clean -dn ba/ca j\nWould remove ba/\n$ mkdir j\n$ git clean -dn ba/ca j\nWould remove ba/ #here missing 'ca'\nWould remove j/\n\nI think it's the problem of directory path manipulation.\n"}]}