{"thread":{"id":"60372","subject":"git log --patch for a particular file","startedAt":"2023-10-16T10:20:47Z","lastAt":"2023-10-16T10:30:08Z","messageCount":2,"participants":["Victor Porton","Kristoffer Haugsbakk"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483300","messageId":"75545e1c-ce62-4b49-983e-1e7b1afb2fab@gmail.com","threadId":"60372","inReplyTo":null,"subject":"git log --patch for a particular file","fromName":"Victor Porton","fromEmail":"porton.victor@gmail.com","sentAt":"2023-10-16T10:20:41Z","receivedAt":"2023-10-16T10:20:47Z","isPatch":false,"sender":{"key":"porton.victor@gmail.com","avatar":null},"body":"I want this:\n\ngit log --patch -- server/src/api/docs.py\n\nto print changes only for the file server/src/api/docs.py.\n\nCurrently, it in some reasons outputs nothing (this seems not to be an \nintended behavior and could be counted as a bug).\n\nMore generally,\ngit log --patch -- A B C\ncould log changes in files A, B, C (only).\n\nIt is questionable, whether to output commit information (commit hash, \nuser email, etc.) for commits that don't change specified file(s). I \nwould vote to indeed output this information, not to confuse the user \nabout the order of commits.\n"},{"id":"483301","messageId":"d34d9b64-4760-43e8-975c-a3ef53048530@app.fastmail.com","threadId":"60372","inReplyTo":"75545e1c-ce62-4b49-983e-1e7b1afb2fab@gmail.com","subject":"Re: git log --patch for a particular file","fromName":"Kristoffer Haugsbakk","fromEmail":"code@khaugsbakk.name","sentAt":"2023-10-16T10:29:43Z","receivedAt":"2023-10-16T10:30:08Z","isPatch":false,"sender":{"key":"code@khaugsbakk.name","avatar":"https://avatars.githubusercontent.com/u/2229597?v=4"},"body":"Hi\n\nOn Mon, Oct 16, 2023, at 12:20, Victor Porton wrote:\n> I want this:\n>\n> git log --patch -- server/src/api/docs.py\n>\n> to print changes only for the file server/src/api/docs.py.\n\nThat's how it works for me.\n\n> Currently, it in some reasons outputs nothing (this seems not to be an\n> intended behavior and could be counted as a bug).\n\nDoes it output nothing on *merge* commits? That's intended.\n\nTry using `-m` as well.\n\nhttps://stackoverflow.com/a/37801468/1725151\n\n> It is questionable, whether to output commit information (commit hash,\n> user email, etc.) for commits that don't change specified file(s). I\n> would vote to indeed output this information, not to confuse the user\n> about the order of commits.\n\nYou can customize the output with `--format=`.\n\n> More generally,\n> git log --patch -- A B C\n> could log changes in files A, B, C (only).\n\nIf I name two files I only get commits that touch any of those files. And\ndiffs only for them.\n\n-- \nKristoffer Haugsbakk\n"}]}