From be15db9cdfb460eaab57f978904a46b07c9d5fc1 Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Fri, 7 Jul 2017 23:19:02 -0700 Subject: [PATCH 1/8] Fix Issue #186 Use `git create-branch` instead of `git checkout -b` in: git-bug git-chore git-feature git-refactor Since `git-finish` uses `git-delete-branch` (which expects the branch to have been pushed to origin) we should use `git-create-branch` to create it. --- bin/git-bug | 2 +- bin/git-chore | 2 +- bin/git-feature | 2 +- bin/git-refactor | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/git-bug b/bin/git-bug index b748600..3a538dd 100755 --- a/bin/git-bug +++ b/bin/git-bug @@ -10,5 +10,5 @@ else echo "too many arguments; if not finishing a bug, only of new bug is expected" && exit 1 fi branch=bug/$1 - git checkout -b $branch + git create-branch $branch fi diff --git a/bin/git-chore b/bin/git-chore index 47ac0a5..1050529 100755 --- a/bin/git-chore +++ b/bin/git-chore @@ -10,5 +10,5 @@ else echo "too many arguments; if not finishing a chore, only of new chore is expected" && exit 1 fi branch=chore/$1 - git checkout -b $branch + git create-branch $branch fi diff --git a/bin/git-feature b/bin/git-feature index 46292d3..4ba4812 100755 --- a/bin/git-feature +++ b/bin/git-feature @@ -37,5 +37,5 @@ else else branch="$branch_prefix"/"${argv[0]}" fi - git checkout -b $branch + git create-branch $branch fi diff --git a/bin/git-refactor b/bin/git-refactor index 445c0d2..4327335 100755 --- a/bin/git-refactor +++ b/bin/git-refactor @@ -10,5 +10,5 @@ else echo "too many arguments; if not finishing a refactor, only of new refactoring is expected" && exit 1 fi branch=refactor/$1 - git checkout -b $branch + git create-branch $branch fi From 61b2a2c703b7c8d8f436977014a1be195851fcc1 Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Sun, 9 Jul 2017 01:57:46 -0700 Subject: [PATCH 2/8] Add ability to specify a remote Use -r to push the new branch to origin Use -r to push to Will not auto push to origin if you do not use the argument --- bin/git-bug | 61 +++++++++++++++++++++++++++++++++++------- bin/git-chore | 62 ++++++++++++++++++++++++++++++++++++------- bin/git-create-branch | 37 ++++++++++++++++++++++---- bin/git-feature | 34 +++++++++++++++++------- bin/git-refactor | 62 ++++++++++++++++++++++++++++++++++++------- 5 files changed, 211 insertions(+), 45 deletions(-) diff --git a/bin/git-bug b/bin/git-bug index 3a538dd..3f6ebb8 100755 --- a/bin/git-bug +++ b/bin/git-bug @@ -1,14 +1,55 @@ #!/usr/bin/env bash -if test "$1" = "finish"; then - test -z $2 && echo "bug required." 1>&2 && exit 1 - branch=bug/$2 - git merge --no-ff $branch && git delete-branch $branch +branch_prefix=bug +declare -a argv +while test $# != 0 +do + case $1 in + -a|--alias ) + if [[ -n $2 ]] + then + shift # shift -a|-alias + branch_prefix=$1 + else + argv+=($1) # treat tail '-a' as + fi + ;; + -r|--remote ) + if [[ -n $2 ]] + then + remote=$2 + shift + else + remote="origin" + fi + ;; + * ) + argv+=($1) + ;; + esac + shift +done + +concatargs(){ + str=$(IFS='-'; echo "$*") + branch="$branch_prefix"/$str +} + +if test "${argv[0]}" = "finish"; then + test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + branch="$branch_prefix"/"${argv[1]}" + git merge --no-ff "$branch" && git delete-branch "$branch" else - test -z $1 && echo "bug required." 1>&2 && exit 1 - if test -n "$2"; then - echo "too many arguments; if not finishing a bug, only of new bug is expected" && exit 1 - fi - branch=bug/$1 - git create-branch $branch + test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + if test -n "${argv[1]}"; then + concatargs "${argv[@]}" + else + branch="$branch_prefix"/"${argv[0]}" + fi + if [[ -n $remote ]] + then + git create-branch -r $remote $branch + else + git create-branch $branch + fi fi diff --git a/bin/git-chore b/bin/git-chore index 1050529..c4f5dc3 100755 --- a/bin/git-chore +++ b/bin/git-chore @@ -1,14 +1,56 @@ #!/usr/bin/env bash -if test "$1" = "finish"; then - test -z $2 && echo "chore required." 1>&2 && exit 1 - branch=chore/$2 - git merge --no-ff $branch && git delete-branch $branch +branch_prefix=chore +declare -a argv +while test $# != 0 +do + case $1 in + -a|--alias ) + if [[ -n $2 ]] + then + shift # shift -a|-alias + branch_prefix=$1 + else + argv+=($1) # treat tail '-a' as + fi + ;; + -r|--remote ) + if [[ -n $2 ]] + then + remote=$2 + shift + else + remote="origin" + fi + ;; + * ) + argv+=($1) + ;; + esac + shift +done + +concatargs(){ + str=$(IFS='-'; echo "$*") + branch="$branch_prefix"/$str +} + +if test "${argv[0]}" = "finish"; then + test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + branch="$branch_prefix"/"${argv[1]}" + git merge --no-ff "$branch" && git delete-branch "$branch" else - test -z $1 && echo "chore required." 1>&2 && exit 1 - if test -n "$2"; then - echo "too many arguments; if not finishing a chore, only of new chore is expected" && exit 1 - fi - branch=chore/$1 - git create-branch $branch + test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + if test -n "${argv[1]}"; then + concatargs "${argv[@]}" + else + branch="$branch_prefix"/"${argv[0]}" + fi + if [[ -n $remote ]] + then + git create-branch -r $remote $branch + else + git create-branch $branch + fi fi + diff --git a/bin/git-create-branch b/bin/git-create-branch index e0f9035..8e335b7 100755 --- a/bin/git-create-branch +++ b/bin/git-create-branch @@ -1,8 +1,35 @@ #!/usr/bin/env bash -branch=$1 -test -z $branch && echo "branch required." 1>&2 && exit 1 +for param in $* +do + case $param in + -r|--remote) + if [ $# -eq 2 ] + then + BRANCH=$2 + else + REMOTE=$2 + BRANCH=$3 + fi + ;; + *) + BRANCH=$param + esac +done + +test -z $BRANCH && echo "branch required." 1>&2 && exit 1 +if [[ -n $REMOTE ]] +then + git ls-remote --exit-code $REMOTE &>/dev/null + if [ $? = 0 ] + then + git push $REMOTE HEAD:refs/heads/$BRANCH + git fetch $REMOTE + git checkout --track -b $BRANCH $REMOTE/$BRANCH + else + git checkout -b $BRANCH + fi +else + git checkout -b $BRANCH +fi -git push origin HEAD:refs/heads/$branch -git fetch origin -git checkout --track -b $branch origin/$branch diff --git a/bin/git-feature b/bin/git-feature index 4ba4812..cc2ff20 100755 --- a/bin/git-feature +++ b/bin/git-feature @@ -14,6 +14,15 @@ do argv+=($1) # treat tail '-a' as fi ;; + -r|--remote ) + if [[ -n $2 ]] + then + remote=$2 + shift + else + remote="origin" + fi + ;; * ) argv+=($1) ;; @@ -27,15 +36,20 @@ concatargs(){ } if test "${argv[0]}" = "finish"; then - test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - branch="$branch_prefix"/"${argv[1]}" - git merge --no-ff "$branch" && git delete-branch "$branch" + test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + branch="$branch_prefix"/"${argv[1]}" + git merge --no-ff "$branch" && git delete-branch "$branch" else - test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - if test -n "${argv[1]}"; then - concatargs "${argv[@]}" - else - branch="$branch_prefix"/"${argv[0]}" - fi - git create-branch $branch + test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + if test -n "${argv[1]}"; then + concatargs "${argv[@]}" + else + branch="$branch_prefix"/"${argv[0]}" + fi + if [[ -n $remote ]] + then + git create-branch -r $remote $branch + else + git create-branch $branch + fi fi diff --git a/bin/git-refactor b/bin/git-refactor index 4327335..a5dfe77 100755 --- a/bin/git-refactor +++ b/bin/git-refactor @@ -1,14 +1,56 @@ #!/usr/bin/env bash -if test "$1" = "finish"; then - test -z $2 && echo "refactor required." 1>&2 && exit 1 - branch=refactor/$2 - git merge --no-ff $branch && git delete-branch $branch +branch_prefix=refactor +declare -a argv +while test $# != 0 +do + case $1 in + -a|--alias ) + if [[ -n $2 ]] + then + shift # shift -a|-alias + branch_prefix=$1 + else + argv+=($1) # treat tail '-a' as + fi + ;; + -r|--remote ) + if [[ -n $2 ]] + then + remote=$2 + shift + else + remote="origin" + fi + ;; + * ) + argv+=($1) + ;; + esac + shift +done + +concatargs(){ + str=$(IFS='-'; echo "$*") + branch="$branch_prefix"/$str +} + +if test "${argv[0]}" = "finish"; then + test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + branch="$branch_prefix"/"${argv[1]}" + git merge --no-ff "$branch" && git delete-branch "$branch" else - test -z $1 && echo "refactor required." 1>&2 && exit 1 - if test -n "$2"; then - echo "too many arguments; if not finishing a refactor, only of new refactoring is expected" && exit 1 - fi - branch=refactor/$1 - git create-branch $branch + test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 + if test -n "${argv[1]}"; then + concatargs "${argv[@]}" + else + branch="$branch_prefix"/"${argv[0]}" + fi + if [[ -n $remote ]] + then + git create-branch -r $remote $branch + else + git create-branch $branch + fi fi + From 93150aa4114c51f9426b95101a5b84fbdc628ddf Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Sun, 9 Jul 2017 12:10:19 -0700 Subject: [PATCH 3/8] Allow -r parameter to be in any order in command line --- bin/git-create-branch | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/bin/git-create-branch b/bin/git-create-branch index 8e335b7..6035840 100755 --- a/bin/git-create-branch +++ b/bin/git-create-branch @@ -1,22 +1,30 @@ #!/usr/bin/env bash -for param in $* +while test $# != 0 do - case $param in + case $1 in -r|--remote) - if [ $# -eq 2 ] + if [[ -n $2 ]] then - BRANCH=$2 - else REMOTE=$2 - BRANCH=$3 + shift + else + REMOTE=origin + shift fi ;; *) - BRANCH=$param + BRANCH=$1 esac + shift done +if [[ -z $BRANCH ]] && [[ -n $REMOTE ]] +then + BRANCH=$REMOTE + REMOTE=origin +fi + test -z $BRANCH && echo "branch required." 1>&2 && exit 1 if [[ -n $REMOTE ]] then @@ -26,10 +34,10 @@ then git push $REMOTE HEAD:refs/heads/$BRANCH git fetch $REMOTE git checkout --track -b $BRANCH $REMOTE/$BRANCH - else - git checkout -b $BRANCH + exit $? fi -else - git checkout -b $BRANCH fi +git checkout -b $BRANCH +exit $? + From a75411b0298b1e045723e54c0cb74765949a1dae Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Tue, 11 Jul 2017 21:42:02 -0700 Subject: [PATCH 4/8] Consolidate feature/bug/chore/refactor logic Remove unneccesary code --- bin/git-bug | 55 ++---------------------------------------- bin/git-chore | 56 ++----------------------------------------- bin/git-create-branch | 3 --- bin/git-refactor | 56 ++----------------------------------------- 4 files changed, 6 insertions(+), 164 deletions(-) diff --git a/bin/git-bug b/bin/git-bug index 3f6ebb8..4cb6cb1 100755 --- a/bin/git-bug +++ b/bin/git-bug @@ -1,55 +1,4 @@ #!/usr/bin/env bash -branch_prefix=bug -declare -a argv -while test $# != 0 -do - case $1 in - -a|--alias ) - if [[ -n $2 ]] - then - shift # shift -a|-alias - branch_prefix=$1 - else - argv+=($1) # treat tail '-a' as - fi - ;; - -r|--remote ) - if [[ -n $2 ]] - then - remote=$2 - shift - else - remote="origin" - fi - ;; - * ) - argv+=($1) - ;; - esac - shift -done - -concatargs(){ - str=$(IFS='-'; echo "$*") - branch="$branch_prefix"/$str -} - -if test "${argv[0]}" = "finish"; then - test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - branch="$branch_prefix"/"${argv[1]}" - git merge --no-ff "$branch" && git delete-branch "$branch" -else - test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - if test -n "${argv[1]}"; then - concatargs "${argv[@]}" - else - branch="$branch_prefix"/"${argv[0]}" - fi - if [[ -n $remote ]] - then - git create-branch -r $remote $branch - else - git create-branch $branch - fi -fi +ALIAS=bug +git feature -a $ALIAS $@ diff --git a/bin/git-chore b/bin/git-chore index c4f5dc3..8e417cd 100755 --- a/bin/git-chore +++ b/bin/git-chore @@ -1,56 +1,4 @@ #!/usr/bin/env bash -branch_prefix=chore -declare -a argv -while test $# != 0 -do - case $1 in - -a|--alias ) - if [[ -n $2 ]] - then - shift # shift -a|-alias - branch_prefix=$1 - else - argv+=($1) # treat tail '-a' as - fi - ;; - -r|--remote ) - if [[ -n $2 ]] - then - remote=$2 - shift - else - remote="origin" - fi - ;; - * ) - argv+=($1) - ;; - esac - shift -done - -concatargs(){ - str=$(IFS='-'; echo "$*") - branch="$branch_prefix"/$str -} - -if test "${argv[0]}" = "finish"; then - test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - branch="$branch_prefix"/"${argv[1]}" - git merge --no-ff "$branch" && git delete-branch "$branch" -else - test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - if test -n "${argv[1]}"; then - concatargs "${argv[@]}" - else - branch="$branch_prefix"/"${argv[0]}" - fi - if [[ -n $remote ]] - then - git create-branch -r $remote $branch - else - git create-branch $branch - fi -fi - +ALIAS=chore +git feature -a $ALIAS $@ diff --git a/bin/git-create-branch b/bin/git-create-branch index 6035840..9b2f86e 100755 --- a/bin/git-create-branch +++ b/bin/git-create-branch @@ -10,7 +10,6 @@ do shift else REMOTE=origin - shift fi ;; *) @@ -39,5 +38,3 @@ then fi git checkout -b $BRANCH -exit $? - diff --git a/bin/git-refactor b/bin/git-refactor index a5dfe77..c61df45 100755 --- a/bin/git-refactor +++ b/bin/git-refactor @@ -1,56 +1,4 @@ #!/usr/bin/env bash -branch_prefix=refactor -declare -a argv -while test $# != 0 -do - case $1 in - -a|--alias ) - if [[ -n $2 ]] - then - shift # shift -a|-alias - branch_prefix=$1 - else - argv+=($1) # treat tail '-a' as - fi - ;; - -r|--remote ) - if [[ -n $2 ]] - then - remote=$2 - shift - else - remote="origin" - fi - ;; - * ) - argv+=($1) - ;; - esac - shift -done - -concatargs(){ - str=$(IFS='-'; echo "$*") - branch="$branch_prefix"/$str -} - -if test "${argv[0]}" = "finish"; then - test -z "${argv[1]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - branch="$branch_prefix"/"${argv[1]}" - git merge --no-ff "$branch" && git delete-branch "$branch" -else - test -z "${argv[0]}" && echo "$branch_prefix" " required." 1>&2 && exit 1 - if test -n "${argv[1]}"; then - concatargs "${argv[@]}" - else - branch="$branch_prefix"/"${argv[0]}" - fi - if [[ -n $remote ]] - then - git create-branch -r $remote $branch - else - git create-branch $branch - fi -fi - +ALIAS=refactor +git feature -a $ALIAS $@ From c064956f85775d500e0276987b21c71c76473d66 Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Tue, 11 Jul 2017 23:37:16 -0700 Subject: [PATCH 5/8] Use "$@" instead of $@ --- bin/git-bug | 2 +- bin/git-chore | 2 +- bin/git-refactor | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/git-bug b/bin/git-bug index 4cb6cb1..c2672f7 100755 --- a/bin/git-bug +++ b/bin/git-bug @@ -1,4 +1,4 @@ #!/usr/bin/env bash ALIAS=bug -git feature -a $ALIAS $@ +git feature -a $ALIAS "$@" diff --git a/bin/git-chore b/bin/git-chore index 8e417cd..728b2aa 100755 --- a/bin/git-chore +++ b/bin/git-chore @@ -1,4 +1,4 @@ #!/usr/bin/env bash ALIAS=chore -git feature -a $ALIAS $@ +git feature -a $ALIAS "$@" diff --git a/bin/git-refactor b/bin/git-refactor index c61df45..2e2a83a 100755 --- a/bin/git-refactor +++ b/bin/git-refactor @@ -1,4 +1,4 @@ #!/usr/bin/env bash ALIAS=refactor -git feature -a $ALIAS $@ +git feature -a $ALIAS "$@" From ab6c51bb8f6a3eba6bc9d7ed106ceed49f5e7a5a Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Wed, 12 Jul 2017 00:14:24 -0700 Subject: [PATCH 6/8] Update docs for new behavior `git create branch` `git feature|bug|chore|refactor` --- Commands.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Commands.md b/Commands.md index e05b7d7..36100bb 100644 --- a/Commands.md +++ b/Commands.md @@ -100,6 +100,13 @@ Create/Merge the given feature, refactor, bug or chore branch `name`: $ git feature dependencies ``` +To Setup a remote tracking branch: + +```bash +$ git feature dependencies -r upstream +``` +_Note_: If no remote name is passed with the `-r` option, it will push to _origin_. + Afterwards, the same command will check it out: ```bash @@ -114,6 +121,8 @@ $ git checkout master $ git feature finish dependencies ``` +_Note_: If a remote is setup to track the branch, it will be deleted. + All of this works with `feature`, `bug`, `chore` or `refactor`. ## git contrib @@ -708,12 +717,24 @@ $ git info --no-config ## git create-branch -Create local and remote branch `name`: +Create local branch `name`: ```bash $ git create-branch development ``` +Create local branch `name` and setup a remote tracking branch in `origin`: + +```bash +$ git create-branch -r development +``` + +Create local branch `name` and setup a remote tracking branch in `upstream`: + +```bash +$ git create-branch -r upstream development +``` + ## git delete-branch Delete local and remote branch `name`: From 4dc76ef81ba423688d205a2b95f6f73b02e9dc8f Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Wed, 12 Jul 2017 00:53:44 -0700 Subject: [PATCH 7/8] Update man pages --- man/git-bug.1 | 18 ++++++++++++++++-- man/git-bug.html | 15 ++++++++++++--- man/git-bug.md | 13 +++++++++++-- man/git-chore.1 | 15 +++++++++++++-- man/git-chore.html | 13 ++++++++++--- man/git-chore.md | 11 +++++++++-- man/git-create-branch.1 | 19 ++++++++++++++++--- man/git-create-branch.html | 17 +++++++++++++---- man/git-create-branch.md | 15 ++++++++++++--- man/git-feature.1 | 15 +++++++++++++-- man/git-feature.html | 13 ++++++++++--- man/git-feature.md | 11 +++++++++-- man/git-refactor.1 | 15 +++++++++++++-- man/git-refactor.html | 13 ++++++++++--- man/git-refactor.md | 11 +++++++++-- 15 files changed, 176 insertions(+), 38 deletions(-) diff --git a/man/git-bug.1 b/man/git-bug.1 index bf3670a..6bc8966 100644 --- a/man/git-bug.1 +++ b/man/git-bug.1 @@ -1,24 +1,33 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-BUG" "1" "December 2015" "" "" +.TH "GIT\-BUG" "1" "July 2017" "" "" . .SH "NAME" \fBgit\-bug\fR \- Create bug branch . .SH "SYNOPSIS" -\fBgit\-bug\fR [finish] +\fBgit\-bug\fR [\-r|\-\-remote [remote_name]] [finish] . .SH "DESCRIPTION" Create the given bug branch . .SH "OPTIONS" +<\-r|\-\-remote [remote_name]> +. +.P +Setup a remote tracking branch using \fBremote_name\fR\. If \fBremote_name\fR is not supplied, use \fBorigin\fR by default\. +. +.P . .P Merge and delete the bug branch\. . .P +<\-r +. +.P . .P @@ -34,12 +43,17 @@ $ git commit \-m "Some changes" \.\.\. $ git checkout master $ git bug finish bug\-123456 + +$ git bug \-r 12345 . .fi . .SH "AUTHOR" Written by Jesús Espino <\fIjespinog@gmail\.com\fR> . +.br +Modified by Mark Pitman <\fImark\.pitman@gmail\.com\fR> +. .SH "REPORTING BUGS" <\fIhttps://github\.com/tj/git\-extras/issues\fR> . diff --git a/man/git-bug.html b/man/git-bug.html index b7c0917..64bd56f 100644 --- a/man/git-bug.html +++ b/man/git-bug.html @@ -76,7 +76,7 @@

SYNOPSIS

-

git-bug [finish] <name>

+

git-bug [-r|--remote [remote_name]] [finish] <name>

DESCRIPTION

@@ -84,10 +84,16 @@

OPTIONS

+

<-r|--remote [remote_name]>

+ +

Setup a remote tracking branch using remote_name. If remote_name is not supplied, use origin by default.

+

<finish>

Merge and delete the bug branch.

+

<-r

+

<name>

The name of the bug branch.

@@ -100,11 +106,14 @@ $ git commit -m "Some changes" ... $ git checkout master $ git bug finish bug-123456 + +$ git bug -r 12345

AUTHOR

-

Written by Jesús Espino <jespinog@gmail.com>

+

Written by Jesús Espino <jespinog@gmail.com>
+Modified by Mark Pitman <mark.pitman@gmail.com>

REPORTING BUGS

@@ -117,7 +126,7 @@ $ git bug finish bug-123456
  1. -
  2. December 2015
  3. +
  4. July 2017
  5. git-bug(1)
diff --git a/man/git-bug.md b/man/git-bug.md index 0a241d4..d6482e4 100644 --- a/man/git-bug.md +++ b/man/git-bug.md @@ -3,7 +3,7 @@ git-bug(1) -- Create bug branch ## SYNOPSIS -`git-bug` [finish] <name> +`git-bug` [-r|--remote [remote_name]] [finish] <name> ## DESCRIPTION @@ -11,10 +11,16 @@ git-bug(1) -- Create bug branch ## OPTIONS + <-r|--remote [remote_name]> + + Setup a remote tracking branch using `remote_name`. If `remote_name` is not supplied, use `origin` by default. + <finish> Merge and delete the bug branch. + <-r + <name> The name of the bug branch. @@ -28,9 +34,12 @@ git-bug(1) -- Create bug branch $ git checkout master $ git bug finish bug-123456 + $ git bug -r 12345 + ## AUTHOR -Written by Jesús Espino <> +Written by Jesús Espino <> +Modified by Mark Pitman <> ## REPORTING BUGS diff --git a/man/git-chore.1 b/man/git-chore.1 index 9e169f4..25ca64f 100644 --- a/man/git-chore.1 +++ b/man/git-chore.1 @@ -1,18 +1,24 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-CHORE" "1" "December 2015" "" "" +.TH "GIT\-CHORE" "1" "July 2017" "" "" . .SH "NAME" \fBgit\-chore\fR \- Create chore branch . .SH "SYNOPSIS" -\fBgit\-chore\fR [finish] +\fBgit\-chore\fR [\-r|\-\-remote [remote_name]] [finish] . .SH "DESCRIPTION" Create the given chore branch . .SH "OPTIONS" +<\-r|\-\-remote [remote_name]> +. +.P +Setup a remote tracking branch using \fBremote_name\fR\. If \fBremote_name\fR is not supplied, use \fBorigin\fR by default\. +. +.P . .P @@ -34,12 +40,17 @@ $ git commit \-m "Some changes" \.\.\. $ git checkout master $ git chore finish chore\-123456 + +$ git chore \-r upstream 123456 . .fi . .SH "AUTHOR" Written by Chris Hall <\fIchristopher\.k\.hall@gmail\.com\fR> from bug/feature/refactor commands originally written by Jesús Espino <\fIjespinog@gmail\.com\fR> . +.br +Modified by Mark Pitman <\fImark\.pitman@gmail\.com\fR> +. .SH "REPORTING BUGS" <\fIhttps://github\.com/tj/git\-extras/issues\fR> . diff --git a/man/git-chore.html b/man/git-chore.html index 2da85e3..f41c6a5 100644 --- a/man/git-chore.html +++ b/man/git-chore.html @@ -76,7 +76,7 @@

