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

Re: [PATCH] git-p4: Do not include diff in spec file when just preparing p4

From
PWPete Wyckoff <pw@padd.com>
Date
Jan 14, 2014, 00:06 UTC
Message-ID
<20140114000613.GA11594@padd.com>
In-Reply-To
<20140113121011.GA9711@nekage>
frrrwww@gmail.com wrote on Mon, 13 Jan 2014 12:10 +0000:
Show 24 quoted lines
> Hello,
> 
> On Sun, Jan 12, 2014 at 05:29:46PM -0500, Pete Wyckoff wrote:
> > Thanks for the patch, but I'm curious how you'd like this to
> > work.  I never use the option myself.
> > 
> > As it is, --prepare-p4-only generates a file in /tmp/ that has
> > exactly the contents you'd see in the editor during "git p4
> > submit".  It includes the diff of the change, presumably to help
> > with writing the description.
> 
> Yes, I believe it makes sense to display the diff in this case, as we
> can remove it later programmatically.
>  
> > Now you can't actually feed this file directly to "p4 submit"
> > without deleting the diff.  That's the part you don't like?
> 
> Yes, I do not use that for submitting, but for shelving. I can run
> git p4 submit --prepare-p4-only followed by p4 shelve -i < /tmp/...
> and perforce will shelve the corresponding change.
> 
> Removing the diff could be done externally, however git-p4 itself
> tells the user it can submit using the generated file, which is
> not the case if we keep the diff in it.
I'm convinced.  That explanation makes sense, thanks.

It would be nice to do a few more things with this patch. Here's some ideas, sorted in priority order.

    1.  Put slightly more text into the commit message, possibly
    from your email above.
    2.  Refactor out that big chunk of code instead of just
    moving it.  Selectively call it only if not prepare_p4_only.
    3.  Modify the t9807 test 'submit --prepare-p4-only' to make
    sure the diff isn't there.
    4.  Documentation update?  Probably not necessary.
Let me know if you're interested in doing any of this.
		-- Pete
Previous: Maxime CosteNext: Maxime Coste
Message 4 of 13 in “git-p4: Do not include diff in spec file when just preparing p4”
  1. git-p4: Do not include diff in spec file when just preparing p4Maxime Coste, Jan 10, 2014
  2. Pete WyckoffJan 12, 2014
  3. Maxime CosteJan 13, 2014
  4. Pete WyckoffJan 14, 2014
  5. git-p4: Do not include diff in spec file when just preparing p4Maxime Coste, May 24, 2014
  6. Maxime CosteMay 24, 2014
  7. Pete WyckoffMay 24, 2014
  8. git-p4: Do not include diff in spec file when just preparing p4Maxime Coste, May 24, 2014
  9. Fix git-p4 submit in non --prepare-p4-only modeMaxime Coste, Jun 10, 2014
  10. Pete WyckoffJun 10, 2014
  11. Maxime CosteJun 11, 2014
  12. Pete WyckoffJun 11, 2014
  13. Fix git-p4 submit in non --prepare-p4-only modeMaxime Coste, Jun 11, 2014

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.