diff --git a/FEATURE.md b/FEATURE.md index 4e83825..65a710b 100644 --- a/FEATURE.md +++ b/FEATURE.md @@ -4,17 +4,17 @@ ### Usage -This utility is built around some standard branch names: `master`, `develop`, and `integration`. +This utility is built around the standard branch `master` and branches for releases that follow the format of MAJOR.MINOR.PATCH. Feature branches have specific format: USER-BASE-FEATURE. -* USER is the username as specificied by the USER environment variable -* BASE is the standard branch to base the feature branch on +* USER is the username as specified by the USER environment variable +* BASE is the standard branch or release branch to base the feature branch on * FEATURE is the name of the feature #### Start -To start a new feature, go to one of the standard branches. +To start a new feature, go to the standard branch or a release branch. ``` git checkout master @@ -28,32 +28,6 @@ feature start my new feature For example, a new branch will be created called `rkiel-master-my-new-feature` -#### Rebase - -Use the `rebase` subcommand to pull down any changes from the standard branch and then rebase with your feature branch changes. -In addition, a backup copy of your feature changes will be pushed out to `origin`. -This backup should not be used to collaborate with others. It is just a personal backup and will be deleted and recreated with each `rebase`. - -``` -feature rebase -``` - -For example, `rkiel-master-my-new-feature` will be pushed out to `origin`. - -#### Merge - -Use the `merge` subcommand to merge your feature branch changes to the standard branch. - -``` -feature merge -``` - -You can also override the default standard branch by specifying another branch. - -``` -feature merge integration -``` - #### Commit Use the `commit` subcommand to make it easier to write commit messages. @@ -85,6 +59,32 @@ feature commit -m this is a sample commit message -f generates the command `git commit -m "this is a sample commit message (no-verify)" --no-verify`. +#### Rebase + +Use the `rebase` subcommand to pull down any changes from the standard branch and then rebase with your feature branch changes. +In addition, a backup copy of your feature changes will be pushed out to `origin`. +This backup should not be used to collaborate with others. It is just a personal backup and will be deleted and recreated with each `rebase`. + +``` +feature rebase +``` + +For example, `rkiel-master-my-new-feature` will be pushed out to `origin`. + +#### Merge + +Use the `merge` subcommand to merge your feature branch changes to the standard branch. + +``` +feature merge +``` + +You can also override the default standard branch by specifying another branch. + +``` +feature merge integration +``` + #### End Use the `end` subcommand to safely close out the feature. @@ -108,7 +108,3 @@ a confirmation. ``` feature trash local-branch-confirmation ``` - -## Xgrep utility - -This utility makes it easier to use git-grep. diff --git a/dotfiles/bashrc b/dotfiles/bashrc index d0080c4..6a3d70f 100644 --- a/dotfiles/bashrc +++ b/dotfiles/bashrc @@ -39,4 +39,14 @@ function get_feature_commands() fi } +function get_release_commands() +{ + if [ -z $2 ] ; then + COMPREPLY=(`release tab`) + else + COMPREPLY=(`release tab $2`) + fi +} + complete -F get_feature_commands feature +complete -F get_release_commands release diff --git a/lib/release/commander.rb b/lib/release/commander.rb index 66282e1..9ed2f9f 100644 --- a/lib/release/commander.rb +++ b/lib/release/commander.rb @@ -11,6 +11,7 @@ module Release :major, :minor, :patch, + :tab, :trash ].sort diff --git a/lib/release/tab.rb b/lib/release/tab.rb new file mode 100644 index 0000000..265beb0 --- /dev/null +++ b/lib/release/tab.rb @@ -0,0 +1,32 @@ +require_relative './base' +require_relative './commander' +require_relative './loader' + +module Release + + class Tab < Release::Base + + COMMANDS = Release::Commander::COMMANDS + DEFAULT = Release::Commander::DEFAULT + + def valid? + [1,2].include? argv.size + end + + def help + "release tab [pattern]" + end + + def execute + if argv.size == 1 + pattern = '.+' + elsif argv.size == 2 + pattern = "^#{argv[1]}" + end + + loader = Release::Loader.new(COMMANDS,DEFAULT) + puts loader.search(pattern).join("\n") + end + end + +end