{"thread":{"id":"37246","subject":"Bug report about symlinks","startedAt":"2014-07-30T11:30:00Z","lastAt":"2014-08-01T19:10:59Z","messageCount":2,"participants":["NickKolok","Dennis Kaarsemaker"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"246962","messageId":"1406719800.686251712@f362.i.mail.ru","threadId":"37246","inReplyTo":null,"subject":"Bug report about symlinks","fromName":"NickKolok","fromEmail":"nickkolok@mail.ru","sentAt":"2014-07-30T11:30:00Z","receivedAt":"2014-07-30T11:30:00Z","isPatch":false,"sender":{"key":"nickkolok@mail.ru","avatar":null},"body":" Greetings from Russia, comrads!\n\nI've noticed something strange with git status when replacing a folder with symlink to another folder.\nThere is a git repo with script with demo in the attachment.\n\nYours sincerely,\nNickKolok aka Nikolay Avdeev.\n\nДоброго времени суток, товарищи!\n\nПри замене папки на симлинк на другую папку с похожими, но не одинаковыми файлами git status ведёт себя странно.\nПрилагаю архив с репозиторием. В скрипте - пример и пояснения.\n\nС уважением,\nНиколай Авдеев aka NickKolok."},{"id":"247124","messageId":"1406920259.3253.7.camel@spirit","threadId":"37246","inReplyTo":"1406719800.686251712@f362.i.mail.ru","subject":"Re: Bug report about symlinks","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2014-08-01T19:10:59Z","receivedAt":"2014-08-01T19:10:59Z","isPatch":false,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On wo, 2014-07-30 at 15:30 +0400, NickKolok wrote:\n> Greetings from Russia, comrads!\n> \n> I've noticed something strange with git status when replacing a folder with symlink to another folder.\n> There is a git repo with script with demo in the attachment.\n\nI think there is a bug here:\n\n+ mkdir bug\n+ cd bug\n+ git init\nInitialized empty Git repository in /tmp/bug/.git/\n+ mkdir dir1 dir2\n+ echo 1\n+ echo 1\n+ echo 2a\n+ echo 2b\n+ git add dir1/1.txt dir1/2.txt dir2/1.txt dir2/2.txt\n+ git commit -m first\n[master (root-commit) b60ecc8] first\n 4 files changed, 4 insertions(+)\n create mode 100644 dir1/1.txt\n create mode 100644 dir1/2.txt\n create mode 100644 dir2/1.txt\n create mode 100644 dir2/2.txt\n+ rm -r dir2\n+ ln -s dir1 dir2\n+ git status\nOn branch master\nChanges not staged for commit:\n  (use \"git add/rm <file>...\" to update what will be committed)\n  (use \"git checkout -- <file>...\" to discard changes in working\ndirectory)\n\n\tdeleted:    dir2/2.txt\n\nUntracked files:\n  (use \"git add <file>...\" to include in what will be committed)\n\n\tdir2\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nIt looks like git status is thinking dir2/1.txt still exists with the\nsame content, even though dir2 is gone, and now an untracked symlink. \n\nMoreover, git diff and git status disagree with each other:\n\ndennis@spirit:/tmp/bug$ git status\nOn branch master\nChanges not staged for commit:\n  (use \"git add/rm <file>...\" to update what will be committed)\n  (use \"git checkout -- <file>...\" to discard changes in working\ndirectory)\n\n\tdeleted:    dir2/2.txt\n\nUntracked files:\n  (use \"git add <file>...\" to include in what will be committed)\n\n\tdir2\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\ndennis@spirit:/tmp/bug$ git --no-pager diff\ndiff --git a/dir2/1.txt b/dir2/1.txt\ndeleted file mode 100644\nindex d00491f..0000000\n--- a/dir2/1.txt\n+++ /dev/null\n@@ -1 +0,0 @@\n-1\ndiff --git a/dir2/2.txt b/dir2/2.txt\ndeleted file mode 100644\nindex b8a4cf4..0000000\n--- a/dir2/2.txt\n+++ /dev/null\n@@ -1 +0,0 @@\n-2b\n\n-- \nDennis Kaarsemaker\nwww.kaarsemaker.net\n"}]}