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

Re: [PATCH] Fix handling of git-p4 on deleted files

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 22, 2010, 18:52 UTC
Message-ID
<7vpqv2kqkt.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTikOXp7Tz3F0Of7Ua2N39Z1S22WKh0K_zJFLGa2K@mail.gmail.com>
Andrew Waters <apwaters@googlemail.com> writes:
Show 14 quoted lines
> On 22 October 2010 11:20, Thomas Berg <merlin66b@gmail.com> wrote:
>> Hi,
>>
>> On Mon, Oct 18, 2010 at 5:39 PM, Andrew Waters <apwaters@googlemail.com> wrote:
>>> When you submit changes containing deleted file the command 'p4 diff
>>> -du ...' includes diffs for deleted files. This causes the failure:
>>>
>>> open for read: <deleted file>: No such file or directory
>>> Command failed: p4 diff -du ...
>>
>> I'm a daily git-p4 user and noticed this problem too: 'git p4 submit'
>> fails for commits with deleted files, with recent Perforce verions.
>> The problem has been brought up earlier [1], but no patch has actually
>> submitted yet.
Thanks for a resend.  Will queue.
Show 22 quoted lines
> Signed-off-by: Andrew Waters <apwaters@googlemail.com>
> ---
>  contrib/fast-import/git-p4 |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index c1ea643..04ce7e3 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -706,7 +706,9 @@ class P4Submit(Command):
>              submitTemplate = self.prepareLogMessage(template, logMessage)
>              if os.environ.has_key("P4DIFF"):
>                  del(os.environ["P4DIFF"])
> -            diff = p4_read_pipe("diff -du ...")
> +            diff = ""
> +            for editedFile in editedFiles:
> +                diff += p4_read_pipe("diff -du %r" % editedFile)
>
>              newdiff = ""
>              for newFile in filesToAdd:
> -- 
> 1.7.2.2
Previous: Andrew Waters
Message 4 of 4 in “Fix handling of git-p4 on deleted files”
  1. Fix handling of git-p4 on deleted filesAndrew Waters, Oct 18, 2010
  2. Thomas BergOct 22, 2010
  3. Fix handling of git-p4 on deleted filesAndrew Waters, Oct 22, 2010
  4. Junio C HamanoOct 22, 2010

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.