{"thread":{"id":"35948","subject":"git am and mangled subject lines","startedAt":"2014-02-24T19:28:16Z","lastAt":"2014-02-24T20:38:29Z","messageCount":5,"participants":["Phillip Susi","Jonathan Nieder","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"235282","messageId":"530B9D50.6020705@ubuntu.com","threadId":"35948","inReplyTo":null,"subject":"git am and mangled subject lines","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2014-02-24T19:28:16Z","receivedAt":"2014-02-24T19:28:16Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\ngit am already ignores the \"[PATCH X/Y]\" prefix that format-patch\nadds.  Is it possible to get it to ignore any additional prefix that a\nbug tracker mangles into the subject line?  i.e. \"bug #nnnn:\"?\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJTC51PAAoJEI5FoCIzSKrw5YYH/R6t5fS71UAfFomsD/8HWHoI\nve1tIyyruHeriOV8qttlNQGynuEXkI2IBMWJaB7jV5oK8d4OsVQZ/7Nfcxoj52SO\nJXDSs0MVDB2Ro2lHXRnQsaCy/TUm+ALWsNiTy0kYMTeC7Iqtri1T1l8gaG2rwRJh\nAGT1sgGssl9CvGFgDHJxRZ4WHSl/XrcjErZeJHz59hGIeJSeq2tJXjfNzNTHrNpw\nB4rcW8AxXhx+3vWPx8PSJsiVeWR1ndILXwxBsUHPuUW5SdsNBrty1L+4xrGIbxm7\nqV7HVJ6BvJ4MXuTEOec3a9ACmvUTDNNMGRf2xonjXMcguojRZHjltRazsI34n8o=\n=sWTQ\n-----END PGP SIGNATURE-----\n"},{"id":"235289","messageId":"20140224200556.GH7855@google.com","threadId":"35948","inReplyTo":"530B9D50.6020705@ubuntu.com","subject":"Re: git am and mangled subject lines","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-02-24T20:05:56Z","receivedAt":"2014-02-24T20:05:56Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Phillip,\n\nPhillip Susi wrote:\n\n> git am already ignores the \"[PATCH X/Y]\" prefix that format-patch\n> adds.  Is it possible to get it to ignore any additional prefix that a\n> bug tracker mangles into the subject line?  i.e. \"bug #nnnn:\"?\n\nbuiltin/mailinfo.c is the place to start (see git-mailinfo(1)).\nThis is a little tricky because some people *like* the \"bug #nnnn:\"\nin the subject line for a commit.\n\nHope that helps,\nJonathan\n"},{"id":"235291","messageId":"xmqqios48drt.fsf@gitster.dls.corp.google.com","threadId":"35948","inReplyTo":"530B9D50.6020705@ubuntu.com","subject":"Re: git am and mangled subject lines","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-02-24T20:19:18Z","receivedAt":"2014-02-24T20:19:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Susi <psusi@ubuntu.com> writes:\n\n> git am already ignores the \"[PATCH X/Y]\" prefix that format-patch\n> adds.  Is it possible to get it to ignore any additional prefix that a\n> bug tracker mangles into the subject line?  i.e. \"bug #nnnn:\"?\n\nI think applypatch-msg hook is your friend in a case like this.\n"},{"id":"235293","messageId":"530BAA6F.4030401@ubuntu.com","threadId":"35948","inReplyTo":"xmqqios48drt.fsf@gitster.dls.corp.google.com","subject":"Re: git am and mangled subject lines","fromName":"Phillip Susi","fromEmail":"psusi@ubuntu.com","sentAt":"2014-02-24T20:24:15Z","receivedAt":"2014-02-24T20:24:15Z","isPatch":false,"sender":{"key":"psusi@ubuntu.com","avatar":null},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nOn 2/24/2014 3:19 PM, Junio C Hamano wrote:\n> Phillip Susi <psusi@ubuntu.com> writes:\n> \n>> git am already ignores the \"[PATCH X/Y]\" prefix that\n>> format-patch adds.  Is it possible to get it to ignore any\n>> additional prefix that a bug tracker mangles into the subject\n>> line?  i.e. \"bug #nnnn:\"?\n> \n> I think applypatch-msg hook is your friend in a case like this.\n\nCan you point me in the direction of some documentation on this?  I\ndon't see it mentioned in the man pages for git am or mailinfo ( I\nwould think that would be the place to have it ).\n\n\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2.0.17 (MingW32)\nComment: Using GnuPG with Thunderbird - http://www.enigmail.net/\n\niQEcBAEBAgAGBQJTC6pvAAoJEI5FoCIzSKrwQpYH/iJ8RPqEoIoO+GBU2HxmCfEZ\nTlo1qwbvw26ALY71/WQFtVKW+3Bh1XYpAs0rsL5tpCJw/EMgAEm1cPFASf+BHcRI\nNO57NBdk9we+hvUju+o6/It5e6OrYj/im+nI/AFfenRsbwPj8/S0MoMiP4jOEVkW\ntTSCEeC5ldR4IbxBfphbV7me79Sk8nZssXTFmWJEv80H41LdMd8ZThR4ZFCcyzUR\nifAflWHN7dj3uwY0Lr+OdCRrPw3qU1LXRjKK2SHBTG1Qk4uJW3sFJKHTupAipOEQ\nKKQ0QP/4WQWCSjq+8El4jnnlf++KAwbbOnAVYkbeKzy/4KOxJX7pimDypJHYGp8=\n=LZvc\n-----END PGP SIGNATURE-----\n"},{"id":"235296","messageId":"20140224203829.GJ7855@google.com","threadId":"35948","inReplyTo":"530BAA6F.4030401@ubuntu.com","subject":"Re: git am and mangled subject lines","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-02-24T20:38:29Z","receivedAt":"2014-02-24T20:38:29Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nPhillip Susi wrote:\n> On 2/24/2014 3:19 PM, Junio C Hamano wrote:\n>> Phillip Susi <psusi@ubuntu.com> writes:\n\n>>> git am already ignores the \"[PATCH X/Y]\" prefix that\n>>> format-patch adds.  Is it possible to get it to ignore any\n>>> additional prefix that a bug tracker mangles into the subject\n>>> line?  i.e. \"bug #nnnn:\"?\n>>\n>> I think applypatch-msg hook is your friend in a case like this.\n>\n> Can you point me in the direction of some documentation on this?  I\n> don't see it mentioned in the man pages for git am or mailinfo ( I\n> would think that would be the place to have it ).\n\nGladly.\n\nThanks for noticing.\n\n-- >8 --\nSubject: am doc: add a pointer to relevant hooks\n\nIt is not obvious when looking at a new command what hooks will affect\nit.  Add a HOOKS section to the git-am(1) page, imitating\ngit-commit(1), to make it easier for people to discover e.g. the\napplypatch-msg hook that can implement a custom subject-mangling\nstrategy (e.g., removing a \"bug #nnnn:\" prefix introduced by a bug\ntracker).\n\nReported-by: Phillip Susi <psusi@ubuntu.com>\nSigned-off-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n Documentation/git-am.txt | 5 +++++\n 1 file changed, 5 insertions(+)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 54d8461..abcffb6 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -189,6 +189,11 @@ commits, like running 'git am' on the wrong branch or an error in the\n commits that is more easily fixed by changing the mailbox (e.g.\n errors in the \"From:\" lines).\n \n+HOOKS\n+-----\n+This command can run `applypatch-msg`, `pre-applypatch`,\n+and `post-applypatch` hooks.  See linkgit:githooks[5] for more\n+information.\n \n SEE ALSO\n --------\n-- \n1.9.0.rc1.175.g0b1dcb5\n"}]}