{"thread":{"id":"54761","subject":"diff-filter=R can't identify renaming if not done directly","startedAt":"2020-12-04T14:38:16Z","lastAt":"2020-12-04T20:07:53Z","messageCount":2,"participants":["Sofia Syrianidou","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"411330","messageId":"19eb8038-20d6-385f-50e5-26c7a0bd8e90@suse.com","threadId":"54761","inReplyTo":null,"subject":"diff-filter=R can't identify renaming if not done directly","fromName":"Sofia Syrianidou","fromEmail":"sofia.syrianidou@suse.com","sentAt":"2020-12-04T14:37:02Z","receivedAt":"2020-12-04T14:38:16Z","isPatch":false,"sender":{"key":"sofia.syrianidou@suse.com","avatar":null},"body":"Hello, quick question about using diff-filter in linux. In the scenario\nthat in my repository, I first copy file1 to file2, then move file2 to\nfile3 and delete file1, \"git diff\" returns\n\n\ndiff --git a/file1 b/file3\n\nsimilarity index 100%\n\nrename from file 1\n\nrename to file3\n\n\n  but running \"git diff --diff-filter=r\" doesn't return anything. Only\nflag T will return the change. Can this be considered as a bug?\n\n"},{"id":"411370","messageId":"xmqqlfede3o8.fsf@gitster.c.googlers.com","threadId":"54761","inReplyTo":"19eb8038-20d6-385f-50e5-26c7a0bd8e90@suse.com","subject":"Re: diff-filter=R can't identify renaming if not done directly","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-12-04T20:07:03Z","receivedAt":"2020-12-04T20:07:53Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sofia Syrianidou <sofia.syrianidou@suse.com> writes:\n\n> Hello, quick question about using diff-filter in linux. In the scenario\n> that in my repository, I first copy file1 to file2, then move file2 to\n> file3 and delete file1, \"git diff\" returns\n>\n>\n> diff --git a/file1 b/file3\n>\n> similarity index 100%\n>\n> rename from file 1\n>\n> rename to file3\n>\n>\n>   but running \"git diff --diff-filter=r\" doesn't return anything. Only\n> flag T will return the change. Can this be considered as a bug?\n\n\"git diff --diff-filter=r\" and \"git diff --diff-filter=R\" have\ntotally opposite meanings.  I expect nothing to be shown if all your\nchanges are renames and you ask to exclude all the renamed filepairs\nfrom the output with \"--diff-filter=r\".  In other words, this seems\nto be working as intended.\n\nThanks.\n\n"}]}