Generate Changelogs from Commits (CLI)

Overview

Commitlog

Changelog generator using Commit History

Binary Builds Binary Builds Pre-Releases Go Report Card commitlog

To see an example of this in action, you can check the actions file for this repo. Yes it uses itself to generate the release logs

Sheilds | Badges

commitlog

[![commitlog](https://img.shields.io/badge/changelogs-commitlog-blue)](https://github.com/barelyhuman/commitlog)

Binaries

Binaries are available on the Github releases

Build

This step is for people who want to use the latest version from the repositories which hasn't been added to releases as a binary yet and for people viewing this on sourcehut , as the binaries aren't uploaded to sourcehut.

  • Make sure you have go installed on your system , minimum version 1.15
  • You can either clone the whole repo from sourcehut / github or downlad a tar.gz from sourcehut / github

With Clone

git clone https://git.sr.ht/~reaper/commitlog
# or 
git clone https://github.com/barelyhuman/commitlog

cd commitlog 
go build 

With Tarballs

tar -xvzf commitlog-<hash>.tar.gz
cd commitlog 
go build 
# to install it to go's bin folder and use the commitlog command during dev or as a perm install
go install 

Web Version

Source: commitlog-web

Web App: commitlog-web

Usage

The usage is pretty simple, this cli tool assumes that you use commitlint standards while writing your commits, if not it's okay everything will be classified under Other Changes instead of being grouped according to type of commit.

Simple Overview
ci: - for ci/cd changes
feat|feature: - for feature changes
docs: - for documents or comment updations in code
refactor: - performance / code clean up changes or total BLOC changes
fix: - for fixes (self-explanatory)

Supported Flags (as of v0.0.4-dev.3)

The below mentioned are the flags supported by the current branch and older tags might not support the flags or certain inputs in flags, use the -h flag to see what's supported on the version you are using.

Usage of commitlog:
  -e string
        commit hash string / revision (ex. HEAD, HEAD^, HEAD~2) 
         to stop collecting commit message at
  -i string
        commit types to be includes (default "ci,refactor,docs,fix,feat,test,chore,other")
  -p string
        path to the repository, points to the current working directory by default (default ".")
  -s string
        commit hash string / revision (ex. HEAD, HEAD^, HEAD~2) 
         to start collecting commit messages from
  -skip
        if true will skip trying to classify and just give a list of changes

Example Output (from this exact repository)

> commitlog 
# Changelog

## Fixes

97c582b3eb5a6796ef9c250d9653ad90dce63cbe - fix: example fix

## Other Changes

da6d837eb3134f836bfbe401de7882f2e0818ba8 - Create LICENSE
b0f1b1d2bc4265cb72b70b3ae5b60f8e65f47b12 - initial commit

Current Limitations

  • No Tests added so is probably unstable right now ( If you'd like to help writing tests, feel free to raise a PR)
  • Doesn't work inside a nested folder in the repository, needs to be on the root of the repository to work. (you can use the -p flag to set a path to generate logs from)

Contribution

Contribution Guidelines

Issues
  • No detecting scopes cases

    No detecting scopes cases

    When I tested it, I saw that there is a problem with the recognition of commits with scopes cases. An example of this is with this repository.

    As result and example here is the result from the web tool when using it with the repository:

    # Changelog 
    
    
    ## Features  
    c3de6f50d563ccab1fbfcfea204261e6abeaddf8 - feat: :wrench: Added base config files
    951ceb0ee0d732a7ff960c2b3756e6b2199e5c8b - feat: :sparkles: Added base routes
    c8b44931b4cc23e2ab941790c4da55b5bf0fd261 - feat: :sparkles: Added static plugin
    71c78d670eae0e049ccf203306822ead69833e1f - feat: :lipstick: Added base HTML file
    
    
    ## Docs  
    5e9a0ce2e62cca45d295229e4bbcdc53dae5dcb2 - docs: :memo: README documentation
    
    
    ## Tests  
    fe551f868503466a66e60100af09ba692836c3d8 - test: :white_check_mark: Added base tests
    
    
    ## Other Changes  
    606f9f0e3987ec5b94d5dd25391e1f0ab278173c - Rename DockerFile to Dockerfile
    31e6489ca41aad4af1264a2729fc03107c64eb21 - Merge branch 'develop'
    cfdb58d9958ad17ff0bdaec4fea520da66ae7c74 - Port correction
    bddb089e58be1f96858be6fc248f6e5f8427c263 - Changed production port
    c062c7c2d57a1d50d7bd1a9d1f5b067eaaecfab4 - Merge branch 'release/1.3.3' into main
    330cfd32391b397eff68a783c9645353fc99cc86 - Merge branch 'release/1.3.2' into main
    12156429fb226e2fb782e9b53e3f2201ec19697c - Merge branch 'release/1.3.1'
    cdcfd21d720c91c23553152e80f6a79cac067f23 - Merge branch 'release/1.3'
    9d1d1c3e033b39a0d207964c374064ce18dce434 - Merge branch 'release/1.2.2' into main
    218f0472a372c36950a547ee960d56f20af0bcfa - fix(pwa): :bug: Service worker location
    5e8c53eb7d1cc39ab86394d6dc69462793077d86 - fix(pwa): :ambulance: Manifest start-url
    c63e8092e0bd4a27236dc0e075792b79cf4a79b7 - fix(pwa): :ambulance: Better PWA configuration
    b0553985debd2aded1fcd9cb42c890e072918a26 - Merge branch 'release/1.2'
    cf53c945da158ab2bb344745b9469d75c924c47b - Merge branch 'release/1.1.1'
    3d2f22c0501fd2698e1b2699b93dd0929a8efc19 - Merge branch 'release/1.1'
    fccf92f768f6bb2e7609c193bb40292e1a8dce4d - Merge branch 'release/1.0' into main
    0923c4c7a20f41a1ea328b5b18b7d6bc85c30f3f - Initial commit
    91316b1671c1867373665e33c780c52283fac6ad - chore(api): :fire: Removed console logs
    b398484a147b31d68ea7f1979dba0f3f5bba097e - feat(html): :lipstick: Better UI
    4777ad821591c426f6338a440a5a214d7c854c31 - fix(html): :ambulance: Form submit refresh
    ef9e88d28c574c2cf76b2b084cf440127a152fd0 - refactor(api): :recycle: No URL check for 404
    fb2a952af1857cff25078d0b30651b6d084b1930 - feat(pwa): :sparkles: Added PWA files
    79f0d0b66436aebba2d7534d1c55310bab58699e - chore(deps): :arrow_up: Dependencies update
    2a6aeed4aa1aa4776239edc41ac60f9f5e293a20 - fix(api): :bug: Plugin configuration
    5261ac66384ec0d4d55b53091b9e168b9f19ec75 - refactor(api): :recycle: Better routes
    4965795ada3592a728e5843548ed7cba836c7a10 - feat(html): :lipstick: New code example image
    c60c919f9279bb79097f0bb0f336a1eea74e1f54 - Merge branch 'main' into develop
    135663cef8db047e17a6106c434bf0e57db60ca4 - feat(pwa): :lipstick: Added custom buttons
    786790e2f3cb67f8c1c0ffd372acf736e8057d6e - refactor(pwa): :recycle: Big changes to PWA configuration
    8961ecc10f24bb803093fe2e20ebd5b34ec86ee6 - Larger icons
    f4fb90b42a37f4a0a0c73df944a323a797a24bd9 - refactor(pwa): :recycle: Changing PWA configuration
    fd134804450f90b430c3955eae60ab7b67a84945 - docs(js): :memo: Added js documentation
    ecbeea892c0e22515ec33794477c2463d43bdbbd - feat(html): :lipstick: Better responsive UI
    763d90266a04c023af8bd10637ecd34a17c58839 - fix(pwa): :ambulance: PWA instalation prompt
    505cc0fcc67f2b0f4758c5e9d882dcd1730042d9 - feat(pwa): :lipstick: PWA install button in mobile
    07be7333c79d66ffce693f3a2f647f366aa793c1 - Create LICENSE
    8455f4863d6c4eb0f39e36969f7e66d323c1e344 - feat(docker): :hammer: Dockerfile
    

    There are some fix and feat that are not recognized by the tool.

    enhancement help wanted good first issue 
    opened by RubenConde 3
  • [bug] release fails if there isn't a beta tag present

    [bug] release fails if there isn't a beta tag present

    handle a clean state git tag repository for the release command, this will include avoid checking the beta tag at all. or remove the default to be an empty string instead

    bug 
    opened by barelyhuman 1
  • [feature] Modify Release subcommand to read from a file

    [feature] Modify Release subcommand to read from a file

    Will need to add a file to the handle the release versioning

    Current Thought

    • add a commitlog release init flag to create a .commitlog.version file that maintains the version and reads it from the current tags (can be a question to the user)
    • post that, the commitlog release major|minor|patch|... should read from the .commitlog.version as needed or ask the user to init to create the above file from tags.
    enhancement help wanted good first issue 
    opened by barelyhuman 1
  • [Feat] Add release sub-command

    [Feat] Add release sub-command

    Give the cli the ability to create version tags on behalf of the user using a sub command release

    Cases to be covered

    • If the user has no previous tags, start with 0.0.1 , if the user passes a flag saying -beta , the tag will be instead 0.0.0-beta.0
    • if a tag exists then it increases the current version by one based on passed flag following semver, -major increase to 1.0.1, -minor increases to 0.1.1, patch increase to 0.0.2,
    • if another -beta was passed with either then -major -beta will give you 1.0.1-beta.0 (if the tag didn't exist) and 1.0.1-beta.<x> if the tag exists and <x> being incremental based on previous values.
    • just adding -beta flag to the current latest tag and latest tag being a x.x.x-beta.0 should increase the beta version x.x.x-beta.1
    • ability to pass which tag to take as base as well, so commitlog release -tag 0.0.1 -major -beta should give 1.0.1-beta.0 or 1.0.1-beta.<x> , <x> being an increment if the tag already existed.

    flags to be added

    • -major defaults to nil
    • -minordefaults to nil
    • -patchdefaults to nil
    • -betadefaults to nil
    • -tagdefaults to latest-tag
    enhancement help wanted good first issue 
    opened by barelyhuman 1
  • Inclusion flag

    Inclusion flag

    Flag Description

    Input: -i Input example: -i docs, ci,chore, fix, feat,other

    Description

    The user should be able to decide what he wants from the output of the logs in terms of the categories the tool looks for. Right now the tool outputs every type of commit found between the commit ranges given or the entire commit history.

    I should be able to tell which one's are to be shown based on this flags input.

    enhancement help wanted good first issue 
    opened by barelyhuman 1
  • simplify tag check logic to revisions

    simplify tag check logic to revisions

    checks commits on the initial iterations to get data regarding the latest and previous tags and based on that list out the changelog , also uses revisions to check for tags instead of going through the nearestTag again and again

    bug 
    opened by barelyhuman 0
  • Add commit message scope support

    Add commit message scope support

    Add commit message scope support for all currently supported keys

    example commits

    chore(app): changed app boot status
    feat(pwa): add support for chrome and firefox 
    
    # Chores
    <commit-sha> - chore(app): changed app boot status
    
    # Features
    <commit-sha> - feat(pwa): add support for chrome and firefox 
    
    WIP 
    opened by barelyhuman 0
  • added my take on the code changes needed

    added my take on the code changes needed

    Use what you like, its only TIPS for how I would structure it.

    I belive its easier to read this way. I've explained it more in my post https://percybolmer1.medium.com/performing-a-code-review-1297967683f6?sk=7fa7e3f37704d80097a5b648b02fd0d9

    opened by percybolmer 0
  • Test Cases

    Test Cases

    Add test files for the following cases

    • if in a git repository
    • output if not in a git repository
    • on a repo with just 1 commit and no tags
    • on a repo with just 1 commit and 1 tag
    • on a repo with 1 commit and multiple tags pointing to same commit
    • on a repo with 1 tag and multiple commits
    • on a repo with multiple tags and multiple commits
    good first issue tests 
    opened by barelyhuman 0
Releases(v1.0.0)
Owner
Reaper
Minimalist • Coder • Solo Dev • http://barelyhuman.dev
Reaper
CLI tool for CIDR range operations (check, generate)

cidrchk A CLI tool to assist you with CIDR ranges and IPs. Install it You can download the latest binary for Linux (Intel and Arm), macOS, and Windows

Michael Hausenblas 126 Apr 19, 2022
A tool to manage all your boilerplate from cli and generate files for you !

A tool to manage all your boilerplate from cli and generate files for you !

null 26 Apr 11, 2022
A simple CLI applet to generate 'White Noise' pictorial depictions.

White Noise Generator A simple CLI applet written in Go to create pictorial representations of White Noise. Example Okay, but how? An output file of t

Michal Špano 1 Feb 10, 2022
Easy to use library and CLI utility to generate Go struct from CSV files.

csv2struct Easy to use library and CLI utility to generate Go struct from CSV files. As a benefit, it's fully compatible with csvutil. So, structs gen

Ivan Maliovaniy 9 Jan 21, 2022
Powerful CLI written in GO to generate projects in various technologies

Barca CLI is a project generator written in GO and its purpose is to build and configure HTTP servers, web proxy, SPA/PWA, Blog and custom landing page. It's easy, fast and productive.

Barca 1 Feb 12, 2022
Show Languages In Code. A fast and lightweight CLI to generate stats on the languages inside your project

slic Show Languages In Code. Usage Run it with an -h flag to list all commands. -d flag can be used to specify the directory of search -i flag can be

Saurav Pal 3 Dec 25, 2021
Generate an interactive, autocompleting shell for any Cobra CLI

cobra-shell Description Leverages the Cobra completion API to generate an interactive shell for any Cobra CLI, powered by go-prompt. On-the-fly autoco

Brian Strauch 25 Apr 23, 2022
A GitHub CLI extension to view and generate license files.

gh-license A GitHub CLI extension to view and generate license files. All license information is obtained from the GitHub API. NOTE: The only purpose

Shresht 2 Mar 16, 2022
Cobra CLI tool to generate applications and commands

Cobra Generator Cobra provides its own program that will create your application and add any commands you want. It's the easiest way to incorporate Co

Steve Francia 123 May 21, 2022
Elegant CLI wrapper for kubeseal CLI

Overview This is a wrapper CLI ofkubeseal CLI, specifically the raw mode. If you just need to encrypt your secret on RAW mode, this CLI will be the ea

Elm 4 Jan 8, 2022
CLI to run a docker image with R. CLI built using cobra library in go.

BlueBeak Installation Guide Task 1: Building the CLI The directory structure looks like Fastest process: 1)cd into bbtools 2)cd into bbtools/bin 3)I h

Aniruddha Chattopadhyay 0 Dec 20, 2021
A wrapper of aliyun-cli subcommand alidns, run aliyun-cli in Declarative mode.

aliyun-dns A wrapper of aliyun-cli subcommand alidns, run aliyun-cli in Declarative mode. Installation Install aliyun-cli. Usage $ aliyun-dns -h A wra

许嘉华 0 Dec 21, 2021
Symfony-cli - The Symfony CLI tool For Golang

Symfony CLI Install To install Symfony CLI, please download the appropriate vers

Symfony CLI 309 May 9, 2022
Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files.

ftctl This is a file downloader cli written in Golang which uses the concurrent feature of go to download files. The cli is built using cobra. How to

Dipto Chakrabarty 2 Jan 2, 2022
Cli-algorithm - A cli program with A&DS in go!

cli-algorithm Objectives The objective of this cli is to implement 4 basic algorithms to sort arrays been Merge Sort Insertion Sort Bubble Sort Quick

Leonardo Brombilla Antunes 0 Jan 2, 2022
Nebulant-cli - Nebulant's CLI

Nebulant CLI Website: https://nebulant.io Documentation: https://nebulant.io/docs.html The Nebulant CLI tool is a single binary that can be used as a

Develatio 2 Jan 11, 2022
News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

news-parser-cli Simple CLI which allows you to receive news depending on the par

Maxym 0 Jan 4, 2022
Go-api-cli - Small CLI to fetch data from an API sync and async

Async API Cli CLI to fetch data on "todos" from a given API in a number of ways.

Pete Robinson 0 Jan 13, 2022