git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-p4: Jobs and skipSubmitEdit

From
PWPete Wyckoff <pw@padd.com>
Date
Jun 26, 2012, 11:21 UTC
Message-ID
<20120626112115.GA3439@padd.com>
In-Reply-To
<CAFLRbootAje0BvLOYiH2xOagfUsQ+a_d+9YeTuG1C0a1Pg__Rg@mail.gmail.com>
mike@horowitz.name wrote on Tue, 26 Jun 2012 01:07 -0400:
Show 15 quoted lines
> Well, "Jobs:" is the only thing I use.  Everything else is filled in
> automatically by git-p4.
> 
> Yeah, so "Jobs:" appears once on a line by itself, and then multiple
> lines tabbed in of whatever the Job ids are, in our case they are JIRA
> issue numbers.  So, it might look like:
> 
> Jobs:
>     PROJECTNAME-123
>     PROJECTNAME-456
> 
> I think that if someone is using git-p4 and they have "Jobs:" at the
> beginning of a line by itself in a git commit message, then it is safe
> to stop pre-pending tabs to the lines from there on.  It can also be
> an option to turn this behavior on.

I agree that it is simpler to explain if Jobs: must come last. For the option, I'd prefer not to add another one, and instead hope that it's unlikely to find such a construct in a commit message that does not want this feature to happen.

I coded it up already, but with a couple little differences. Once I get a couple more of the series on which it depends mailed out, I'll send it along for you to play with.

		-- Pete
Show 34 quoted lines
> On Sun, Jun 24, 2012 at 4:24 PM, Pete Wyckoff <pw@padd.com> wrote:
> > mike@horowitz.name wrote on Fri, 22 Jun 2012 12:15 -0400:
> >> I've written a git prepare-commit-msg hook to do what the Perforce
> >> JobsView would essentially do, so I can include the jobs directly in
> >> my git commit message, and then use git-p4.skipSubmitEdit=true, so I
> >> can just push things into Perforce directly from git without ever
> >> being prompted by Perforce.
> >>
> >> Problem is that this doesn't work, because git-p4 tabs in the entire
> >> commit message to put it in the "Description:" section of the Perforce
> >> changelist, and my "Jobs:" ends up tabbed in, and it it required by
> >> Perforce to be at the beginning of the line.  The submit ends up
> >> failing, because "Jobs:" is required.  I am forced to turn off
> >> skipSubmitEdit and edit the message to remove the tab from the "Jobs:"
> >> line each commit.
> >>
> >> Is there any option to make this work right, or does the git-p4 not
> >> support this?
> >
> > This is a great idea, and something I've thought would be useful
> > too.  There's no code to handle it currently, but it shouldn't be
> > too hard.
> >
> > I'm imagining that special strings in the git commit are hoisted
> > up out of the description when building the p4 change message,
> > as you describe.  Are there any more than "Jobs:"?  Is it just
> > a single instance that might appear?
> >
> > An easy way to do this is to change prepareLogMessage to alter
> > or add a Jobs line.  Unless we decide this needs to be more
> > general.
> >
> >                -- Pete
> 
Previous: Michael HorowitzNext: Michael Horowitz
Message 4 of 6 in “git-p4: Jobs and skipSubmitEdit”
  1. Michael HorowitzJun 22, 2012
  2. Pete WyckoffJun 24, 2012
  3. Michael HorowitzJun 26, 2012
  4. Pete WyckoffJun 26, 2012
  5. Michael HorowitzJul 17, 2012
  6. Pete WyckoffJul 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.