2.0.1 • Published 1 year ago

@faceit/branch v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

branch

This script helps creating git branches for development tasks, which comply to EFG's guidelines as described in the jira article "The way we develop at EFG".

It can be invoked from within the monorepo by running yarn branch [options] or from any other repository by using the npx @faceit/branch [options] command (node is required, but we plan on packaging this script as a standalone executable).

Command-line options

OptionDescription
-v, --versionOutput the version number
-t, --type \<type>Commit type
-j, --ticket ticketJira Ticket number
-a, --abstract \<abstract>Brief description of the activity
-d, --dry-runOnly print the branch name without creating it
-h, --helpDisplay help for command

Example:

yarn branch -t feat -j TXP-1234 -a 'implement some very cool feature'

will result in the creation of a branch named feat_TXP-1234_implement-some-very-cool-feature.

The script can also be run interactively with yarn branch: the user will be asked to provide a commit type (by chosing from a list of options), a jira ticket number and a brief abstract of the task. The script will only prompt for unanswered questions, so if it is invoked with, e.g., the type argument (yarn branch -t fix), it will skip the question about the commit type.

heads up

while the ticket number is not a mandatory argument, both the type and abstract are.

Moreover, the branch script will automatically create an empty first commit on the branch (with message ci: first commit) which is needed by the LinearB tool for development tracking purposes, and finally it will push the branch to a new upstream one.

squash command

Once the work required on the branch has been completed, the script can be invoked with the squash command, which accepts a single option:

OptionDescription
-F, --no-force-pushAvoid running git push --force-with-lease automatically after squashing

The squash command will:

  1. prompt for the name of the branch the current one stems from (since there is no easy way to determine this), which defaults to master
  2. let the user pick one of the commit messages on the branch, or type a new one altogether
  3. proceed on squashing all the commits on the branch down to a single one, which will have the chosen message
  4. if the -F option was omitted, the script will proceed on force-pushing (with lease) the current branch
2.0.1

1 year ago

2.0.0

1 year ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago