mirror of
https://github.com/iwata/git-now.git
synced 2026-09-15 01:46:17 -04:00
Merge branch 'release/0.0.3'
This commit is contained in:
commit
b606b79f71
15
git-now-grep
15
git-now-grep
|
|
@ -1,5 +1,5 @@
|
|||
usage() {
|
||||
echo "usage: git now grep [<base-branch>]"
|
||||
echo "usage: git now grep [--patch|-p] [--stat|-s] [<base-branch>]"
|
||||
}
|
||||
|
||||
cmd_default() {
|
||||
|
|
@ -8,18 +8,27 @@ cmd_default() {
|
|||
if [ -n "$BASE_BRANCH" ]; then
|
||||
WORKING_BRANCH=$(git_current_branch)
|
||||
COMMON_ANCESTOR_COMMIT=`git merge-base ${BASE_BRANCH} ${WORKING_BRANCH}`
|
||||
echo `git log ${COMMON_ANCESTOR_COMMIT}.. --pretty=oneline --grep="${PREFIX}"`
|
||||
git log${ARGS} ${COMMON_ANCESTOR_COMMIT}.. --pretty=format:"%h - %an, %ar : %s" --grep="${PREFIX}"
|
||||
else
|
||||
echo `git log --pretty=oneline --grep="${PREFIX}"`
|
||||
git log${ARGS} --pretty=format:"%h - %an, %ar : %s" --grep="${PREFIX}"
|
||||
fi
|
||||
}
|
||||
|
||||
parse_args() {
|
||||
# parse options
|
||||
DEFINE_boolean 'patch' false 'generate diff in patch format' 'p'
|
||||
DEFINE_boolean 'stat' false 'generate diffstat instead of patch' 's'
|
||||
FLAGS "$@" || exit $?
|
||||
eval set -- "${FLAGS_ARGV}"
|
||||
# read arguments into global variables
|
||||
BASE_BRANCH=$1
|
||||
ARGS=
|
||||
if flag patch; then
|
||||
ARGS="${ARGS} -p"
|
||||
fi
|
||||
if flag stat; then
|
||||
ARGS="${ARGS} --stat"
|
||||
fi
|
||||
}
|
||||
|
||||
cmd_help() {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
require 'formula'
|
||||
|
||||
class GitNow < Formula
|
||||
url 'https://github.com/iwata/git-now.git', :tag => 'v0.0.22'
|
||||
version '0.0.22'
|
||||
url 'https://github.com/iwata/git-now.git', :tag => 'v0.0.3'
|
||||
version '0.0.3'
|
||||
head 'https://github.com/iwata/git-now.git', :branch => 'develop'
|
||||
homepage 'https://github.com/iwata/git-now'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue