[OpenAFS-devel] Git/gerrit basics (Windows)

Jeffrey Altman jaltman@secure-endpoints.com
Thu, 16 Jul 2009 13:12:28 -0400


Mickey Lane wrote:
> Git/gerrit basics (Windows)
> 
> I'd like to submit two trivial changes for the kdfs branch. They're only
> appropriate to that branch. My main goal is really to learn the
> git/gerrit process.

Please be aware that the entire src/WINNT/afsrdr/kernel tree is going
to be replaced in the near future.

> I plan to make one change, commit and submit. Then make the second
> change and repeat the process.
> 
> Some really basic questions:
> 
> #1
> 
> My two changes don't have anything to do with each other but by
> following the above process, do I establish a dependency so that the 1st
> change must be applied (approved?) before the 2nd?

Create each change in its own branch that tracks the remote branch
you are basing them off of.   Commit each change to its own local
branch and push the change to gerrit from there.

> #2
> 
> The phrase "must not end with a full stop" is confusing to Windows
> users. (This one anyway)

a "full stop" is a period.

> If I make a text file (a.txt) with the above as a guide (on Windows,
> it'll have <carriage return><line feed>) and supply it to my commit
> command (in the bash window from msysGit):
> 
>                 git commit -F a.txt

I cannot promise that git will strip the CRs.  If you do not specify
-F git.exe will start the default editor with a template file which
will be LF only.

> (Minor comment wrt the web page - it took me some time to realize that
> the above text - under the heading 'upload to gerrit' - is actually part
> of the git commit activity and doesn't really have anything to do with
> upload. I had assumed it was something added via a gerrit form presented
> at the time of commit. Perhaps add some text to put it in context?)

Changes are not submitted to gerrit by using a web browser.  They are
pushed to gerrit using the "git push" command which in turn uses the
ssh client you configured to communicate securely with gerrit's clone
of the repository.

> #3
> 
> I have given the Gerrit server my SSH public key but I'm not sure how
> msysGit and/or PuTTY and/or ???? is supposed to be configured to make
> all this work.

I recommend you use the OpenSSH instance that ships with msysGit.
The SSH public key you generated should have a matching private key
in the ~/.ssh directory.  The ~/.ssh/config file needs to be configured
as specified on the OpenAFS GitDevelopers wiki page.

> #4
> 
> If the commit stuff works, do I immediately follow that with:

commit is a local operation.  It is unlikely to fail.

>   git log -p origin/openafs-windows-kdfs-ifs-branch..HEAD

That will show you what is outstanding on the current branch provided
that the current branch is tracking origin/openafs-windows-kdfs-ifs-branch.
> 
>   git push ssh://gerrit.openafs.org/openafs.git
>      HEAD:refs/for/openafs-windows-kdfs-ifs-branch

That will push the commit(s) from the current branch to gerrit for
application to the openafs-windows-kdfs-ifs-branch branch.

> #5
> 
> If the push completes without apparent error, is that the end of the
> process?

The submit is now in gerrit where it can be reviewed.  Comments can be
applied.  Verification can be specified.  If it all looks good, it will
be submitted.  If it needs work, you will need to update the commit and
resubmit it to the same gerrit issue.  This is hopefully explained well
enough in the GitDevelopers wiki page.

Jeffrey Altman