mirror of
https://github.com/iwata/git-now.git
synced 2026-09-10 07:26:29 -04:00
Merge branch 'release/0.1.0.0'
This commit is contained in:
commit
8e803596c0
|
|
@ -21,7 +21,8 @@ You can use the same option as ``git add``.
|
|||
Available subcommands are:
|
||||
|
||||
* rebase - rebase for temporary commits.
|
||||
* grep - grep temporary commits.
|
||||
* push - rebuild remote branch after rebase.
|
||||
* grep - grep temporary commits.
|
||||
|
||||
_Try 'git now \<subcommand\> help' for details._
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ __git-now-add ()
|
|||
'-e[open diff against index in editor]'\
|
||||
'-u[update only files git already knows about]'\
|
||||
'-N[record only that path will be added later]'\
|
||||
'-s[generate diffstat instead of patch]'\
|
||||
':filepattern:_files'
|
||||
}
|
||||
|
||||
|
|
@ -76,6 +77,7 @@ case $state in
|
|||
subcommands=(
|
||||
'add:default subcommand.'
|
||||
'rebase:rebase for temporary commits.'
|
||||
'push:remove remote branch and push to remote repoistory for rebase commits.'
|
||||
'grep:grep temporary commits.'
|
||||
)
|
||||
_describe -t commands 'git now' subcommands
|
||||
|
|
@ -95,6 +97,11 @@ case $state in
|
|||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
(push)
|
||||
_arguments \
|
||||
':remote-repostory:__git_remotes'
|
||||
;;
|
||||
|
||||
(grep)
|
||||
_arguments \
|
||||
'-p[generate diff in patch format]'\
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ _git-now ()
|
|||
subcommands=(
|
||||
'add:default subcommand.'
|
||||
'rebase:rebase for temporary commits.'
|
||||
'push:remove remote branch and push to remote repoistory for rebase commits.'
|
||||
'grep:grep temporary commits.'
|
||||
)
|
||||
_describe -t commands 'git now' subcommands
|
||||
|
|
@ -53,6 +54,11 @@ _git-now ()
|
|||
':branch-name:__git_branch_names'
|
||||
;;
|
||||
|
||||
(push)
|
||||
_arguments \
|
||||
':remote-repostory:__git_remotes'
|
||||
;;
|
||||
|
||||
(grep)
|
||||
_arguments \
|
||||
'-p[generate diff in patch format]'\
|
||||
|
|
@ -82,6 +88,7 @@ __git-now-add ()
|
|||
'-e[open diff against index in editor]'\
|
||||
'-u[update only files git already knows about]'\
|
||||
'-N[record only that path will be added later]'\
|
||||
'-s[generate diffstat instead of patch]'\
|
||||
':filepattern:_files'
|
||||
}
|
||||
|
||||
|
|
|
|||
1
git-now
1
git-now
|
|
@ -19,6 +19,7 @@ usage() {
|
|||
echo "Available subcommands are:"
|
||||
echo " add default subcommand."
|
||||
echo " rebase rebase for temporary commits."
|
||||
echo " push remove remote branch before push to remote repoistory for rebase commits."
|
||||
echo " grep grep temporary commits."
|
||||
echo
|
||||
echo "Try 'git now <subcommand> help' for details."
|
||||
|
|
|
|||
26
git-now-add
26
git-now-add
|
|
@ -1,7 +1,7 @@
|
|||
usage() {
|
||||
echo "usage: git now add [-n] [-v] [--force | -f] [--interactive | -i] [--patch | -p]"
|
||||
echo " [--edit | -e] [--all | [--update | -u]] [--intent-to-add | -N]"
|
||||
echo " [--refresh] [--ignore-errors] [--ignore-missing] [--]"
|
||||
echo " [--refresh] [--ignore-errors] [--ignore-missing] [ --stat | -s ] [--]"
|
||||
echo " [<filepattern>...]"
|
||||
}
|
||||
|
||||
|
|
@ -11,13 +11,32 @@ cmd_default() {
|
|||
git add -u
|
||||
printf "${MESSAGE}\n\n%s" "`git diff --cached`" | git commit -F -
|
||||
else
|
||||
local is_stat=false
|
||||
local args=()
|
||||
|
||||
# args loop
|
||||
for arg in "$@"
|
||||
do
|
||||
if [ $arg = "--stat" ] || [ $arg = "-s" ]; then
|
||||
is_stat=true
|
||||
else
|
||||
n=${#args[@]}
|
||||
args[$n]=$arg
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $1 != "--all" ]; then
|
||||
git add $@
|
||||
git add ${args[@]}
|
||||
else
|
||||
git add -u
|
||||
git add .
|
||||
fi
|
||||
printf "${MESSAGE}\n\n%s" "`git diff --cached`" | git commit -F -
|
||||
|
||||
if $is_stat; then
|
||||
printf "${MESSAGE}\n\n%s" "`git diff --cached --stat`" | git commit -F -
|
||||
else
|
||||
printf "${MESSAGE}\n\n%s" "`git diff --cached`" | git commit -F -
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -26,3 +45,4 @@ cmd_help() {
|
|||
exit 0
|
||||
}
|
||||
|
||||
# vim: set ff=unix ft=sh :
|
||||
|
|
|
|||
|
|
@ -41,3 +41,4 @@ cmd_help() {
|
|||
exit 0
|
||||
}
|
||||
|
||||
# vim: set ff=unix ft=sh :
|
||||
|
|
|
|||
23
git-now-push
Normal file
23
git-now-push
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
usage() {
|
||||
echo "usage: git now push [<remote-repository>]"
|
||||
}
|
||||
|
||||
|
||||
cmd_default() {
|
||||
REMOTE=$1
|
||||
|
||||
WORKING_BRANCH=$(git_current_branch)
|
||||
|
||||
if [ -n "$REMOTE" ]; then
|
||||
git push ${REMOTE} :${WORKING_BRANCH} && git push ${REMOTE} ${WORKING_BRANCH}
|
||||
else
|
||||
git push origin :${WORKING_BRANCH} && git push
|
||||
fi
|
||||
}
|
||||
|
||||
cmd_help() {
|
||||
usage
|
||||
exit 0
|
||||
}
|
||||
|
||||
# vim: set ff=unix ft=sh :
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
usage() {
|
||||
echo "usage: git now rebase [--mine|-m] [<base-branch>]"
|
||||
#echo " git now rebase --push [<base-branch>]"
|
||||
#echo " git now rebase --push --upstream <remote> [<base-branch>]"
|
||||
#echo " git now rebase --push --remove <remote> [<base-branch>]"
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -42,17 +39,6 @@ cmd_default() {
|
|||
git rebase --onto HEAD ${FIRST_NOW_COMMIT} ${WORKING_BRANCH}
|
||||
fi
|
||||
fi
|
||||
|
||||
#if flag push; then
|
||||
#if [ -n "$UPSTREAM_REMOTE" ]; then
|
||||
#git push --set-upstream $UPSTREAM_REMOTE $WORKING_BRANCH
|
||||
#elif [ -n "$REMOVE_REMOTE" ]; then
|
||||
#git push $REMOVE_REMOTE :$WORKING_BRANCH
|
||||
#git push
|
||||
#else
|
||||
#git push
|
||||
#fi
|
||||
#fi
|
||||
}
|
||||
|
||||
cmd_help() {
|
||||
|
|
@ -63,15 +49,11 @@ cmd_help() {
|
|||
parse_args() {
|
||||
# parse options
|
||||
DEFINE_boolean 'mine' false 'limit git-now commits by my name' 'm'
|
||||
#DEFINE_boolean 'push' false 'push to remote repository finally' ''
|
||||
#DEFINE_string 'remove' '' 'remote name to remove the remote branch before push' ''
|
||||
#DEFINE_string 'upstream' '' 'remote name for --set-upstream' ''
|
||||
FLAGS "$@" || exit $?
|
||||
eval set -- "${FLAGS_ARGV}"
|
||||
|
||||
# read arguments into global variables
|
||||
BASE_BRANCH=$1
|
||||
#UPSTREAM_REMOTE=$FLAGS_upstream
|
||||
#REMOVE_REMOTE=$FLAGS_remove
|
||||
}
|
||||
|
||||
# vim: set ff=unix ft=sh :
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
require 'formula'
|
||||
|
||||
class GitNow < Formula
|
||||
url 'https://github.com/iwata/git-now.git', :tag => 'v0.0.6.0'
|
||||
version '0.0.6.0'
|
||||
url 'https://github.com/iwata/git-now.git', :tag => 'v0.1.0.0'
|
||||
version '0.1.0.0'
|
||||
head 'https://github.com/iwata/git-now.git', :branch => 'develop'
|
||||
homepage 'https://github.com/iwata/git-now'
|
||||
|
||||
|
|
|
|||
|
|
@ -60,3 +60,5 @@ git_now_my_first_commit() {
|
|||
}
|
||||
|
||||
git_now_initial_commit() { git log --pretty=oneline | tail -n 1 | cut -d " " -f 1; }
|
||||
|
||||
# vim: set ff=unix ft=sh
|
||||
|
|
|
|||
Loading…
Reference in a new issue