Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] git question

From: Dario Lombardo <dario.lombardo.ml@xxxxxxxxx>
Date: Mon, 4 Dec 2017 10:36:59 +0100
If you have pushed to gerrit from your master (that is correct, but not the best option), you didn't do anything wrong. Gerrit uses a cherry-pick strategy when we promote a commit, that means that developer's commit histories don't play any role.
What git is telling you is that you and master have diverged, and you have to update. 

Running git push --rebase does

1) fetch data from remote
2) stash your local commits
3) apply new commits from remote to your local copy
4) replay your stashed history: if a commit you have has already been merged, it won't be done again

Then, I suppose you will be perfectly fine after it. If, after pull, git doesn't say you're up-to-date, it means that not merged commits still live in your master.

As others have suggested: use branches in the future. It works better with gerrit's cherry-pick model. If your master reflects origin/master you more easily track the actual master repo.

Hope it helps.
Dario.

On Sat, Dec 2, 2017 at 11:23 PM, e-mail graham.shanks via Wireshark-dev <wireshark-dev@xxxxxxxxxxxxx> wrote:

After submitting some changes to git review and getting them accepted I get the following message when I do a git status:

C:\Development\wireshark>git status
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean

A search on this message suggests that I need to do a git pull --rebase, but the documentation suggests that this will synchronise with the remote repository (which is what I want to do) but then try to apply the commits (which I don't want to do, I think). The git documentation on rebase doesn't seem to cover what I think the wireshark repository is doing.

Is git pull --rebase the correct thing to do? Also did I do something wrong to get into this state?

Regards
Graham


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe