How to use Review Board?

7 views
Skip to first unread message

Witold Karpeta

unread,
Oct 27, 2012, 6:44:44 PM10/27/12
to gcd-...@googlegroups.com
Well it looked simple when I read docs, but when I tried to put my first, very small, change to review (I added entries to .gitignore, mostly to see, that I know how to do post code for review) problems showed up and I'm stuck.

First, when I try to use post-review tool then:
- before I commit locally the tool says I have no changes
- when I commited and tried to post it, it asked me for username and password for HTTP authentication, but when I gave my username and password by which I can login on website it printed me: Error creating review request: You are not logged in (HTTP 401, API Error 103)

When I tried to put it on website:
- git could make me a diff by 'git diff' only before I commited my change locally
- when I tried to create new review request by web site and gave my created diff-file I saw an error: The file '.gitignore' (rd9b98f5) could not be found in the repository

I see this revision number in my diff file, so I assume I probably made this diff the wrong way, so: how should I do it? Or what should I do to be able to use post-review?

And last thing - there was a talk on this group about review board not working with git when cloned from https, so my question is what are the symptoms of it? Can this be a problem in my case?

Witek

Henry Andrews

unread,
Oct 27, 2012, 7:03:28 PM10/27/12
to gcd-...@googlegroups.com
It's a bit complicated, and assuming we stick with Review Board we should probably put recommendations on our wiki.  Or hopefully find someone else's documentation and point to it.  Alternatively, we could try Pull Requests, although I still don't think their UI and workflow looks as good as Review Board.  As long as we don't use Gerrit, though, which I know is completely unsuitable.

Anyway, back to the point.
The main problem is that post-review only knows how to handle a few sorts of diffs.  Specifically, it does a diff of everything that's been modified, by default your local, unstaged uncommitted modifications.  You can give it a --parent, where a parent of HEAD will make it use your staged, uncommitted diffs, and a branch name (and maybe a revision?  Not sure) will make it diff vs that branch or revision.  I think.  I gave up on it fairly quickly and switched to using the web UI.

What I do is this:
* Click "New Review" on the Review Board web UI.
* select the gcd-django repository (or gcd-historical-archive, but hopefully no one else will need to make any more changes there from now on).
* Use the following command to produce a diff file:

git diff --no-color --full-index --no-ext-diff --ignore-submodules

This is what post-review runs.  I have it aliased to gdiff locally :-)  You can also use git's own subcommand aliasing to name it something useful.

Read up on all the different ways you can generate diffs at the git book: http://git-scm.com/book

Typically, I commit everything locally before making diffs.  If I want to diff against an "origin" branch, i.e. origin/master or origin/django1.4, which represent the state of the master and django1.4 branches on GitHub, then I just run something like:

gdiff origin/django1.4 HEAD > ~/diffs/first.diff

And then I select that to upload as a diff from the web UI.

You'll also note an "Upload parent diff" option.  Let's say I make more local changes on django1.4 and want to review them separately.  I use "git log" to see what my old HEAD was (i.e. the last change that I *don't* want to see in the diff).  Let's say it's change 1a2b, using short form git hashes.  This means that I want the change up to that point to be the parent diff, and the change *from* that point to be the diff to review.

gdiff origin/django1.4 1a2b > ~/diffs/parent.diff
gdiff 1a2b HEAD ~/diffs/second.diff

Then I upload parent.diff as the parent diff, and code.diff as the main diff.  Often "parent.diff" is actually the last "first.diff" that I posted for some prior review.

So what if I get some feedback on the first change and need to re-post the diff.  Now my newest updates are committed locally, but I want to review them with first.diff, and second.diff is in the way.  Then I use git rebase -i to re-order the local change history
I can then make it look like I made the new changes *between* first.diff and second.diff, and then I can regenerate a new diff for the first code review without sucking the second code review into it.

Or you can just put all of your changes on separate branches, which is probably easier.

cheers,
-henry


From: Witold Karpeta <wkar...@gmail.com>
To: gcd-...@googlegroups.com
Sent: Saturday, October 27, 2012 3:44 PM
Subject: [gcd-tech] How to use Review Board?

--
GCD-Tech mailing list - gcd-...@googlegroups.com
To unsubscribe send email to gcd-tech+u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/gcd-tech


Witold Karpeta

unread,
Oct 27, 2012, 7:14:29 PM10/27/12
to gcd-...@googlegroups.com
Thank you Henry for such detailed answer. I'll try that tomorrow, hoping to be one step closer to my first real change to the code :)

Witek


2012/10/28 Henry Andrews <hh...@cornell.edu>

Jochen G.

unread,
Oct 28, 2012, 7:14:13 AM10/28/12
to gcd-...@googlegroups.com
Am 28.10.2012 00:44, schrieb Witold Karpeta:
> Well it looked simple when I read docs, but when I tried to put my
> first, very small, change to review (I added entries to .gitignore,
> mostly to see, that I know how to do post code for review) problems
> showed up and I'm stuck.
>
> First, when I try to use post-review tool then:
> - before I commit locally the tool says I have no changes
> - when I commited and tried to post it, it asked me for username and
> password for HTTP authentication, but when I gave my username and
> password by which I can login on website it printed me: Error creating
> review request: You are not logged in (HTTP 401, API Error 103)

what is the git-url you have in your .git/config ? The https one doesn't
work with review board currently.

>
> When I tried to put it on website:
> - git could make me a diff by 'git diff' only before I commited my
> change locally
> - when I tried to create new review request by web site and gave my
> created diff-file I saw an error: The file '.gitignore' (rd9b98f5) could
> not be found in the repository
>
> I see this revision number in my diff file, so I assume I probably made
> this diff the wrong way, so: how should I do it? Or what should I do to
> be able to use post-review?

Did you do a git pull before to have the up-to-date master locally ?


> And last thing - there was a talk on this group about review board not
> working with git when cloned from https, so my question is what are the
> symptoms of it? Can this be a problem in my case?

yes, the login sounds a bit like it.

Jochen

Henry Andrews

unread,
Oct 28, 2012, 11:55:47 AM10/28/12
to gcd-...@googlegroups.com
I'll just point out that I do all of my work and code reviews with the https URL.  It doesn't work with post-review, but I don't find that post-review works very well at all with git, so that seems somewhat irrelevant.  If you upload diffs through the UI, the https URL works just fine.
thanks,
-henry


From: Jochen G. <gcd...@garcke.de>
To: gcd-...@googlegroups.com
Sent: Sunday, October 28, 2012 4:14 AM
Subject: Re: [gcd-tech] How to use Review Board?

Jochen G.

unread,
Oct 28, 2012, 2:10:40 PM10/28/12
to gcd-...@googlegroups.com
Am 28.10.2012 16:55, schrieb Henry Andrews:
> I'll just point out that I do all of my work and code reviews with the
> https URL. It doesn't work with post-review, but I don't find that
> post-review works very well at all with git, so that seems somewhat
> irrelevant. If you upload diffs through the UI, the https URL works
> just fine.

Hmm, if you upload diffs through the UI you don't actually use the https
URL, but the one stored in review board for the repo.

Jochen

Henry Andrews

unread,
Oct 28, 2012, 2:16:26 PM10/28/12
to gcd-...@googlegroups.com
Yes, I know.  My point was that you can still use the https URL to checkout / commit.  Which I find easier than messing with SSH keys.
-henry

Sent: Sunday, October 28, 2012 11:10 AM

Subject: Re: [gcd-tech] How to use Review Board?
--
GCD-Tech mailing list - gcd-...@googlegroups.com
To unsubscribe send email to gcd-tech+unsub...@googlegroups.com

Alexandros Diamantidis

unread,
Oct 28, 2012, 7:31:05 PM10/28/12
to gcd-...@googlegroups.com
* Henry Andrews [2012-10-28 11:16]:
> Yes, I know. �My point was that you can still use the https URL to checkout / commit. �Which I find easier than messing with SSH keys.

Have you tried using git URLs to checkout and https to commit? I have...

* git remote -v
origin git://github.com/GrandComicsDatabase/gcd-django.git (fetch)
origin g...@github.com:GrandComicsDatabase/gcd-django.git (push)

... and post-review works correctly. Obviously if you can push via
https, you can set the push url to whatever works. Git URLs might also
be a bit faster than https.

Alexandros
Reply all
Reply to author
Forward
0 new messages