SYNOPSIS

-

git-chore [finish] <name>

+

git-chore [-r|--remote [remote_name]] [finish] <name>

DESCRIPTION

@@ -84,6 +84,10 @@

OPTIONS

+

<-r|--remote [remote_name]>

+ +

Setup a remote tracking branch using remote_name. If remote_name is not supplied, use origin by default.

+

<finish>

Merge and delete the chore branch.

@@ -100,11 +104,14 @@ $ git commit -m "Some changes" ... $ git checkout master $ git chore finish chore-123456 + +$ git chore -r upstream 123456

AUTHOR

-

Written by Chris Hall <christopher.k.hall@gmail.com> from bug/feature/refactor commands originally written by Jesús Espino <jespinog@gmail.com>

+

Written by Chris Hall <christopher.k.hall@gmail.com> from bug/feature/refactor commands originally written by Jesús Espino <jespinog@gmail.com>
+Modified by Mark Pitman <mark.pitman@gmail.com>

REPORTING BUGS

@@ -117,7 +124,7 @@ $ git chore finish chore-123456
  1. -
  2. December 2015
  3. +
  4. July 2017
  5. git-chore(1)
diff --git a/man/git-chore.md b/man/git-chore.md index eb13fa5..4202d49 100644 --- a/man/git-chore.md +++ b/man/git-chore.md @@ -3,7 +3,7 @@ git-chore(1) -- Create chore branch ## SYNOPSIS -`git-chore` [finish] <name> +`git-chore` [-r|--remote [remote_name]] [finish] <name> ## DESCRIPTION @@ -11,6 +11,10 @@ git-chore(1) -- Create chore branch ## OPTIONS + <-r|--remote [remote_name]> + + Setup a remote tracking branch using `remote_name`. If `remote_name` is not supplied, use `origin` by default. + <finish> Merge and delete the chore branch. @@ -28,9 +32,12 @@ git-chore(1) -- Create chore branch $ git checkout master $ git chore finish chore-123456 + $ git chore -r upstream 123456 + ## AUTHOR -Written by Chris Hall <> from bug/feature/refactor commands originally written by Jesús Espino <> +Written by Chris Hall <> from bug/feature/refactor commands originally written by Jesús Espino <> +Modified by Mark Pitman <> ## REPORTING BUGS diff --git a/man/git-create-branch.1 b/man/git-create-branch.1 index 00d6903..086aa17 100644 --- a/man/git-create-branch.1 +++ b/man/git-create-branch.1 @@ -1,18 +1,24 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-CREATE\-BRANCH" "1" "December 2015" "" "" +.TH "GIT\-CREATE\-BRANCH" "1" "July 2017" "" "" . .SH "NAME" \fBgit\-create\-branch\fR \- Create branches . .SH "SYNOPSIS" -\fBgit\-create\-branch\fR +\fBgit\-create\-branch\fR [\-r|\-\-remote [remote_name]] . .SH "DESCRIPTION" -Creates local and remote branch named \. +Creates local branch named and optionally sets up a remote tracking branch\. . .SH "OPTIONS" +<\-r|\-\-remote [remote_name]> +. +.P +Setup a remote tracking branch using \fBremote_name\fR\. If \fBremote_name\fR is not supplied, use \fBorigin\fR by default\. +. +.P . .P @@ -23,12 +29,19 @@ The name of the branch to create\. .nf $ git create\-branch integration + +$ git create\-branch \-r integration + +$ git create\-branch \-r upstream integration . .fi . .SH "AUTHOR" Written by Jonhnny Weslley <\fIjw@jonhnnyweslley\.net\fR> . +.br +Modified by Mark Pitman <\fImark\.pitman@gmail\.com\fR> +. .SH "REPORTING BUGS" <\fIhttps://github\.com/tj/git\-extras/issues\fR> . diff --git a/man/git-create-branch.html b/man/git-create-branch.html index 9b91c4d..9bc0239 100644 --- a/man/git-create-branch.html +++ b/man/git-create-branch.html @@ -76,14 +76,18 @@

