chriswalz / bit

Bit is a modern Git CLI
Apache License 2.0
6.05k stars 106 forks source link

Feature request: conventional commits #82

Open moon2l opened 3 years ago

moon2l commented 3 years ago

https://www.conventionalcommits.org/ https://github.com/brigand/glint

sheldonhull commented 2 years ago

I was just thinking of building something but didn't want to add more fragmentation here. Bit would be a great place for supporting an option with conventional commits.

For a nice example of what I've found: https://github.com/SKalt/git-cc

@chriswalz would you be up for a contribution to add bit cc or equivalent type of helper command that could prompt through a conventional commit layout and support a config file like that tool being used to autofill scopes/defaults if it exists?

Would much rather see extensibility with Bit vs adding more tooling here.

Also if so, any quick 101 bullet list on where the best place is for contributing something similar would be?

chriswalz commented 2 years ago

I think would be nice! Do you think could outline the usage of commands here (e.g. `bit cc <> does A, bit cc does B, etc..)

See my notes for getting started adding a command here https://github.com/chriswalz/bit/issues/87#issuecomment-933966808

Regarding a config file I've been avoid that and leaning on ENV variables for now. We could hard code a config as a first pass and then find a way to best handle config file solution once the bit cc command solution is mostly setup

sheldonhull commented 2 years ago

Sweet! The config would have to be an optional thing, but would probably be required because the conventional commit scopes are defined typically for a repo in it. I was thinking of actually building the scope list from the git recent history so might be possible to do that, but would still be useful to have a predefined list for team members.

For the first go round, it could just be the standard allowed commits by the Angular Conventional Commit format and that would be a good iteration one to see how it works out.

Command draft

bit cc and a promptui with add option to pick type. You can use this image from the git-cc repo I linked above for a visual of what that might look like (not exact but a good visual!)

conventional commit

Here's another from git-cz

resources

chriswalz commented 2 years ago

Looks good to me. I think you should go for it! If you get stuck I'll be happy to help out!