{"thread":{"id":"14093","subject":"git blame for a commit","startedAt":"2008-06-22T22:32:05Z","lastAt":"2008-06-23T16:29:21Z","messageCount":6,"participants":["Mircea Bardac","Ian Hilt","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"80651","messageId":"485ED2E5.3070906@mircea.bardac.net","threadId":"14093","inReplyTo":null,"subject":"git blame for a commit","fromName":"Mircea Bardac","fromEmail":"dev@mircea.bardac.net","sentAt":"2008-06-22T22:32:05Z","receivedAt":"2008-06-22T22:32:05Z","isPatch":false,"sender":{"key":"dev@mircea.bardac.net","avatar":"https://gravatar.com/avatar/9cf887bf86f677aafb60f450e5898c0342283ebf3633c9bdbec1233256f2510f?d=mp&s=160"},"body":"Hi everyone,\n\nIs there any straightforward way of doing git blame for all the files \nthat got changed in a commit. Problems are renames, deletes and copies.\n\nI was also thinking of git diff with a huge number of context lines, but \nthis one feels a bit hacking. \"git diff\" is also missing author info, so \n\"git blame\" is a bit more desirable.\n\nHas anyone ever done this before?\n\nMany thanks.\n\n-- \nMircea\nhttp://mircea.bardac.net\n"},{"id":"80671","messageId":"alpine.LFD.1.10.0806222300410.23258@sys-0.hiltweb.site","threadId":"14093","inReplyTo":"485ED2E5.3070906@mircea.bardac.net","subject":"Re: git blame for a commit","fromName":"Ian Hilt","fromEmail":"ian.hilt@gmx.com","sentAt":"2008-06-23T03:40:26Z","receivedAt":"2008-06-23T03:40:26Z","isPatch":false,"sender":{"key":"ian.hilt@gmx.com","avatar":null},"body":"On Sun, 22 Jun 2008 at 11:32pm +0100, Mircea Bardac wrote:\n\n> Hi everyone,\n> \n> Is there any straightforward way of doing git blame for all the files that got\n> changed in a commit. Problems are renames, deletes and copies.\n\nSounds like you want to track files rather than content.  Git tracks the\nlatter.\n\n> I was also thinking of git diff with a huge number of context lines, but this\n> one feels a bit hacking. \"git diff\" is also missing author info, so \"git\n> blame\" is a bit more desirable.\n> \n> Has anyone ever done this before?\n> \n> Many thanks.\n\nTry \"git diff --name-only commit1..commit2\" or \"git log --name-only\ncommit1..commit2\".  This will give you only the names of the files in\nwhich content was altered.  Other than that, I think you should re-read\n(hint) git-blame(1).  It's focus is on content, not files as a whole.\n\n\n--\nIan Hilt\nIan.Hilt (at) gmx.com\nGnuPG key: 0x4AFC1EE3\n"},{"id":"80686","messageId":"485F6710.1080300@mircea.bardac.net","threadId":"14093","inReplyTo":"alpine.LFD.1.10.0806222300410.23258@sys-0.hiltweb.site","subject":"Re: git blame for a commit","fromName":"Mircea Bardac","fromEmail":"dev@mircea.bardac.net","sentAt":"2008-06-23T09:04:16Z","receivedAt":"2008-06-23T09:04:16Z","isPatch":false,"sender":{"key":"dev@mircea.bardac.net","avatar":"https://gravatar.com/avatar/9cf887bf86f677aafb60f450e5898c0342283ebf3633c9bdbec1233256f2510f?d=mp&s=160"},"body":"Ian Hilt wrote:\n> On Sun, 22 Jun 2008 at 11:32pm +0100, Mircea Bardac wrote:\n>> Is there any straightforward way of doing git blame for all the files that got\n>> changed in a commit. Problems are renames, deletes and copies.\n> \n> Sounds like you want to track files rather than content.  Git tracks the\n> latter.\n\nHmm... I'm not really sure that my initial intention was to track files. \nI've given this some more thought and I realized that what I actually \nwant is a \"git diff\" with blame info included. I want this information \nin order to facilitate code reviewing.\n\nIt is true that this would be a front-end functionality, but I am not \nsure at the moment what the best approach would be for something like \nthis. I would see this something like\n$ git diff --blame[=\"parameters_for_blame\"] commit1..commit2\nbut this is just a thought.\n\nHas anyone tried blaming a \"git diff\"?\n\nMany thanks.\n\n--\nMircea\nhttp://mircea.bardac.net\n"},{"id":"80689","messageId":"m3ve00lbby.fsf@localhost.localdomain","threadId":"14093","inReplyTo":"485F6710.1080300@mircea.bardac.net","subject":"Re: git blame for a commit","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-23T10:01:12Z","receivedAt":"2008-06-23T10:01:12Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Mircea Bardac <dev@mircea.bardac.net> writes:\n> Ian Hilt wrote:\n>> On Sun, 22 Jun 2008 at 11:32pm +0100, Mircea Bardac wrote:\n>>>\n>>> Is there any straightforward way of doing git blame for all the\n>>> files that got changed in a commit. Problems are renames, deletes\n>>> and copies.\n>>\n>> Sounds like you want to track files rather than content.  Git tracks\n>> the\n>> latter.\n> \n> Hmm... I'm not really sure that my initial intention was to track\n> files. I've given this some more thought and I realized that what I\n> actually want is a \"git diff\" with blame info included. I want this\n> information in order to facilitate code reviewing.\n> \n> It is true that this would be a front-end functionality, but I am not\n> sure at the moment what the best approach would be for something like\n> this. I would see this something like\n> $ git diff --blame[=\"parameters_for_blame\"] commit1..commit2\n> but this is just a thought.\n> \n> Has anyone tried blaming a \"git diff\"?\n\nI think you could script it using \"git diff\", and \"git blame -L m,n\",\nwhere line ranges would be calculated from git diff header for\npost-image, or both pre-image and post-image (in the case of deletions).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"80716","messageId":"alpine.LFD.1.10.0806231149470.27742@sys-0.hiltweb.site","threadId":"14093","inReplyTo":"m3ve00lbby.fsf@localhost.localdomain","subject":"Re: git blame for a commit","fromName":"Ian Hilt","fromEmail":"ian.hilt@gmx.com","sentAt":"2008-06-23T15:55:59Z","receivedAt":"2008-06-23T15:55:59Z","isPatch":false,"sender":{"key":"ian.hilt@gmx.com","avatar":null},"body":"On Mon, 23 Jun 2008 at 3:01am -0700, Jakub Narebski wrote:\n\n> I think you could script it using \"git diff\", and \"git blame -L m,n\",\n> where line ranges would be calculated from git diff header for\n> post-image, or both pre-image and post-image (in the case of deletions).\n\nMaybe I'm missing something, but I thought git-blame only worked with\nthe files in the Git working directory.  Therefore, if a file had been\ndeleted it would not be reachable with git-blame, whether you diff'ed\nthe pre- and post-image or not.\n\n\n--\nIan Hilt\nIan.Hilt (at) gmx.com\nGnuPG key: 0x4AFC1EE3\n"},{"id":"80723","messageId":"200806231829.22004.jnareb@gmail.com","threadId":"14093","inReplyTo":"alpine.LFD.1.10.0806231149470.27742@sys-0.hiltweb.site","subject":"Re: git blame for a commit","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-06-23T16:29:21Z","receivedAt":"2008-06-23T16:29:21Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Mon, 23 Jun 2008, Ian Hilt wrote:\n> On Mon, 23 Jun 2008 at 3:01am -0700, Jakub Narebski wrote:\n> \n> > I think you could script it using \"git diff\", and \"git blame -L m,n\",\n> > where line ranges would be calculated from git diff header for\n> > post-image, or both pre-image and post-image (in the case of deletions).\n> \n> Maybe I'm missing something, but I thought git-blame only worked with\n> the files in the Git working directory.  Therefore, if a file had been\n> deleted it would not be reachable with git-blame, whether you diff'ed\n> the pre- and post-image or not.\n\nYou can give blame the revision to start blaming from; that's what\nI meant the \"pre-image\" blame (staring from parent revision).\n\nI'm not that sure if it is the best solution...\n-- \nJakub Narebski\nPoland\n"}]}