File moved: patch failed to apply on a new branch

1,923 views
Skip to first unread message

arunoday sarkar

unread,
Sep 5, 2014, 12:40:25 AM9/5/14
to chromi...@chromium.org
Hi

I am trying to reuse a CL by applying patch to a newly created branch to continue where I had left off.

Looks like one of the files that was originally modified had been moved to a different directory.

original file modified : chrome/renderer/pepper/ppb_pdf_impl.cc
New location: components/pdf/renderer/ppb_pdf_impl.cc

git cl exits with the following error

error: chrome/renderer/pepper/ppb_pdf_impl.cc: does not exist in index

Failed to apply the patch

What should one do in this scenario?

Thanks

Raymes Khoury

unread,
Sep 5, 2014, 2:30:46 AM9/5/14
to arunoday sarkar, chromi...@chromium.org
I think you can run git cl patch with --reject to get it to do its
best and output the rest in .rej files. Then you can fix it up
manually and commit.

You might need to run git cl issue to set the issue number if it
doesn't get set.
> --
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev

Scott Graham

unread,
Sep 5, 2014, 12:43:06 PM9/5/14
to arunoday sarkar, chromi...@chromium.org
On Thu, Sep 4, 2014 at 9:39 PM, arunoday sarkar <a.sark...@gmail.com> wrote:
Hi

I am trying to reuse a CL by applying patch to a newly created branch to continue where I had left off.

Looks like one of the files that was originally modified had been moved to a different directory.

original file modified : chrome/renderer/pepper/ppb_pdf_impl.cc
New location: components/pdf/renderer/ppb_pdf_impl.cc

git cl exits with the following error

error: chrome/renderer/pepper/ppb_pdf_impl.cc: does not exist in index


Normally this means that that file already exists on disk, untracked. So doing 

rm chrome/renderer/pepper/ppb_pdf_impl.cc

and then git cl patch will probably work.
 

Failed to apply the patch

What should one do in this scenario?

Thanks

--

arunoday sarkar

unread,
Sep 5, 2014, 11:21:03 PM9/5/14
to Scott Graham, chromi...@chromium.org
The file actually doesn't exist on the disk any more after I did 'git pull --rebase'.

So running rm chrome/renderer/pepper/ppb_pdf_impl.cc didn't quiet help there.

[1] Following Raymes' steps yielded the following messages

git cl patch -b Issue_152432 --reject 473193002

Switched to a new branch 'Issue_152432'

Loaded authentication cookies from /Users/arunoday/.codereview_upload_cookies

Checking patch chrome/renderer/pepper/ppb_pdf_impl.cc...

error: chrome/renderer/pepper/ppb_pdf_impl.cc: does not exist in index

Checking patch content/public/renderer/render_view.h...

Checking patch content/renderer/pepper/pepper_plugin_instance_impl.cc...

Hunk #1 succeeded at 1365 (offset 20 lines).

Hunk #2 succeeded at 1399 (offset 21 lines).

Checking patch content/renderer/render_frame_impl.cc...

Hunk #1 succeeded at 2568 (offset 137 lines).

Hunk #2 succeeded at 3760 (offset 155 lines).

Checking patch content/renderer/render_view_impl.cc...

Hunk #1 succeeded at 2474 (offset -100 lines).

Checking patch content/renderer/render_view_impl.h...

Hunk #1 succeeded at 480 (offset -1 lines).

Applied patch content/public/renderer/render_view.h cleanly.

Applied patch content/renderer/pepper/pepper_plugin_instance_impl.cc cleanly.

Applied patch content/renderer/render_frame_impl.cc cleanly.

Applied patch content/renderer/render_view_impl.cc cleanly.

Applied patch content/renderer/render_view_impl.h cleanly.

Failed to apply the patch

Thanks

Reply all
Reply to author
Forward
0 new messages