adding the lines of code added from an older branch to the newest version

103 Views Asked by At

I have an older version of a repo (renderdoc) (v 0.27) that has been changed by Stephan Ritcher. However it has many bugs which has been fixed by the original author Baldurk in latest version as of now 0.33. The question is how can I grab the hotfixes or changes from the v 0.27 and add it to v 0.33 or if it is easier how to grab the bug fixes from v 0.33 and add it to the Stephan's branch?

mona@DESKTOP-37GGNHL MINGW64 /d/experiment/renderdoc ((c67e3e7b...))
$ git log
commit c67e3e7b7a221780ff904c516e9861826939e511
Author: Stephan Richter <[email protected]>
Date:   Sun Nov 27 17:47:15 2016 -0800

    updated submodule repository

commit 7fff78c1a341e15e143a6007837414265cf124ee
Author: Stephan Richter <[email protected]>
Date:   Thu Nov 24 11:30:38 2016 +0100

    don't close renderdoc automatically

commit 5b60cf6507ca179bb7891adc33b7702994c7aae8
Author: Stephan Richter <[email protected]>
Date:   Wed Sep 7 15:47:03 2016 +0200

    Added ID rendering mode for extracting mesh, texture, and shader IDs from G-                                                                                                                                                                                               buffer pass. Added option to load and execute script right after log file is loa                                                                                                                                                                                               ded. Replaced tinyexr with OpenEXR for dumping textures.

commit eb3e74db38c29c2c7d74745ff7c85383d310f389
Author: baldurk <[email protected]>
Date:   Wed Jan 20 20:19:53 2016 +0100
:...skipping...
commit c67e3e7b7a221780ff904c516e9861826939e511
Author: Stephan Richter <[email protected]>
Date:   Sun Nov 27 17:47:15 2016 -0800

    updated submodule repository

commit 7fff78c1a341e15e143a6007837414265cf124ee
Author: Stephan Richter <[email protected]>
Date:   Thu Nov 24 11:30:38 2016 +0100

    don't close renderdoc automatically

commit 5b60cf6507ca179bb7891adc33b7702994c7aae8
Author: Stephan Richter <[email protected]>
Date:   Wed Sep 7 15:47:03 2016 +0200

    Added ID rendering mode for extracting mesh, texture, and shader IDs from G-                                                                                                                                                                                               buffer pass. Added option to load and execute script right after log file is loa                                                                                                                                                                                               ded. Replaced tinyexr with OpenEXR for dumping textures.

commit eb3e74db38c29c2c7d74745ff7c85383d310f389

Additionally how can I cherry pick all of the Stephan's hotfixes in an interactive manner?

mona@DESKTOP-37GGNHL MINGW64 /d/experiment/renderdoc ((c67e3e7b...))
$ git reflog
c67e3e7b HEAD@{0}: checkout: moving from playing_for_data to c67e3e7b7a221780ff904c516e9861826939e511
c67e3e7b HEAD@{1}: clone: from https://bitbucket.org/visinf/projects-2016-playing-for-data-renderdoc

and

mona@DESKTOP-37GGNHL MINGW64 /d/experiment/renderdoc ((c67e3e7b...))
$ git branch
* (HEAD detached at c67e3e7b)
  playing_for_data

and

mona@DESKTOP-37GGNHL MINGW64 /d/experiment/renderdoc ((c67e3e7b...))
$ git status
HEAD detached at c67e3e7b
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   pdblocate/pdblocate.vcxproj
        modified:   renderdoc/3rdparty/breakpad/client/windows/common.vcxproj
        modified:   renderdoc/3rdparty/breakpad/client/windows/crash_generation/crash_generation_client.vcxproj
        modified:   renderdoc/3rdparty/breakpad/client/windows/crash_generation/crash_generation_server.vcxproj
        modified:   renderdoc/3rdparty/breakpad/client/windows/handler/exception_handler.vcxproj
        modified:   renderdoc/driver/d3d11/renderdoc_d3d11.vcxproj
        modified:   renderdoc/driver/dxgi/renderdoc_dxgi.vcxproj
        modified:   renderdoc/driver/gl/renderdoc_gl.vcxproj
        modified:   renderdoc/driver/shaders/dxbc/renderdoc_dxbc.vcxproj
        modified:   renderdoc/driver/shaders/spirv/renderdoc_spirv.vcxproj
        modified:   renderdoc/renderdoc.vcxproj
        modified:   renderdoccmd/renderdoccmd.vcxproj
        modified:   renderdocshim/renderdocshim.vcxproj
        modified:   renderdocui/ironpython/compilelibs.sh

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        renderdoc.VC.VC.opendb
        renderdoc.VC.db
        renderdocui/ironpython/pythonlibs.zip

no changes added to commit (use "git add" and/or "git commit -a")

also:

mona@DESKTOP-37GGNHL MINGW64 /d/latest_renderdoc/renderdoc (master)
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean

and some of the stuff from the latest version git log:

$ git log
commit 1ba4a8ad1efbc1ee6ac13649a59adb8420910a3e
Author: baldurk <[email protected]>
Date:   Thu Feb 23 23:53:24 2017 +0000

    Reapply fix 16f85cadc which was wrongly removed by 5a1ded738

commit a029fc4ab1d6f24aba969d28b81d66f01931766f
Author: Baldur Karlsson <[email protected]>
Date:   Thu Feb 23 17:46:42 2017 +0000

    Update screenshots to point to renderdoc.org site

commit 73ba1c140a4e02b147f4398cc3cd1fed6ecaa738
Author: Janos Pantos <[email protected]>
Date:   Thu Feb 23 18:21:34 2017 +0100

    Fix eglCreateWindowSurface function name at dlsym call.

commit 898e95496531b8cc10f8ddb513d362d15e3e0e68
Author: baldurk <[email protected]>
Date:   Thu Feb 23 17:38:09 2017 +0000

    Bump version info to v0.34
:...skipping...
commit 1ba4a8ad1efbc1ee6ac13649a59adb8420910a3e
Author: baldurk <[email protected]>
Date:   Thu Feb 23 23:53:24 2017 +0000

    Reapply fix 16f85cadc which was wrongly removed by 5a1ded738

commit a029fc4ab1d6f24aba969d28b81d66f01931766f
Author: Baldur Karlsson <[email protected]>
Date:   Thu Feb 23 17:46:42 2017 +0000

    Update screenshots to point to renderdoc.org site
1

There are 1 best solutions below

1
On

For the older version v0.27 in /d/experiment/renderdoc, you can add it as a remote in v0.33 /d/latest_renderdoc/renderdoc . And then you can rebase changes from v0.27 to v0.33. detail steps as below:

git remote add old /d/experiment/renderdoc
git fetch old
git rebase --onto master <commit id on v0.27 before start to rebase) <commit if on v0.27 of the end to rebase>
git checkout -b temp
git checkout master
git merge temp

Such as if you want to rebase the commits from 7fff78c1a341e15e143a6007837414265cf124ee to c67e3e7b7a221780ff904c516e9861826939e511 to v0.33 master branch, you should use git rebase --onto master 5b60cf6 c67e3e7.

Because the commits you rebase onto master is not exist in your origin, and after you rebase these commits onto master, these is no branch to point. So you need to create a branch to point the commit after you finish the rebase, and then fast-forward master branch to point it (as the last 3 commands above).