Wireshark-dev: Re: [Wireshark-dev] Question about git style
From: Craig Jackson <[email protected]>
Date: Tue, 2 Jan 2018 11:36:32 -0500
You're correct. I've been using source code control systems since the days of punched cards and tape. (I even wrote a clone of SCCS in Burroughs ALGOL once, for my own edification.) However, I only have a reading knowledge of git.

It looks like I have two options when working with gerrit:

- Using an initial commit and then amending it repeatedly.
- Using multiple commits and then squashing them.

The former is pretty simple. The latter would allow me to revert to points other than the most recent one.

I guess that both indeed are features of git's distributed nature. You're free to amend history as long as you do it within the privacy of your own repository. The classic centralized/single-stream VCSs would think of that as cooking the books.

The moral of the story is Read The O'Reilly Book. (RTORB?) And then read it again . . .

Craig Jackson

On Tue, Jan 2, 2018 at 5:21 AM, Jaap Keuter <[email protected]> wrote:
Hi,

It seems that you’re no stranger to version control systems (VCS), but new to git. I think it's important in this case to recognise that git is a distributed VCS. That means that you have (a clone of) a repository on your own, and gerrit is an online tool on the origin repository. You can commit to your own repository as much as you want, and decide to push to gerrit when you’re done.
Being done thus means having your changes completed, or wanting to share it with, or reviewed by others. Gerrit provides the infrastructure for that. The first case is assumed when a commit appears in gerrit, if it’s a Work In Progress a marker ‘[WIP]’ is requested to be prefixed on the commit summary line.
Before you push to gerrit you may manipulate your repository as you like (squash commits, rebase the branch, etc). After pushing to gerrit you should refrain from ‘changing history’ like this. Additional work and commits are however possible.
I hope this highlights the difference between your own repository and gerrit a little.

Thanks,
Jaap


> On 1 Jan 2018, at 23:44, Craig Jackson <[email protected]> wrote:
>
> I'm curious whether each submission to gerrit must be a single commit. I'm accustomed with other source management systems to making a branch and then committing fairly frequently. I would do intermediate commits before I had anything complete enough to be added to the mainline code of what I was working on.
>
> I'm new to git and gerrit, but it seems like gerrit wants each submission to be a single commit.
>
> What is the best style? Should I do a commit, and then amend it as I continue to develop?
>
> Craig Jackson

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]wireshark.org?subject=unsubscribe