Wireshark git Cheat Sheet

From Wiki
Jump to navigationJump to search

Notes

Do not edit the commit message, once set. Even though files may be changed and committed multiple times, we're working on a branch, and as far as the wireshark project as a whole sees it, we're submitting a finished set of patches, and it doesn't care about intermediate changes made during the patch development.

Git

The 'git-review' package must be installed prior to checkout out the wireshark repository.

Work Flow

http://wiki.wireshark.org/Development/SubmittingPatches has a good explanation of the process.

https://wiki.openstack.org/wiki/Gerrit_Workflow also has a good explanation of the Gerrit workflow.

Patch Status

https://code.wireshark.org/review/#/q/status:open,n,z has the current review status.

Useful Git Commands

Check out the wireshark master branch

 git clone ssh://<username>@code.wireshark.org:29418/wireshark

Configure pre-commit hooks

 cd wireshark
 cp tools/pre-commit .git/hooks/

Set push destination

 git config --add remote.origin.push HEAD:refs/for/master

Configure Gerrit

 git review -s

Check out specific branch to work on

 git review -d 5813

To commit changes WITH pre-commit checks

 git commit --all --amend

To commit changes WITHOUT pre-commit checks (for non-dissector code related changes)

 git commit --all --amend --no-verify

To push to wireshark code review (-R avoids rebasing)

 git review -R

To rebase against master (sync changes in master back to our branch -- USUALLY PAINFUL)

 git checkout master
 git pull
 git checkout <branch name>
 git rebase master

To resolve conflicts during rebase

 vi <filename>
 git add <filename>
 git rebase --continue

To list available branches

 git branch