{"thread":{"id":"57825","subject":"Merge diff always misses the `\\ No newline at end of file` mark","startedAt":"2022-04-30T15:05:21Z","lastAt":"2022-04-30T15:05:21Z","messageCount":1,"participants":["Danil Pristupov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"454681","messageId":"CAKdzDnk4FFPedTQ4fG1c-BZ4ST99E1ucx664r_oc-5123P6ovA@mail.gmail.com","threadId":"57825","inReplyTo":null,"subject":"Merge diff always misses the `\\ No newline at end of file` mark","fromName":"Danil Pristupov","fromEmail":"danil@danil.cz","sentAt":"2022-04-30T15:05:06Z","receivedAt":"2022-04-30T15:05:21Z","isPatch":false,"sender":{"key":"danil@danil.cz","avatar":"https://gravatar.com/avatar/0c17c2eda2eaabbcc09a02149bedaff23bc8894c7be16e6b25d6602abfc34243?d=mp&s=160"},"body":"For files with conflicts `git diff -- filename` always returns result\nwithout the `No newline at end of file` mark.\n\nI was able to reproduce this with all git versions on all platforms.\n\nSteps to reproduce (macOS, 2.32.0 (Apple Git-132)):\n\n```\ngit init\necho \"line1\\nline2\" > eol.txt\necho -n \"line1\\nline2\" > noeol.txt\ngit add .\ngit commit -m \"initial\"\ngit branch br1\necho \"line11\\nline2\" > eol.txt\necho -n \"line11\\nline2\" > noeol.txt\ngit add .\ngit commit -m \"line1\"\ngit checkout br1\necho \"line12\\nline2\" > eol.txt\necho -n \"line12\\nline2\" > noeol.txt\ngit add .\ngit commit -m \"line2\"\ngit merge master\ngit diff -- eol.txt > eol.diff\ngit diff -- noeol.txt > noeol.diff\n```\n\nExpected behavior: `noeol.diff` should have `\\ No newline at end of file` mark\n\nActual behavior: Both `eol.diff` and `noeol.diff` have no `\\ No\nnewline at end of file` mark\n\nThis is my first bug report. Please let me know if I'm missing something.\n"}]}