{"thread":{"id":"33366","subject":"cd","startedAt":"2013-04-03T14:49:07Z","lastAt":"2013-04-03T22:55:49Z","messageCount":2,"participants":["jpinheiro","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"213037","messageId":"1365000547327-7581484.post@n2.nabble.com","threadId":"33366","inReplyTo":null,"subject":"cd","fromName":"jpinheiro","fromEmail":"7jpinheiro@gmail.com","sentAt":"2013-04-03T14:49:07Z","receivedAt":"2013-04-03T14:49:07Z","isPatch":false,"sender":{"key":"7jpinheiro@gmail.com","avatar":null},"body":"Hi all,\n\nWe are students from Universidade do Minho in Portugal, and we are using git\nin project as a case study.\nWhile experimenting with git we found an unexpected behavior with git rm.\nHere is a trace of the unexpected behavior:\n\n$ git init\n$ mkdir D\n$ echo \"Hi\" > D/F\n$ git add D/F\n$ rm -r D\n$ echo \"Hey\" > D\n$ git rm D/F\nwarning: 'D/F': Not a directory\nrm 'D/F'\nfatal: git rm: 'D/F': Not a directory\n\n\nIf the file D created with last echo did not exist or was named differently\nthen no error would occur as expected. For example:\n\n$ git init\n$ mkdir D\n$ echo \"Hi\" > D/F\n$ git add D/F\n$ rm -r D\n$ echo \"Hey\" > F\n$ git rm D/F\n\nThis works as expected, and the only difference is the name of the file of\nthe last echo.\nIs this the expected behavior of git rm?\n\n\n\n\n--\nView this message in context: http://git.661346.n2.nabble.com/cd-tp7581484.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"213075","messageId":"515CB375.9010104@op5.se","threadId":"33366","inReplyTo":"1365000547327-7581484.post@n2.nabble.com","subject":"Re: cd","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2013-04-03T22:55:49Z","receivedAt":"2013-04-03T22:55:49Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"On 04/03/2013 04:49 PM, jpinheiro wrote:\n> Hi all,\n>\n> We are students from Universidade do Minho in Portugal, and we are using git\n> in project as a case study.\n> While experimenting with git we found an unexpected behavior with git rm.\n> Here is a trace of the unexpected behavior:\n>\n> $ git init\n> $ mkdir D\n> $ echo \"Hi\" > D/F\n> $ git add D/F\n> $ rm -r D\n> $ echo \"Hey\" > D\n> $ git rm D/F\n> warning: 'D/F': Not a directory\n> rm 'D/F'\n> fatal: git rm: 'D/F': Not a directory\n>\n>\n> If the file D created with last echo did not exist or was named differently\n> then no error would occur as expected. For example:\n>\n> $ git init\n> $ mkdir D\n> $ echo \"Hi\" > D/F\n> $ git add D/F\n> $ rm -r D\n> $ echo \"Hey\" > F\n> $ git rm D/F\n>\n> This works as expected, and the only difference is the name of the file of\n> the last echo.\n> Is this the expected behavior of git rm?\n>\n\nYes. The only difference between 'git rm' and 'rm' is that git rm also\nremoves the file from its index and prepares to commit a version without\nit. From git's point of view, it's not an error if the file doesn't\nexist. It *is* an error if the directory where the file should reside\nsuddenly no longer a directory though.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"}]}