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

Re: [PATCH] Git-p4: git-p4.changeOnSubmit to do 'change' instead of 'submit'.

From
AWAndrei Warkentin <awarkentin@vmware.com>
Date
Oct 17, 2011, 22:37 UTC
Message-ID
<1987300386.27372.1318891051633.JavaMail.root@zimbra-prod-mbox-2.vmware.com>
In-Reply-To
<20111017223202.GA1834@arf.padd.com>
Hi,
----- Original Message -----
Show 28 quoted lines
> From: "Pete Wyckoff" <pw@padd.com>
> To: "Andrei Warkentin" <awarkentin@vmware.com>
> Cc: git@vger.kernel.org, "Andrei Warkentin" <andreiw@vmware.com>, "Tor Arvid Lund" <torarvid@gmail.com>, "Luke
> Diamand" <luke@diamand.org>, gitster@pobox.com
> Sent: Monday, October 17, 2011 6:32:02 PM
> Subject: Re: [PATCH] Git-p4: git-p4.changeOnSubmit to do 'change' instead of 'submit'.
> 
> Git can have multiple commits outstanding that touch the same
> file, but p4 cannot really have multiple pending changes in the
> same workspace that touch the same file.
> 
> If you call "git-p4 change", it would build a p4 change for each
> of those commits.  If the commits happen to touch the same file,
> the changes get rearranged as far as p4 is concerned so that all
> changes to a given file are lumped in the first change that sees
> the file.  This is highly counterintuitive from a git mindset.
> 
> The most restrictive implementation would have to:
> 
>     1.  ensure no pending changes in the P4 clientPath
>     2.  ensure number of commits ("git rev-list") is 1
> 
> You could be more permissive, allowing multiple pending changes
> if the file sets do not conflict.  In that case, the first test
> would look at the files in pending changes and allow the
> operation if they did not intersect with files in origin..master.
> The second would make sure that each file appears in no more than
> 1 commit in origin..master.
Hmmm...I see. I'll think some more about it, then!
Show 20 quoted lines
> 
> Also make sure this works with preserveUser.  Not sure if an
> unsubmitted change can be handled the same way.
> 
> Because it feels like a delicate operation that could have big
> negative consequences, this needs a few unit tests.
> 
> For the code structure, I'd like to see a proper subclass instead
> of the dictionary idea.  Something like, e.g.:
> 
> class P4Submit(...):
>     def __init__(self, change_only=0)
> 	...
> 	self.change_only = change_only
> 
> class P4Change(P4Submit):
>     def __init__(self):
> 	P4Submit.__init__(self, change_only=1)
> 
> Sorry this is looking so difficult now.
No problem!
A
Previous: Pete Wyckoff
Message 8 of 8 in “Git-p4: git-p4.changeOnSubmit to do 'change' instead of 'submit'.”
  1. Git-p4: git-p4.changeOnSubmit to do 'change' instead of 'submit'.Andrei Warkentin, Oct 14, 2011
  2. Tor Arvid LundOct 14, 2011
  3. Andrei WarkentinOct 14, 2011
  4. Luke DiamandOct 15, 2011
  5. Andrei WarkentinOct 17, 2011
  6. Luke DiamandOct 17, 2011
  7. Pete WyckoffOct 17, 2011
  8. Andrei WarkentinOct 17, 2011

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.