GithubHelp home page GithubHelp logo

giticon's Introduction

giticon

A gitmoji-like system for generating commit titles

Setup

Add giticontypes.csv and .giticon.rc to the root of your repository. commit.sh can optionally be symbolically linked to /usr/local/bin to allow the command to be run from anywhere.

If a repository has those two files, or .giticon.rc is given a different .csv file to point towards, the script will use that project's given commit types. Built-in ones are also available for any other repository.

Usage

At minimum, this is valid: $ path/to/commit.sh. Setting up the symbolic link using $ sudo ln -s path/to/commit.sh /usr/local/bin/commit will allow you to simply run it as $ commit. Further references assume you have done this, but you can adjust them as necessary for your purposes.

Available Flags

-d or --dry-run: test to see what the commit would be titled if one was made.

-a or --amend: amend the last commit with the new title, rather than making a new one.

-m or --message: use the given message instead of prompting for one.

-s or --scope: use the given scope instead of prompting for one.

Any unflagged arguments are treated as the commit type. If the commit type is not found, the script will prompt for one.

Example:

Command Output
$ commit -d -a -m "This is a commit message" -s "ExamplePlatform" feat โœจ feat(ExamplePlatform): This is a commit message

giticon's People

Contributors

keithpinson avatar superspacehero avatar

Watchers

 avatar  avatar

giticon's Issues

Alternate no-flags API syntax

An example of the no-flag syntax might be:

commit "fix: Correct the broken clock so it runs the right way round" -- "issue: #23"

The syntax is commit [title] [body] [end] where title, body, or end may be a quoted string, --, or blank.

Conflicts with the flag syntax discussed elsewhere should result in an error.

Red, Green, Refactor

Add a feature to support the Red, Green, Refactor style of development.

If this is to be done it would need to:

  • Add --red, --green, --refactor flags with optional id tag, eg. "--red D008"
  • Add RED, GRN, RFR (alternately REF) keywords in the natural-language argument
  • Add a prompt "Red, Green, Refactor? [r/g/f] (defaults to neither)
  • Add a USE_RED_GREEN_GRAPHIC="y" to the rc file

This would simplify writing the title message and would standardize how the title message is formatted, for example

๐Ÿฆ‹ test: D008 ๐ŸŸฅ `q` is a hidden option to select nothing
โœ”๏ธ fix: D008 ๐ŸŸฉ `q` is hidden option to select nothing
๐Ÿ‘• lint: D008 ๐ŸŸซ clean files 

Of course, the red, green, refactor is optional but available when dropping into that style of development.

Change API flags for the `commit-type`, `scope`, `message`

Since giticon is really just changing the title part of the message by adding a commit-type and emoji, the giticon argument flags should be minimized to just what is required and all others passed through to git commit. With this in mind there should be (3) flags with (2) optional flags for convenience. Note: there is proposed alternate, no flag syntax discussed elsewhere.

For context git commit has the following single lower-case flags unused: g, j, k, x, y. The unused, single upper-case flags are: A, B, D, E, G, H, I, J, K, L, M, N, O, P, Q, R, T, U, V, W, X, Y, Z

The proposed flags are:

-T, --commit-type
-S, --scope
-m, --message            <-- After modification, this is passed through to git commit
-B, --message-body
-E, --message-end

All other flags, if valid, should be passed through to git commit.

Block executing `git commit`

To support a workflow where one wants to see the git commit but not actually have it executed, add a EXECUTE_COMMIT="Y/n" option to the .giticon.rc file and echo instead of executing the git commit if set to "N".

key and title did not work as expected

$ ./commit.sh --dry-run doc "Add a markdown file"
Optional scope (e.g. Android):
This commit will...(e.g. Let swipe go all the way to bottom): 

Quoted string should be assumed to be the commit message

Note: Maybe -m "message" should also work like with git:
git commit -m "message"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.