Skip to content

vkochan/gerrsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gerrsh is a yet another tool for review changes from Gerrit inspired by git-review.

Sample review workflow
======================

Review process is done in the following steps:
1) checkout change from gerrit to local git:

    $ gerrsh -c CHANGEID
    $ gerrsh --comments-diff CHANGEID

2) apply comments, comments will be obtained from Gerrit,
generated in form of diff, and applied into current directory,
so they might be seen as diff in some difftool. Each commented
line is generated to separate hunk with comments added for this line:

    $ git reset --hard HEAD
    $ gerrsh --comments-diff CHANGEID | patch -p1

3) open diff tool and add comment:

----<snip>----
struct xxx {
> Vadym Kochan <[email protected]> wrote:
> | please use proper name
	int a;
	int b;
};
----</snip>---

add new comment by putting text under last '>' line:

----<snip>----
struct xxx {
> Vadym Kochan <[email protected]> wrote:
> | please use proper name
OK
Will do.
	int a;
	int b;
};
----</snip>---

exit difftool, and push comments to Gerrit, so all unprefixed (w/o ">", ">>" etc) new lines
will be used as comment. In this case message:

----<snip>----
OK
Will
----</snip>---

will be added as comment for line which contains 'struct xxx {'.

4) exit difftool and push comments to Gerrit:

    $ gerrsh --comments-push CHANGEID

after push the comments will be seen as:

----<snip>----
struct xxx {
>> Vadym Kochan <[email protected]> wrote:
>> | please use proper name
> Vadym Kochan <[email protected]> wrote:
> | OK
> | Will do.
	int a;
	int b;
};
----</snip>---

if to re-apply comments diff.

Usage
=====

    List all open reviews:
        $ gerrsh

    List all open reviews which has comments on patch set:
        $ gerrsh -C

    List all open reviews which has no conflicts (mergeable):
        $ gerrsh -M

    List all open reviews in which the owner is myself:

        $ gerrsh --my

    Checkout change from Gerrit into local git repo - it will create new branch
    (if it does not exist) and checkout into it:

        $ gerrsh -c

    Show review comments in form of diff, it allows to redirect it into file
    and apply it as a patch to local git repository and easy see them with some
    git diff tool (vim-fugitive).Such approach allows to browse over comments
    in terminal mode:

        $ gerrsh --comments-diff CHANGEID

    Apply diff from previous option into local git repository (changes will be showed by git
    as 'modified'), it is recommented to perform 'git reset --hard HEAD' before applying:

        $ gerrsh --comments-apply CHANGEID

    Submit review reply:

        $ gerrsh --review-msg 'nice!' --review-score +1 CHANGEID
        $ gerrsh --review-msg 'needs to be refactored' CHANGEID
        $ gerrsh --review-score +1 CHANGEID

    Show review info:

        $ gerrsh CHANGEID

Releases

No releases published

Packages

No packages published

Languages