SYNOPSIS

-

git-create-branch <branchname>

+

git-create-branch [-r|--remote [remote_name]] <branchname>

DESCRIPTION

-

Creates local and remote branch named <branchname>.

+

Creates local branch named <branchname> and optionally sets up a remote tracking branch.

OPTIONS

+

<-r|--remote [remote_name]>

+ +

Setup a remote tracking branch using remote_name. If remote_name is not supplied, use origin by default.

+

<branchname>

The name of the branch to create.

@@ -91,11 +95,16 @@

EXAMPLES

$ git create-branch integration
+
+$ git create-branch -r integration
+
+$ git create-branch -r upstream integration
 

AUTHOR

-

Written by Jonhnny Weslley <jw@jonhnnyweslley.net>

+

Written by Jonhnny Weslley <jw@jonhnnyweslley.net>
+Modified by Mark Pitman <mark.pitman@gmail.com>

REPORTING BUGS

@@ -108,7 +117,7 @@
  1. -
  2. December 2015
  3. +
  4. July 2017
  5. git-create-branch(1)
diff --git a/man/git-create-branch.md b/man/git-create-branch.md index 029bf27..98b15ae 100644 --- a/man/git-create-branch.md +++ b/man/git-create-branch.md @@ -3,14 +3,18 @@ git-create-branch(1) -- Create branches ## SYNOPSIS -`git-create-branch` <branchname> +`git-create-branch` [-r|--remote [remote_name]] <branchname> ## DESCRIPTION - Creates local and remote branch named <branchname>. + Creates local branch named <branchname> and optionally sets up a remote tracking branch. ## OPTIONS + <-r|--remote [remote_name]> + + Setup a remote tracking branch using `remote_name`. If `remote_name` is not supplied, use `origin` by default. + <branchname> The name of the branch to create. @@ -19,9 +23,14 @@ git-create-branch(1) -- Create branches $ git create-branch integration + $ git create-branch -r integration + + $ git create-branch -r upstream integration + ## AUTHOR -Written by Jonhnny Weslley <> +Written by Jonhnny Weslley <> +Modified by Mark Pitman <> ## REPORTING BUGS diff --git a/man/git-feature.1 b/man/git-feature.1 index 1f3291f..7c39fdc 100644 --- a/man/git-feature.1 +++ b/man/git-feature.1 @@ -1,13 +1,13 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-FEATURE" "1" "December 2015" "" "" +.TH "GIT\-FEATURE" "1" "July 2017" "" "" . .SH "NAME" \fBgit\-feature\fR \- Create/Merge feature branch . .SH "SYNOPSIS" -\fBgit\-feature\fR [\-a|\-\-alias branch_prefix] [finish] +\fBgit\-feature\fR [\-a|\-\-alias branch_prefix] [\-r|\-\-remote [remote_name]] [finish] . .SH "DESCRIPTION" Create/Merge the given feature branch @@ -19,6 +19,12 @@ Create/Merge the given feature branch use \fBbranch_prefix\fR instead of \fBfeature\fR . .P +<\-r|\-\-remote [remote_name]> +. +.P +Setup a remote tracking branch using \fBremote_name\fR\. If \fBremote_name\fR is not supplied, use \fBorigin\fR by default\. +. +.P . .P @@ -46,12 +52,17 @@ $ git features dependencies $ (features/dependencies) \.\.\. $ (features/dependencies) git checkout master $ git features finish dependencies + +$ git feature dependencies \-r upstream . .fi . .SH "AUTHOR" Written by Jesús Espino <\fIjespinog@gmail\.com\fR> . +.br +Modified by Mark Pitman <\fImark\.pitman@gmail\.com\fR> +. .SH "REPORTING BUGS" <\fIhttps://github\.com/tj/git\-extras/issues\fR> . diff --git a/man/git-feature.html b/man/git-feature.html index 0374e9e..d614bb2 100644 --- a/man/git-feature.html +++ b/man/git-feature.html @@ -76,7 +76,7 @@

