• Stars
    star
    246
  • Rank 164,726 (Top 4 %)
  • Language
    Rust
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🌌⭐ Git tooling of the future.

Glitter

❯ Glitter

Git tooling of the future

Features

  • Config files
  • Simple errors
  • Glitter Hooks (Git hooks natively built into Glitter)

What is glitter?

Glitter is a tool for generating and structuring commit messages via arguments passed to the tool. It allows you to configure it extensively and easily.

Installation

Windows

Scoop

scoop install glitter

Linux

This is a bash script that can install on any platform other than windows, not just linux.

curl -fsSL https://raw.githubusercontent.com/Milo123459/glitter/master/install.sh | bash

Other

Check the releases and download the appropriate binary. Or build from source.

To build from source run this:

You need rust installed!

cargo install --git https://github.com/Milo123459/glitter

Get started

A simple example when using glitter would be a 3 step commit template. For example, something to turn glitter push fix docs fix typo into fix: docs: fix typo.

This example covers using type_enums, hooks and how glitters argument system works.

Firstly, we can define our .glitterrc to support 2 or more arguments.

{
    "commit_message": "$1: $2: $3+"
}

This snippet alone now allows us to do glitter push fix docs fix typo and would template to fix: docs: fix typo. $1 is the first argument passed to glitter push, $2 is the second, and $3+ means that the third argument and anything after that should take it's place.

Now, lets take a look at type_enums - a way of validating arguments.

Let's add a commit_message_arguments to our .glitterrc:

{
    "commit_message": "$1: $2: $3+",
    "commit_message_arguments": [
        {
            "argument": 1,
            "case": "lower",
            "type_enums": [
                "fix",
                "feat"
            ]
        }
    ]
}

This snippet now means that the first argument will:

  • be converted to lower-case
  • matched against the type_enums, and if it does not match, it fails

For example, glitter push fix docs fix typo would work, but glitter push chore docs fix typo would not, because chore isn't in the type enums.

Next: glitter hooks.

Glitter hooks are like git hooks, but always run before git add - it allows you to run/make your own hooks with ease.

An example of a hook to run cargo fmt would look like this:

{
    "custom_tasks": [
        {
            "name": "fmt",
            "execute": [
                "cargo fmt"
            ]
        },
    ],
    "hooks": ["fmt"]
}

This defines a custom task, which can also be run via glitter cc (for example glitter cc fmt would run cargo fmt). We then have a hooks array which specifies a custom task to run before running git add.

FAQ

Does "this hello" count as 1 or 2 arguments?

This example counts as 1. For example glitter push hello "world how" are you would give the following arguments:

1: hello
2: world how
3: are
4: you

Available Cases

  • lower
  • upper
  • snake
  • screaming-snake
  • kebab
  • train
  • sentence
  • title
  • class
  • pascal

Alt

More Repositories

1

Spencer

👦 Spencer: My personal bot
Rust
41
star
2

salt

A CLI-based task manager written in Rust.
Rust
16
star
3

Milo123459

being unproductive
10
star
4

website

TypeScript
9
star
5

imageapi.js

The fast way of grabbing random images from subreddits.
JavaScript
8
star
6

bento

🍱 A terminal emulator for all your needs.
Rust
7
star
7

vstore

VStore - The most lenient way of saving data.
TypeScript
7
star
8

each

😎 A CLI tool for fetching data and displaying it nicely. (The neofetch for remote data fetching)
Rust
6
star
9

vext

🤙 Vext is a code editor that lives in the Terminal.
Rust
5
star
10

rust-tutorials

🦀 Public code for my rust tutorials. Come here if you are stuck!
5
star
11

liron

An independent and fast pure-Rust code editor that lives in your terminal.
Rust
5
star
12

dotfiles

Shell
5
star
13

with_lock

Deadlock freedom
Rust
5
star
14

tyfoon

⚡ Typed functions done right
3
star
15

create-ts-pro

JavaScript
3
star
16

rust-notebooks

Some notebooks for learning Rust.
Rust
3
star
17

rbxts-greenwich

Bindings from GreenwichDB to be compatible with roblox-ts
Lua
3
star
18

tyvn

A collection of TypeScript typed functions.
TypeScript
3
star
19

vscode-salt

VSCode extension for Salt
JavaScript
3
star
20

atomix

A simple and fast shell.
3
star
21

coco

Curl scripts made simple
Rust
3
star
22

serenity-bot-template

Rust
3
star
23

errors.io

Pointless, fast, efficient error manage, what more could you need?
TypeScript
3
star
24

spencer-web

Vue
3
star
25

scrooge

😎 Run scripts in the command line automatically. No more copy pasting, just scrooge run!
Rust
3
star
26

swords

Swords provides widgets for the terminal. Just like shields, but swords!
TypeScript
3
star
27

manny

A sleek and short documentation system for the terminal.
Rust
2
star
28

salvage-music

A reliable wrapper for playing music via lavalink.
JavaScript
2
star
29

vervel

▲ Recreating Vercel's UI as a React library.
2
star
30

consel

Consel, an extension for commands.
JavaScript
2
star
31

github-resources

Help maintain your open source project!
2
star
32

glass

🔎 Find things in files, fast.
Rust
2
star
33

cool-workflows

2
star
34

discord-pager

⚡ 🚀 Fast and simple way to create paginated embeds using discord.js
2
star
35

graphique

🖼 Start painting, in Rust.
2
star
36

todo-bot

A todo-bot written in Rust
2
star
37

honk-bot

TypeScript
2
star
38

isitv

😛 IsItV is a NPM package to ensure fields are valid.
2
star
39

footprint

🐾 Footprint is the all-in-one project manager for Git.
Rust
2
star
40

CaloDB

CaloDB - Local DB's on a new level.
TypeScript
2
star
41

threader

Intensive tasks made simple
2
star
42

conditionify

🚄⚡ Fast and easy way to create conditional functions
TypeScript
2
star
43

serenity-slashed

🗡 Slash command registration for serenity simplified
2
star
44

openvscode

deploy openvscode with less complications
Dockerfile
1
star
45

win_titles_test

Tests for https://github.com/HiruNya/window_titles/tree/process-support
Rust
1
star
46

nextonium

An SSG for making websites with markdown.
1
star
47

ideas

Random ideas I have
1
star
48

stevey

🐺 Stevey is a app designed for making SVGs easy.
1
star
49

cone

Personal Scoop bucket
PowerShell
1
star
50

salvage.db

Salvage.DB
JavaScript
1
star
51

railway-cli-test

test for railway cli
Rust
1
star
52

myriad

🌷 GitHub workflows in the CLI
1
star
53

sortable

🔧🦀 Sort functions for Iters
1
star
54

bot

JavaScript
1
star
55

frontend-trpc-testing

TypeScript
1
star
56

browserless

Dockerfile
1
star
57

minecraft-railway

🚀 A test deploy for deploying a PaperMC 1.17.1 server on Railway.
Dockerfile
1
star
58

builder-bot

🔨 Simple slash command based Discord bot for building valid options to send to the Discord API for registering slash commands.
1
star