{"thread":{"id":"45475","subject":"blame --line-porcelain is providing me with funny output","startedAt":"2017-03-23T00:32:39Z","lastAt":"2017-03-23T18:01:21Z","messageCount":3,"participants":["Edmundo Carmona Antoranz","Dennis Kaarsemaker","Stefan Beller"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"315026","messageId":"CAOc6etYTDyyRud9D3jubh7tC9MeyGZXONWM+=Kb+uwx0voSLpw@mail.gmail.com","threadId":"45475","inReplyTo":null,"subject":"blame --line-porcelain is providing me with funny output","fromName":"Edmundo Carmona Antoranz","fromEmail":"eantoranz@gmail.com","sentAt":"2017-03-23T00:32:31Z","receivedAt":"2017-03-23T00:32:39Z","isPatch":false,"sender":{"key":"eantoranz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1491018?v=4"},"body":"Hi, everybody!\n\nAs part of my improvements to difflame I want to use revision\ninformation as provided by blame --line-porcelain so that I can avoid\nsome git calls to cat-file -p to get revision information hoping that\ninformation would be a match. However I'm not finding that to be the\ncase.\n\n$ git blame --no-progress -w --line-porcelain -L 72,72\n4e59582ff70d299f5a88449891e78d15b4b3fabe -- t/lib-submodule-update.sh\n\n3290fe6dd2a7e2bb35ac760443335dec58802ff1 72 72 1\nauthor Stefan Beller\nauthor-mail <somemail@gmail.com>\nauthor-time 1484160452\nauthor-tz -0800\ncommitter Junio C Hamano\ncommitter-mail <somemail@pobox.com>\ncommitter-time 1484337771\ncommitter-tz -0800\nsummary lib-submodule-update.sh: reduce use of subshell by using \"git -C\"\nprevious d7dffce1cebde29a0c4b309a79e4345450bf352a t/lib-submodule-update.sh\nfilename t/lib-submodule-update.sh\n                       git -C sub1 checkout modifications &&\n\n\n\nIf we then take a look at the information on that revision using\ncat-file -p on the revision:\n\n$ git cat-file -p 3290fe6dd2a7e2bb35ac760443335dec58802ff1\n\n\ntree 7df89dad28ec8b08875395265a3f2e13ba180174\nparent d7dffce1cebde29a0c4b309a79e4345450bf352a\nauthor Stefan Beller <somemail@google.com> 1484160452 -0800\ncommitter Junio C Hamano <somemail@pobox.com> 1484337771 -0800\n\n(which, just in case, resembles the information provided by git\nshow... but is simpler to parse with cat-file).\n\nCommitter mails are matching, however author mail does not match\nbetween line-porcelain and cat-file. Is there a reason for that?\n\n\nThanks in advance.\n"},{"id":"315046","messageId":"1490266989.10080.6.camel@kaarsemaker.net","threadId":"45475","inReplyTo":"CAOc6etYTDyyRud9D3jubh7tC9MeyGZXONWM+=Kb+uwx0voSLpw@mail.gmail.com","subject":"Re: blame --line-porcelain is providing me with funny output","fromName":"Dennis Kaarsemaker","fromEmail":"dennis@kaarsemaker.net","sentAt":"2017-03-23T11:03:09Z","receivedAt":"2017-03-23T11:03:18Z","isPatch":false,"sender":{"key":"dennis@kaarsemaker.net","avatar":"https://avatars.githubusercontent.com/u/200649?v=4"},"body":"On Wed, 2017-03-22 at 18:32 -0600, Edmundo Carmona Antoranz wrote:\n> \n> $ git blame --no-progress -w --line-porcelain -L 72,72\n> author-mail <somemail@gmail.com>\n> \n> $ git cat-file -p 3290fe6dd2a7e2bb35ac760443335dec58802ff1\n> author Stefan Beller <somemail@google.com> 1484160452 -0800\n> \n> Committer mails are matching, however author mail does not match\n> between line-porcelain and cat-file. Is there a reason for that?\n\nThe commit object has Stefan's Google address, but git.git's  mailmap\nmaps that to his gmail address.\n\ngit blame actually does this mapping, where git cat-file does not.\n-- \nDennis Kaarsemaker\nhttp://www.kaarsemaker.net\n"},{"id":"315133","messageId":"CAGZ79kY0D6z=4=3QVkiQSqmVV9bvZpi9OUcpm+fe--q4prPC+g@mail.gmail.com","threadId":"45475","inReplyTo":"1490266989.10080.6.camel@kaarsemaker.net","subject":"Re: blame --line-porcelain is providing me with funny output","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-03-23T18:01:15Z","receivedAt":"2017-03-23T18:01:21Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Thu, Mar 23, 2017 at 4:03 AM, Dennis Kaarsemaker\n<dennis@kaarsemaker.net> wrote:\n> On Wed, 2017-03-22 at 18:32 -0600, Edmundo Carmona Antoranz wrote:\n>>\n>> $ git blame --no-progress -w --line-porcelain -L 72,72\n>> author-mail <somemail@gmail.com>\n>>\n>> $ git cat-file -p 3290fe6dd2a7e2bb35ac760443335dec58802ff1\n>> author Stefan Beller <somemail@google.com> 1484160452 -0800\n>>\n>> Committer mails are matching, however author mail does not match\n>> between line-porcelain and cat-file. Is there a reason for that?\n>\n> The commit object has Stefan's Google address, but git.git's  mailmap\n> maps that to his gmail address.\n>\n> git blame actually does this mapping, where git cat-file does not.\n\nYes, I think the plumbing tools in general want to ignore the .mailmap file.\n\nThe committer (Junio) does use the email address, which is recorded as\nhis primary address in .mailmap as well, so no matter if the .mailmap file\nis taken into account, it is the same email address.\n\nCurrently I contribute patches via the @google address, but the @gmail\naddress is marked as the primary address in the .mailmap file, such that\nit depends whether the .mailmap file is taken into account which email\naddress is displayed.\n\nSo doesn't depend on the author or committer fields, but instead it\ndepends on the underlying data (.mailmap and recorded person for\nauthor/committer).\n\nFor the exact mechanism of .mailmap look at \"man git shortlog\"\nthat has a section MAPPING AUTHORS), which states its effect,\nbut not the purpose of mapping persons:\n\n    The .mailmap feature is used to coalesce together commits\n    by the same person in the shortlog, where their name and/or\n    email address was spelled differently.\n\nOne purpose could be to just fix data (i.e. misspelled name,\nunconfigured repo; back then there were quite a few name=\"\"\nemail=\"root@localhost\" commits).\n\nAnother aspect is to keep track of the same person at different\nstages of life, e.g. when switching employers (or just email providers),\nyou may contribute from different email addresses and want to appear\nas the same person in porcelain-viewed commits.\nThere are quite a few examples in the .mailmap file for different\nemail addresses.\n\nOne notable example is found in 94b410bba8 (.mailmap: Map\nemail addresses to names, 2013-07-12):\n\n    While the most changes happen at the email addresses, we also have a\n    name change in here. Karl Hasselström is now known as Karl Wiberg\n    due to marriage. Congratulations!\n\nThanks,\nStefan\n"}]}