SYNOPSIS

-

git-feature [-a|--alias branch_prefix] [finish] <name>

+

git-feature [-a|--alias branch_prefix] [-r|--remote [remote_name]] [finish] <name>

DESCRIPTION

@@ -88,6 +88,10 @@

use branch_prefix instead of feature

+

<-r|--remote [remote_name]>

+ +

Setup a remote tracking branch using remote_name. If remote_name is not supplied, use origin by default.

+

<finish>

Merge and delete the feature branch.

@@ -110,11 +114,14 @@ $ git features dependencies $ (features/dependencies) ... $ (features/dependencies) git checkout master $ git features finish dependencies + +$ git feature dependencies -r upstream

AUTHOR

-

Written by Jesús Espino <jespinog@gmail.com>

+

Written by Jesús Espino <jespinog@gmail.com>
+Modified by Mark Pitman <mark.pitman@gmail.com>

REPORTING BUGS

@@ -127,7 +134,7 @@ $ git features finish dependencies
  1. -
  2. December 2015
  3. +
  4. July 2017
  5. git-feature(1)
diff --git a/man/git-feature.md b/man/git-feature.md index 0c78c9c..44a1b19 100644 --- a/man/git-feature.md +++ b/man/git-feature.md @@ -3,7 +3,7 @@ git-feature(1) -- Create/Merge feature branch ## SYNOPSIS -`git-feature` [-a|--alias branch_prefix] [finish] <name> +`git-feature` [-a|--alias branch_prefix] [-r|--remote [remote_name]] [finish] <name> ## DESCRIPTION @@ -15,6 +15,10 @@ git-feature(1) -- Create/Merge feature branch use `branch_prefix` instead of `feature` + <-r|--remote [remote_name]> + + Setup a remote tracking branch using `remote_name`. If `remote_name` is not supplied, use `origin` by default. + <finish> Merge and delete the feature branch. @@ -38,9 +42,12 @@ git-feature(1) -- Create/Merge feature branch $ (features/dependencies) git checkout master $ git features finish dependencies + $ git feature dependencies -r upstream + ## AUTHOR -Written by Jesús Espino <> +Written by Jesús Espino <> +Modified by Mark Pitman <> ## REPORTING BUGS diff --git a/man/git-refactor.1 b/man/git-refactor.1 index 6c14de0..cf0556d 100644 --- a/man/git-refactor.1 +++ b/man/git-refactor.1 @@ -1,18 +1,24 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-REFACTOR" "1" "December 2015" "" "" +.TH "GIT\-REFACTOR" "1" "July 2017" "" "" . .SH "NAME" \fBgit\-refactor\fR \- Create refactor branch . .SH "SYNOPSIS" -\fBgit\-refactor\fR [finish] +\fBgit\-refactor\fR [\-r|\-\-remote [remote_name]] [finish] . .SH "DESCRIPTION" Create the given refactor branch . .SH "OPTIONS" +<\-r|\-\-remote [remote_name]> +. +.P +Setup a remote tracking branch using \fBremote_name\fR\. If \fBremote_name\fR is not supplied, use \fBorigin\fR by default\. +. +.P . .P @@ -34,12 +40,17 @@ $ git commit \-m "Some changes" \.\.\. $ git checkout master $ git refactor finish mainlib_refactor + +$ $ git refactor \-r upstream mainlib_refactor . .fi . .SH "AUTHOR" Written by Jesús Espino <\fIjespinog@gmail\.com\fR> . +.br +Modified by Mark Pitman <\fImark\.pitman@gmail\.com\fR> +. .SH "REPORTING BUGS" <\fIhttps://github\.com/tj/git\-extras/issues\fR> . diff --git a/man/git-refactor.html b/man/git-refactor.html index 4a1e292..3f2e333 100644 --- a/man/git-refactor.html +++ b/man/git-refactor.html @@ -76,7 +76,7 @@

