From 2bcd016f291efc60292a9ab56df34bcebd4bc932 Mon Sep 17 00:00:00 2001 From: Craig MacGregor Date: Wed, 24 Oct 2012 13:07:04 -0400 Subject: [PATCH] Added git-review to review files on branch since the branch was created. --- bin/git-review | 6 ++ etc/bash_completion.sh | 4 ++ man/git-review.1 | 73 ++++++++++++++++++++++ man/git-review.1.html | 138 +++++++++++++++++++++++++++++++++++++++++ man/git-review.md | 48 ++++++++++++++ 5 files changed, 269 insertions(+) create mode 100755 bin/git-review create mode 100644 man/git-review.1 create mode 100644 man/git-review.1.html create mode 100644 man/git-review.md diff --git a/bin/git-review b/bin/git-review new file mode 100755 index 0000000..8543118 --- /dev/null +++ b/bin/git-review @@ -0,0 +1,6 @@ +#!/bin/sh + +branch=${1:-`git rev-parse --abbrev-ref HEAD`} +master=${2:-master} + +git diff --name-status `git merge-base $branch $master`..$branch diff --git a/etc/bash_completion.sh b/etc/bash_completion.sh index db68dfa..efdd8e7 100644 --- a/etc/bash_completion.sh +++ b/etc/bash_completion.sh @@ -61,6 +61,10 @@ _git_refactor(){ __git_extras_workflow "refactor" } +_git_review(){ + __gitcomp "$(__git_heads)" +} + _git_squash(){ __gitcomp "$(__git_heads)" } diff --git a/man/git-review.1 b/man/git-review.1 new file mode 100644 index 0000000..d2ac257 --- /dev/null +++ b/man/git-review.1 @@ -0,0 +1,73 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "GIT\-REVIEW" "1" "October 2012" "" "" +. +.SH "NAME" +\fBgit\-review\fR \- Review files changed since branch was created +. +.SH "SYNOPSIS" +\fBgit\-review\fR [] [] +. +.SH "DESCRIPTION" +Shows all the file changes thave have happened since a a branch was created from it\'s master (parent) branch\. This can be useful for code reviews when you don\'t want to see the changes that have happened in master since the branching took place\. +. +.SH "OPTIONS" + +. +.P +The branch to compare with the \. Defaults to the current branch\. +. +.P + +. +.P +The branch that the was originally branched from\. Defaults to master\. +. +.SH "EXAMPLES" +Show changes in current branch since it was branched from master +. +.IP "" 4 +. +.nf + +$ git review +. +.fi +. +.IP "" 0 +. +.P +Show changes in test branch since it was branched from master +. +.IP "" 4 +. +.nf + +$ git review test +. +.fi +. +.IP "" 0 +. +.P +Show changes in hotfix1\.1 branch since it was branched from v1\.0 +. +.IP "" 4 +. +.nf + +$ git review hotfix1\.1 v1\.0 +. +.fi +. +.IP "" 0 +. +.SH "AUTHOR" +Written by Craig MacGregor <\fIcraigerm@gmail\.com\fR> +. +.SH "REPORTING BUGS" +<\fIhttps://github\.com/visionmedia/git\-extras/issues\fR> +. +.SH "SEE ALSO" +<\fIhttps://github\.com/visionmedia/git\-extras\fR> diff --git a/man/git-review.1.html b/man/git-review.1.html new file mode 100644 index 0000000..35cf9db --- /dev/null +++ b/man/git-review.1.html @@ -0,0 +1,138 @@ + + + + + + git-review(1) - Review files changed since branch was created + + + + +
+ + + +
    +
  1. git-review(1)
  2. +
  3. +
  4. git-review(1)
  5. +
+ +

NAME

+

+ git-review - Review files changed since branch was created +

+ +

SYNOPSIS

+ +

git-review [<branchname>] [<master>]

+ +

DESCRIPTION

+ +

Shows all the file changes thave have happened since a a branch was +created from it's master (parent) branch. This can be useful for code reviews +when you don't want to see the changes that have happened in master since the +branching took place.

+ +

OPTIONS

+ +

<branchname>

+ +

The branch to compare with the <master branch>. Defaults to the + current branch.

+ +

<master>

+ +

The branch that the <branchname> was originally branched + from. Defaults to master.

+ +

EXAMPLES

+ +

Show changes in current branch since it was branched from master

+ +
$ git review
+
+ +

Show changes in test branch since it was branched from master

+ +
$ git review test
+
+ +

Show changes in hotfix1.1 branch since it was branched from v1.0

+ +
$ git review hotfix1.1 v1.0
+
+ +

AUTHOR

+ +

Written by Craig MacGregor <craigerm@gmail.com>

+ +

REPORTING BUGS

+ +

<https://github.com/visionmedia/git-extras/issues>

+ +

SEE ALSO

+ +

<https://github.com/visionmedia/git-extras>

+ + +
    +
  1. +
  2. October 2012
  3. +
  4. git-review(1)
  5. +
+ +
+ + diff --git a/man/git-review.md b/man/git-review.md new file mode 100644 index 0000000..86216c1 --- /dev/null +++ b/man/git-review.md @@ -0,0 +1,48 @@ +git-review(1) -- Review files changed since branch was created +============================================================== + +## SYNOPSIS + +`git-review` [<branchname>] [<master>] + +## DESCRIPTION +Shows all the file changes thave have happened since a a branch was +created from it's master (parent) branch. This can be useful for code reviews +when you don't want to see the changes that have happened in master since the +branching took place. + +## OPTIONS + + <branchname> + + The branch to compare with the <master branch>. Defaults to the + current branch. + + <master> + + The branch that the <branchname> was originally branched + from. Defaults to master. + +## EXAMPLES + +Show changes in current branch since it was branched from master + $ git review + +Show changes in test branch since it was branched from master + $ git review test + +Show changes in hotfix1.1 branch since it was branched from v1.0 + $ git review hotfix1.1 v1.0 + +## AUTHOR + +Written by Craig MacGregor <> + +## REPORTING BUGS + +<> + +## SEE ALSO + +<> +