Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope use case #82

Open
whitslar opened this issue Aug 26, 2022 · 2 comments
Open

Scope use case #82

whitslar opened this issue Aug 26, 2022 · 2 comments

Comments

@whitslar
Copy link

whitslar commented Aug 26, 2022

Not sure how much you'd be into the idea of adding a dropdown of options if the autogenerated message doesn't fit the bill, but we use conventional-changelog and one of our big annoyances is that everyone on the team has to name their scopes exactly the same for the changelog to look great. It's especially tough on new features when the thing we're developing hasn't really been named yet, or is going under a number of aliases.

It'd be nice to have the option of a dropdown that listed X number of the most recent commits that included a scope and you could just click it and at least populate the first part. As an example, a recent feature we introduced was an "onboarding" walkthrough for our app feat(onboarding):.

But some people called it "guided setup" feat(guided setup). So now our changelog shows it as two separate features. Same thing happens with misspellings, hyphens vs. underscores vs. spaces, etc. It would be nice to click a quick button and see what someone else first named the scope to keep them consistent.

@MichaelCurrin
Copy link
Owner

Thanks for the interest. I don't know how to add that droplist but can look into it.

At the least, you guys can maintain a Google doc of the scopes you use and use that a reference in a window you keep open.

Even if this was added into the extension, you'd still need have to maintain that list by hand in everyone's settings file so you can share the updates with each other. So I don't know if it's that useful to add it as a feature?

Unless the extension integrates with some Gist or Google docs but then that becomes a lot more complicated.

@whitslar
Copy link
Author

whitslar commented Sep 3, 2022

I guess I was imagining a combination of two things.. 1. It could try to infer your scope based on analyzing the X most recent commits from the git log. So say if you touch 2-3 of the same files that you or your teammate touched in a commit from the day or week before, it's at least somewhat likely you're dealing with the same scope, so auto-fill it. Maybe the lines you touch also need to be near or overlapping? And 2., for the dropdown, I was thinking you could just save a list of canonical scopes in a .auto-commit-msg dotfile that gets tracked in the repo. The dropdown populates from that and might be sorted by the most recent use of the scope. It could also keep a map of the canonical scope to aliases/misspellings. So lets say my teammate updated foo.js, staged it, typed fix(guided setup): and then clicked the auto-commit-msg icon, it would rewrite it as fix(onboarding): update foo.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants