AAMP: Get Source Code from Repo:

AAMP

git clone https://code.rdkcentral.com/r/rdk/components/generic/aamp

FOG:

git clone https://code.rdkcentral.com/r/components/generic/fog

How to switch between branches?

Show current branch:

git branch

Switch to different branches

git checkout stable2

git checkout dev_sprint_23_1


How to get the latest code?

git pull

If needed, save local changes:

git stash

Reversed later eith

git pop

Alternatively:

git diff > local.patch
git apply local.patch


How to discard all local changes?

git reset --hard origin/dev_sprint_23_1
git pull

How to reset a specific file?

git checkout HEAD -- main_aamp.cpp

How to roll back to an older tag?

git checkout -b new_branch 96df8229bc6a6c42df92f22ab562b55d14181746

Push Code for Review/Merge

Add modified files, either specific ones or wildcards for "everything changed"

git add *

Add commit message:

git commit

Sample commit message format:

JIRA_TICKET_ID JIRA_Ticket_Summary

Reason for change: avoid use of out of scope memory and unterminated string
Test Procedure: details in ticket
Risks: Low

DEPS_BRANCH=rdk/components/generic/gst-plugins-rdk-aamp:dev_sprint_23_1
DEPS_BRANCH=rdk/components/generic/aampabr:dev_sprint_23_1
DEPS_BRANCH=rdk/components/generic/aampmetrics:dev_sprint_23_1


Note: When there is interdependency , add the other review number(s) under DEPS:

DEPS=80359


Push code (referenced JIRA ticket gets automatically updated)

git push origin HEAD:refs/for/dev_sprint_23_1

If needed, add a change id (git will emit these instructions if the change id is not automatically created or present) and push again


gitdir=$(git rev-parse --git-dir); curl -o ${gitdir}/hooks/commit-msg https://code.rdkcentral.com/r/tools/hooks/commit-msg ; chmod +x ${gitdir}/hooks/commit-msg

git commit -sv

git push origin HEAD:refs/for/dev_sprint_23_1

How to make changes to an existing review?

git add <changed file>

git commit --amend

git push origin HEAD:refs/for/dev_sprint_23_1

How to undo a git add (before push)?

git reset <file)

How to locally apply/test someone's changes that are not yet merged?

In Gerrit, browse to review, I.e.

https://code.rdkcentral.com/r/c/rdk/components/generic/aamp/+/75357


Scroll down to find the "download" button, then select "Cherry Pick" to get the command ready to copy/paste, i.e. 

git fetch https://code.rdkcentral.com/r/rdk/components/generic/aamp refs/changes/57/75357/26 && git cherry-pick FETCH_HEAD

How to squash (combine) reviews?

Cherry pick review (A).

Cherry pick review (B).

Do the following to combine (B) into (A).

Review local changes not yet merged:

git status

Use rebase command to squash 2 or more reviews:

git rebase -i HEAD~2

How to generate a patch from a review?

git format-patch -1 HEAD



  • No labels