GithubHelp home page GithubHelp logo

barelyhuman / commitlog Goto Github PK

View Code? Open in Web Editor NEW
77.0 3.0 3.0 285 KB

Generate Changelogs from Commits (CLI)

Home Page: https://barelyhuman.github.io/commitlog/

License: MIT License

Go 89.97% Shell 10.03%
commits changelog commit changelog-generator markdown productivity developer-tools

commitlog's Introduction

commits to changelogs

Go Report Card

Philosophy

  • Work on all major operating systems
  • Not platform dependent, not tied to Github, Gitlab, or anything. It's just markdown.
  • Ability to generate change logs between version tags
  • Handle release versioning of the project
  • Stay small

Why

Every language has it's own isolated version of a tool like this, for someone who works with multiple languages, it's easier to have the same tool working everywhere, without having to setup something get it working. There's an even tighter scoped version of this, nimclog.

The point of the tool is not to create super descriptive changelogs for you but to help your changelogs have enough information for you as a developer to be able to write proper changelogs while having references to the changes in one place.

Documentation

The documentation can be read from the docs folder of the repository, or on the website

License

MIT

commitlog's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

commitlog's Issues

Overwrite Mode

add an overwrite mode flag to the generate commands --out flag so that we can have appending be the default behaviour of the command when outputting to a file and can switch to overwriting when the flag is on.

Category Labels (RFC)

Needs comments / suggestions on how to handle regex labels for commitlog.

Currently the categorization works in the following way.

Eg: a catg regex like so would produce the labels

$ commitlog g --categories="feat:,fix:"
## feat:
## fix: 

Though this doesn't make sense when you have really complex regex's handling the categorisation.

So, there needs to be a way to create labels for these category regexes

One possible way is to change the way the flags are parsed and have more than one instance of the flag.

$ commitlog --category="Features%%feat:" --category="Fixes%%fix:"

Considering the chances of %% being together in a regex being very rare and also since the logic would only take the first separation to get the LABEL everything else would be compiled back as regex.

"segmentation violation" issue on executing generate command

Hey ! I got an issue by running commitlog generate after a fresh install

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x102fecdbc]

goroutine 1 [running]:
github.com/barelyhuman/commitlog/pkg.(*Generator).readCommitsInTags(0x140001b2140)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/pkg/generator.go:91 +0x1bc
github.com/barelyhuman/commitlog/pkg.(*Generator).ReadCommmits(0x140001b2140)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/pkg/generator.go:175 +0x4c
github.com/barelyhuman/commitlog/commands.Commitlog(0x14000136230?)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/commands/commitlog.go:57 +0x538
main.main.func2(0x14000000a20?)
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/main.go:32 +0x1c
github.com/urfave/cli/v2.(*Command).Run(0x14000000a20, 0x1400010d840)
        /root/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:169 +0x4f8
github.com/urfave/cli/v2.(*App).RunContext(0x14000140680, {0x1031ffb90?, 0x103551e20}, {0x1400001e040, 0x2, 0x2})
        /root/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:341 +0x85c
github.com/urfave/cli/v2.(*App).Run(...)
        /root/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:247
main.main()
        /root/go/pkg/mod/github.com/barelyhuman/[email protected]/main.go:143 +0xc60

[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

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.

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.

[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.

STDIN support for categorization

Add the ability to read from standard in and categoriese them as well

  • Add in STDIN Support
  • Add in Format resolvers for different git log formats

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

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.