{"thread":{"id":"30871","subject":"git-p4: Jobs and skipSubmitEdit","startedAt":"2012-06-22T16:15:11Z","lastAt":"2012-07-18T01:03:04Z","messageCount":6,"participants":["Michael Horowitz","Pete Wyckoff"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"194077","messageId":"CAFLRbop2aETNp0-6AdvSTx7Jmh7epYZ6rQc6hhFHbxZrGdEo9g@mail.gmail.com","threadId":"30871","inReplyTo":null,"subject":"git-p4: Jobs and skipSubmitEdit","fromName":"Michael Horowitz","fromEmail":"mike@horowitz.name","sentAt":"2012-06-22T16:15:11Z","receivedAt":"2012-06-22T16:15:11Z","isPatch":false,"sender":{"key":"mike@horowitz.name","avatar":null},"body":"Hello,\n\nI've written a git prepare-commit-msg hook to do what the Perforce\nJobsView would essentially do, so I can include the jobs directly in\nmy git commit message, and then use git-p4.skipSubmitEdit=true, so I\ncan just push things into Perforce directly from git without ever\nbeing prompted by Perforce.\n\nProblem is that this doesn't work, because git-p4 tabs in the entire\ncommit message to put it in the \"Description:\" section of the Perforce\nchangelist, and my \"Jobs:\" ends up tabbed in, and it it required by\nPerforce to be at the beginning of the line.  The submit ends up\nfailing, because \"Jobs:\" is required.  I am forced to turn off\nskipSubmitEdit and edit the message to remove the tab from the \"Jobs:\"\nline each commit.\n\nIs there any option to make this work right, or does the git-p4 not\nsupport this?\n\nThanks,\n\nMike\n"},{"id":"194171","messageId":"20120624202445.GA27664@padd.com","threadId":"30871","inReplyTo":"CAFLRbop2aETNp0-6AdvSTx7Jmh7epYZ6rQc6hhFHbxZrGdEo9g@mail.gmail.com","subject":"Re: git-p4: Jobs and skipSubmitEdit","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-06-24T20:24:45Z","receivedAt":"2012-06-24T20:24:45Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"mike@horowitz.name wrote on Fri, 22 Jun 2012 12:15 -0400:\n> I've written a git prepare-commit-msg hook to do what the Perforce\n> JobsView would essentially do, so I can include the jobs directly in\n> my git commit message, and then use git-p4.skipSubmitEdit=true, so I\n> can just push things into Perforce directly from git without ever\n> being prompted by Perforce.\n> \n> Problem is that this doesn't work, because git-p4 tabs in the entire\n> commit message to put it in the \"Description:\" section of the Perforce\n> changelist, and my \"Jobs:\" ends up tabbed in, and it it required by\n> Perforce to be at the beginning of the line.  The submit ends up\n> failing, because \"Jobs:\" is required.  I am forced to turn off\n> skipSubmitEdit and edit the message to remove the tab from the \"Jobs:\"\n> line each commit.\n> \n> Is there any option to make this work right, or does the git-p4 not\n> support this?\n\nThis is a great idea, and something I've thought would be useful\ntoo.  There's no code to handle it currently, but it shouldn't be\ntoo hard.\n\nI'm imagining that special strings in the git commit are hoisted\nup out of the description when building the p4 change message,\nas you describe.  Are there any more than \"Jobs:\"?  Is it just\na single instance that might appear?\n\nAn easy way to do this is to change prepareLogMessage to alter\nor add a Jobs line.  Unless we decide this needs to be more\ngeneral.\n\n\t\t-- Pete\n"},{"id":"194261","messageId":"CAFLRbootAje0BvLOYiH2xOagfUsQ+a_d+9YeTuG1C0a1Pg__Rg@mail.gmail.com","threadId":"30871","inReplyTo":"20120624202445.GA27664@padd.com","subject":"Re: git-p4: Jobs and skipSubmitEdit","fromName":"Michael Horowitz","fromEmail":"mike@horowitz.name","sentAt":"2012-06-26T05:07:49Z","receivedAt":"2012-06-26T05:07:49Z","isPatch":false,"sender":{"key":"mike@horowitz.name","avatar":null},"body":"Well, \"Jobs:\" is the only thing I use.  Everything else is filled in\nautomatically by git-p4.\n\nYeah, so \"Jobs:\" appears once on a line by itself, and then multiple\nlines tabbed in of whatever the Job ids are, in our case they are JIRA\nissue numbers.  So, it might look like:\n\nJobs:\n    PROJECTNAME-123\n    PROJECTNAME-456\n\nI think that if someone is using git-p4 and they have \"Jobs:\" at the\nbeginning of a line by itself in a git commit message, then it is safe\nto stop pre-pending tabs to the lines from there on.  It can also be\nan option to turn this behavior on.\n\nMike\n\n\nOn Sun, Jun 24, 2012 at 4:24 PM, Pete Wyckoff <pw@padd.com> wrote:\n> mike@horowitz.name wrote on Fri, 22 Jun 2012 12:15 -0400:\n>> I've written a git prepare-commit-msg hook to do what the Perforce\n>> JobsView would essentially do, so I can include the jobs directly in\n>> my git commit message, and then use git-p4.skipSubmitEdit=true, so I\n>> can just push things into Perforce directly from git without ever\n>> being prompted by Perforce.\n>>\n>> Problem is that this doesn't work, because git-p4 tabs in the entire\n>> commit message to put it in the \"Description:\" section of the Perforce\n>> changelist, and my \"Jobs:\" ends up tabbed in, and it it required by\n>> Perforce to be at the beginning of the line.  The submit ends up\n>> failing, because \"Jobs:\" is required.  I am forced to turn off\n>> skipSubmitEdit and edit the message to remove the tab from the \"Jobs:\"\n>> line each commit.\n>>\n>> Is there any option to make this work right, or does the git-p4 not\n>> support this?\n>\n> This is a great idea, and something I've thought would be useful\n> too.  There's no code to handle it currently, but it shouldn't be\n> too hard.\n>\n> I'm imagining that special strings in the git commit are hoisted\n> up out of the description when building the p4 change message,\n> as you describe.  Are there any more than \"Jobs:\"?  Is it just\n> a single instance that might appear?\n>\n> An easy way to do this is to change prepareLogMessage to alter\n> or add a Jobs line.  Unless we decide this needs to be more\n> general.\n>\n>                -- Pete\n"},{"id":"194270","messageId":"20120626112115.GA3439@padd.com","threadId":"30871","inReplyTo":"CAFLRbootAje0BvLOYiH2xOagfUsQ+a_d+9YeTuG1C0a1Pg__Rg@mail.gmail.com","subject":"Re: git-p4: Jobs and skipSubmitEdit","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-06-26T11:21:15Z","receivedAt":"2012-06-26T11:21:15Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"mike@horowitz.name wrote on Tue, 26 Jun 2012 01:07 -0400:\n> Well, \"Jobs:\" is the only thing I use.  Everything else is filled in\n> automatically by git-p4.\n> \n> Yeah, so \"Jobs:\" appears once on a line by itself, and then multiple\n> lines tabbed in of whatever the Job ids are, in our case they are JIRA\n> issue numbers.  So, it might look like:\n> \n> Jobs:\n>     PROJECTNAME-123\n>     PROJECTNAME-456\n> \n> I think that if someone is using git-p4 and they have \"Jobs:\" at the\n> beginning of a line by itself in a git commit message, then it is safe\n> to stop pre-pending tabs to the lines from there on.  It can also be\n> an option to turn this behavior on.\n\nI agree that it is simpler to explain if Jobs: must come last.\nFor the option, I'd prefer not to add another one, and instead\nhope that it's unlikely to find such a construct in a commit\nmessage that does not want this feature to happen.\n\nI coded it up already, but with a couple little differences.\nOnce I get a couple more of the series on which it depends mailed\nout, I'll send it along for you to play with.\n\n\t\t-- Pete\n\n> On Sun, Jun 24, 2012 at 4:24 PM, Pete Wyckoff <pw@padd.com> wrote:\n> > mike@horowitz.name wrote on Fri, 22 Jun 2012 12:15 -0400:\n> >> I've written a git prepare-commit-msg hook to do what the Perforce\n> >> JobsView would essentially do, so I can include the jobs directly in\n> >> my git commit message, and then use git-p4.skipSubmitEdit=true, so I\n> >> can just push things into Perforce directly from git without ever\n> >> being prompted by Perforce.\n> >>\n> >> Problem is that this doesn't work, because git-p4 tabs in the entire\n> >> commit message to put it in the \"Description:\" section of the Perforce\n> >> changelist, and my \"Jobs:\" ends up tabbed in, and it it required by\n> >> Perforce to be at the beginning of the line.  The submit ends up\n> >> failing, because \"Jobs:\" is required.  I am forced to turn off\n> >> skipSubmitEdit and edit the message to remove the tab from the \"Jobs:\"\n> >> line each commit.\n> >>\n> >> Is there any option to make this work right, or does the git-p4 not\n> >> support this?\n> >\n> > This is a great idea, and something I've thought would be useful\n> > too.  There's no code to handle it currently, but it shouldn't be\n> > too hard.\n> >\n> > I'm imagining that special strings in the git commit are hoisted\n> > up out of the description when building the p4 change message,\n> > as you describe.  Are there any more than \"Jobs:\"?  Is it just\n> > a single instance that might appear?\n> >\n> > An easy way to do this is to change prepareLogMessage to alter\n> > or add a Jobs line.  Unless we decide this needs to be more\n> > general.\n> >\n> >                -- Pete\n> \n"},{"id":"195194","messageId":"CAFLRbooDpeE0U+sysa=OZ2a1sPvPo9MYTi4KLRgfJxkxw2HQyw@mail.gmail.com","threadId":"30871","inReplyTo":"20120626112115.GA3439@padd.com","subject":"Re: git-p4: Jobs and skipSubmitEdit","fromName":"Michael Horowitz","fromEmail":"mike@horowitz.name","sentAt":"2012-07-17T08:49:52Z","receivedAt":"2012-07-17T08:49:52Z","isPatch":false,"sender":{"key":"mike@horowitz.name","avatar":null},"body":"Pete,\n\nI gave the patch a try, and it seems to work great.\n\nOnly problem I realized is that it means that the git commit message\nand the p4 log message end up different, because to p4 the jobs lines\nare special and get stripped out, but in git it just stays part of the\ncommit message.  So, when you do a p4 sync/rebase, the commits come\nback without it.  This doesn't make much of difference now, because\nthe commit messages come back modified with the p4 path and changelist\nnumber anyway, but if Luke tries to do that change to store the p4\npath/changelist in notes instead, then we wouldn't want any\ndifferences in the commit messages, because then the commits hashes\nwon't match again.\n\nNot sure what the best thing to do here is, but I guess it doesn't\nmatter until this mythical notes thing happens.\n\nMike\n\n\n\nOn Tue, Jun 26, 2012 at 7:21 AM, Pete Wyckoff <pw@padd.com> wrote:\n>\n> mike@horowitz.name wrote on Tue, 26 Jun 2012 01:07 -0400:\n> > Well, \"Jobs:\" is the only thing I use.  Everything else is filled in\n> > automatically by git-p4.\n> >\n> > Yeah, so \"Jobs:\" appears once on a line by itself, and then multiple\n> > lines tabbed in of whatever the Job ids are, in our case they are JIRA\n> > issue numbers.  So, it might look like:\n> >\n> > Jobs:\n> >     PROJECTNAME-123\n> >     PROJECTNAME-456\n> >\n> > I think that if someone is using git-p4 and they have \"Jobs:\" at the\n> > beginning of a line by itself in a git commit message, then it is safe\n> > to stop pre-pending tabs to the lines from there on.  It can also be\n> > an option to turn this behavior on.\n>\n> I agree that it is simpler to explain if Jobs: must come last.\n> For the option, I'd prefer not to add another one, and instead\n> hope that it's unlikely to find such a construct in a commit\n> message that does not want this feature to happen.\n>\n> I coded it up already, but with a couple little differences.\n> Once I get a couple more of the series on which it depends mailed\n> out, I'll send it along for you to play with.\n>\n>                 -- Pete\n>\n> > On Sun, Jun 24, 2012 at 4:24 PM, Pete Wyckoff <pw@padd.com> wrote:\n> > > mike@horowitz.name wrote on Fri, 22 Jun 2012 12:15 -0400:\n> > >> I've written a git prepare-commit-msg hook to do what the Perforce\n> > >> JobsView would essentially do, so I can include the jobs directly in\n> > >> my git commit message, and then use git-p4.skipSubmitEdit=true, so I\n> > >> can just push things into Perforce directly from git without ever\n> > >> being prompted by Perforce.\n> > >>\n> > >> Problem is that this doesn't work, because git-p4 tabs in the entire\n> > >> commit message to put it in the \"Description:\" section of the\n> > >> Perforce\n> > >> changelist, and my \"Jobs:\" ends up tabbed in, and it it required by\n> > >> Perforce to be at the beginning of the line.  The submit ends up\n> > >> failing, because \"Jobs:\" is required.  I am forced to turn off\n> > >> skipSubmitEdit and edit the message to remove the tab from the\n> > >> \"Jobs:\"\n> > >> line each commit.\n> > >>\n> > >> Is there any option to make this work right, or does the git-p4 not\n> > >> support this?\n> > >\n> > > This is a great idea, and something I've thought would be useful\n> > > too.  There's no code to handle it currently, but it shouldn't be\n> > > too hard.\n> > >\n> > > I'm imagining that special strings in the git commit are hoisted\n> > > up out of the description when building the p4 change message,\n> > > as you describe.  Are there any more than \"Jobs:\"?  Is it just\n> > > a single instance that might appear?\n> > >\n> > > An easy way to do this is to change prepareLogMessage to alter\n> > > or add a Jobs line.  Unless we decide this needs to be more\n> > > general.\n> > >\n> > >                -- Pete\n> >\n"},{"id":"195237","messageId":"20120718010304.GA24602@padd.com","threadId":"30871","inReplyTo":"CAFLRbooDpeE0U+sysa=OZ2a1sPvPo9MYTi4KLRgfJxkxw2HQyw@mail.gmail.com","subject":"Re: git-p4: Jobs and skipSubmitEdit","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-07-18T01:03:04Z","receivedAt":"2012-07-18T01:03:04Z","isPatch":false,"sender":{"key":"pw@padd.com","avatar":null},"body":"mike@horowitz.name wrote on Tue, 17 Jul 2012 04:49 -0400:\n> I gave the patch a try, and it seems to work great.\n> \n> Only problem I realized is that it means that the git commit message\n> and the p4 log message end up different, because to p4 the jobs lines\n> are special and get stripped out, but in git it just stays part of the\n> commit message.  So, when you do a p4 sync/rebase, the commits come\n> back without it.  This doesn't make much of difference now, because\n> the commit messages come back modified with the p4 path and changelist\n> number anyway, but if Luke tries to do that change to store the p4\n> path/changelist in notes instead, then we wouldn't want any\n> differences in the commit messages, because then the commits hashes\n> won't match again.\n> \n> Not sure what the best thing to do here is, but I guess it doesn't\n> matter until this mythical notes thing happens.\n\nGlad it works.\n\nI didn't think about trying to make the commit messages exact.\nThat isn't required for, e.g. \"git cherry\", but might be nice\njust to make git/p4 view of the changes more similar.\n\nOkay if we wait and see how the notes stuff goes, like you\nsuggest.  Could be that Jobs ends up in a note too.\n\nThanks for testing.\n\n\t\t-- Pete\n"}]}