ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] GIT tutorials (was: Re: Fix bug in GSM MAP, have problems with G

From: Hadriel Kaplan <hadriel.kaplan@xxxxxxxxxx>
Date: Tue, 11 Mar 2014 13:47:44 -0400
On Mar 11, 2014, at 1:18 PM, Christopher Maynard <Christopher.Maynard@xxxxxxxxx> wrote:

> If possible, add some information/basic steps on a few more topics as well?
> For example:
> 1) How do you undo a commit, or undo part of a commit?

You can reset the head, but I really think going there requires reading the book. :)


> 2) How do you apply someone else's patch for testing before committing?

Gerrit actually shows you what to do on the review web page - in each Patch Set it has a "Download" line, with something like this:
git fetch https://code.wireshark.org/review/wireshark refs/changes/02/602/2 && git checkout FETCH_HEAD

You can copy that and paste it in your shell - though I usually create a local branch to do that in, rather than the detached head state done by that command.  So I do this instead:
git fetch https://code.wireshark.org/review/wireshark refs/changes/02/602/2
git checkout -b new-branch-name FETCH_HEAD


> 3) How to backport to other trunks?

That's currently documented in:
http://wiki.wireshark.org/Development/Backporting

But that's written from the perspective of someone going through the submission process - not of a core developer doing the cherry-pick.


> 4) How do you know if someone has a fix or not?  With subversion, they'd
> indicate they're running svn r51234, for example, and then you could tell
> them that they need to update to at least r52345.  With git, how does this
> work with hashes?

That would be good to know - because so far it seems people've been using the first ~6 characters of the commit hashes, but I'm not sure if that's right or not.

-hadriel