carloscuesta / gitmoji-cli

A gitmoji interactive cli tool for using emojis on commits. 💻
https://www.npmjs.com/package/gitmoji-cli
MIT License
4.59k stars 206 forks source link

Add a prompt option for story_id #1094

Closed trixtur closed 1 year ago

trixtur commented 1 year ago

Description of the problem

Many project management systems have github integrations. If we could prompt for story_id this would allow the story to be linked to each commit.

Solution

Add the option during config to prompt for story id.

Alternatives

No response

Additional context

No response

Validations

trixtur commented 1 year ago

I've attempted to support this. Some tests are not yet passing but it is close.

trixtur commented 1 year ago

Should be ready to go.

carloscuesta commented 1 year ago

Hey!

Have you considered as an alternative using the scope prompt or the title?

trixtur commented 1 year ago

Sure have!

I investigated tools for my team at work to generate commit messages that would prompt them for important items we require in commit messages. This tool fit the bill having a scope, title and description. The only element that was missing was a prompt for the storyId.

I have submitted a PR which allows this item to be enabled through the config. Because it is part of the config anyone not interested in story ids is able to turn it off.

trixtur commented 1 year ago

It would be great if I could get a review: https://github.com/carloscuesta/gitmoji-cli/pull/1095

carloscuesta commented 1 year ago

Hey!

Sorry If my previous message is not clear enough.

I was wondering if we really need this prompt at all when we already have the one for scope?

Also it's something you can include as part of the prompt title

trixtur commented 1 year ago

I understand. I preferred it as a separate commit message within its own -m set. In this way we can preserve the scope and title for human readable items.

Is there a reason not to do this?

trixtur commented 1 year ago

It would be great if I could get a review: #1095

I do see that it would require updating screen shots in the readme.

carloscuesta commented 1 year ago

I understand. I preferred it as a separate commit message within its own -m set. In this way we can preserve the scope and title for human readable items.

Is there a reason not to do this?

Cognitive complexity mostly, the more questions/prompts we introduce inside of the cli, the "complicated" and not so easy to use will be.

Btw, we use to have this prompt a few years ago in the cli (and got removed) see https://github.com/carloscuesta/gitmoji-cli/issues/44

The issue I see with this kind of requests, is that we will never be able to meet everyone's workflow. What would happen if someone needs to include the reference on the title rather than the message?

Then we would need to rethink a bit the implementation or add another configuration parameter to the cli.

By not having the custom prompt you can allow the user to add the reference in the place they want with more flexibility without having to ask for it (message/title)