SYNOPSIS

-

git-refactor [finish] <name>

+

git-refactor [-r|--remote [remote_name]] [finish] <name>

DESCRIPTION

@@ -84,6 +84,10 @@

OPTIONS

+

<-r|--remote [remote_name]>

+ +

Setup a remote tracking branch using remote_name. If remote_name is not supplied, use origin by default.

+

<finish>

Merge and delete the refactor branch.

@@ -100,11 +104,14 @@ $ git commit -m "Some changes" ... $ git checkout master $ git refactor finish mainlib_refactor + +$ $ git refactor -r upstream mainlib_refactor

AUTHOR

-

Written by Jesús Espino <jespinog@gmail.com>

+

Written by Jesús Espino <jespinog@gmail.com>
+Modified by Mark Pitman <mark.pitman@gmail.com>

REPORTING BUGS

@@ -117,7 +124,7 @@ $ git refactor finish mainlib_refactor
  1. -
  2. December 2015
  3. +
  4. July 2017
  5. git-refactor(1)
diff --git a/man/git-refactor.md b/man/git-refactor.md index a394ea1..b1f9676 100644 --- a/man/git-refactor.md +++ b/man/git-refactor.md @@ -3,7 +3,7 @@ git-refactor(1) -- Create refactor branch ## SYNOPSIS -`git-refactor` [finish] <name> +`git-refactor` [-r|--remote [remote_name]] [finish] <name> ## DESCRIPTION @@ -11,6 +11,10 @@ git-refactor(1) -- Create refactor branch ## OPTIONS + <-r|--remote [remote_name]> + + Setup a remote tracking branch using `remote_name`. If `remote_name` is not supplied, use `origin` by default. + <finish> Merge and delete the refactor branch. @@ -28,9 +32,12 @@ git-refactor(1) -- Create refactor branch $ git checkout master $ git refactor finish mainlib_refactor + $ $ git refactor -r upstream mainlib_refactor + ## AUTHOR -Written by Jesús Espino <> +Written by Jesús Espino <> +Modified by Mark Pitman <> ## REPORTING BUGS From d990270de787ba2ce0bf2a681610bfefa92f3a6b Mon Sep 17 00:00:00 2001 From: Mark Pitman Date: Wed, 12 Jul 2017 20:07:25 -0700 Subject: [PATCH 8/8] Update man page for `create-branch` Add notes section to talk about change in default behavior. --- man/git-create-branch.1 | 3 +++ man/git-create-branch.html | 9 +++++++-- man/git-create-branch.md | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/man/git-create-branch.1 b/man/git-create-branch.1 index 086aa17..c20cb95 100644 --- a/man/git-create-branch.1 +++ b/man/git-create-branch.1 @@ -36,6 +36,9 @@ $ git create\-branch \-r upstream integration . .fi . +.SH "NOTES" +As of 4\.4\.0, the default behavior has changed\. \fBgit\-create\-branch\fR will no longer automatically setup a remote tracking branch unless the \fB\-r|\-remote\fR option is specified\. +. .SH "AUTHOR" Written by Jonhnny Weslley <\fIjw@jonhnnyweslley\.net\fR> . diff --git a/man/git-create-branch.html b/man/git-create-branch.html index 9bc0239..8bc8d4b 100644 --- a/man/git-create-branch.html +++ b/man/git-create-branch.html @@ -58,6 +58,7 @@ DESCRIPTION OPTIONS EXAMPLES + NOTES AUTHOR REPORTING BUGS SEE ALSO @@ -101,10 +102,14 @@ $ git create-branch -r integration $ git create-branch -r upstream integration +

NOTES

+ +

As of 4.4.0, the default behavior has changed. git-create-branch will no longer automatically setup a remote tracking branch unless the -r|-remote option is specified.

+

AUTHOR

-

Written by Jonhnny Weslley <jw@jonhnnyweslley.net>
-Modified by Mark Pitman <mark.pitman@gmail.com>

+

Written by Jonhnny Weslley <jw@jonhnnyweslley.net>
+Modified by Mark Pitman <mark.pitman@gmail.com>

REPORTING BUGS

diff --git a/man/git-create-branch.md b/man/git-create-branch.md index 98b15ae..766bc41 100644 --- a/man/git-create-branch.md +++ b/man/git-create-branch.md @@ -27,6 +27,9 @@ git-create-branch(1) -- Create branches $ git create-branch -r upstream integration +## NOTES + +As of 4.4.0, the default behavior has changed. `git-create-branch` will no longer automatically setup a remote tracking branch unless the `-r|-remote` option is specified. ## AUTHOR Written by Jonhnny Weslley <>