Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Find the repo for the patch file.(For ex : here the patch file is index.patch.)
  2. Clone the repo. For ex:
  3. Checkout the branch for which you want to create the patch.
    • $ git checkout 1905_sprint
    • $ git branch

...

  1. Find the location of the patch file in the repo.
    • $ find . -iname index.patch
      ./meta-pacexf3/recipes-ccsp/ccsp/ccsp-webui/index.patch

Step 2 :

  1. Next find the repo for the actual source file to which the patch file was getting patched. ( For ex: here the source file is index.php)

  2. clone the repo.
    • $ mkdir source
    • $ cd source/
    • $ git clone ssh://rkumar840@gerrit.teamccp.com:29418/rdk/rdkb/components/opensource/ccsp/webui/generic
    • .
  3. checkout the required branch.
    • $ git checkout 1905_sprint
    • $ git branch
  4. Cherry-pick the required changes also.
    • $ git fetch ssh://rkumar840@gerrit.teamccp.com:29418/rdk/rdkb/components/opensource/ccsp/webui/generic
    • refs/changes/48/283148/2 && git cherry-pick FETCH_HEAD

      5. After cherry-picking you can verify the changes in the source file.

...

  1. create another directory, and clone the source code repo (as in step 2). For ex :
  2. Checkout checkout the required branch
                         $ .
    • $ git checkout 1905_sprint
    • $ git branch
  3. Copy the patch file from the patch repo (step 1) to the current directory.
    • $ cp ../patch/meta-pacexf3/recipes-ccsp/ccsp/ccsp-webui/index.patch .
    •  $ ls

cmpnt_build_custom_pre_arm.mkCONTRIBUTING.md       debug_scripts      LICENSE         NOTICE         scripts
cmpnt_build_custom_pre_pc.mk           COPYING                        index.patch          Makefile.orig     README       sourc

...

 source

4.Apply the patch to the source file/files.

  • $ patch -p1 < index.patch

patching file source/Styles/xb3/code/index.php
Hunk #1 succeeded at 22 (offset 21 lines).
Hunk #2 succeeded at 32 (offset 21 lines).
Hunk #3 succeeded at 73 (offset 21 lines).
Hunk #4 succeeded at 183 (offset 27 lines).
Hunk #5 succeeded at 195 (offset 27 lines).
Hunk #6 succeeded at 245 (offset 37 lines).
Hunk #7 succeeded at 307 (offset 37 lines).
Hunk #8 succeeded at 445 (offset 37 lines).
Hunk #9 succeeded at 454 (offset 37 lines).
Hunk #10 succeeded at 468 (offset 37 lines).
Hunk #11 succeeded at 482 (offset 37 lines).
Hunk #12 succeeded at 492 (offset 37 lines).

...