Title: Option to auto-fill the filename as the scope when commiting single file using the CLI · Issue #1099 · commitizen-tools/commitizen · GitHub
Open Graph Title: Option to auto-fill the filename as the scope when commiting single file using the CLI · Issue #1099 · commitizen-tools/commitizen
X Title: Option to auto-fill the filename as the scope when commiting single file using the CLI · Issue #1099 · commitizen-tools/commitizen
Description: Description I like using the scope descriptor to see which files a commit is altering If I commit a single file, it would be nice to have the option to auto-fill the 'scope' dialogue with the name of that file, relative to the root direc...
Open Graph Description: Description I like using the scope descriptor to see which files a commit is altering If I commit a single file, it would be nice to have the option to auto-fill the 'scope' dialogue with the name ...
X Description: Description I like using the scope descriptor to see which files a commit is altering If I commit a single file, it would be nice to have the option to auto-fill the 'scope' dialogue with t...
Opengraph URL: https://github.com/commitizen-tools/commitizen/issues/1099
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Option to auto-fill the filename as the scope when commiting single file using the CLI","articleBody":"### Description\r\n\r\nI like using the `scope` descriptor to see which files a commit is altering\r\n\r\nIf I commit a single file, it would be nice to have the option to auto-fill the 'scope' dialogue with the name of that file, relative to the root directory.\r\n\r\ne.g. if I were to do this:\r\n```\r\n// in root dir on a clean worktree\r\n$ touch some_dir/some.file\r\n$ git add .\r\n$ cz c\r\n```\r\n\r\nI would expect the `cz c` dialogue to pop-up, where I can choose fix/feat etc., then when I am asked 'What is the scope of this change?' I would expect the text input to be prefilled with `some.file`, so I can change it to something else, or just hit enter to continue.\r\n\r\nThis would not be applicable if a commit contains multiple files, as a file-based scope doesn't make sense there, so I would expect the scope field to be left blank in that case.\r\n\r\n### Possible Solution\r\n\r\nAdd a `boolean` option `prefill_scope_for_single_files` that defualts to `false` and when set to `true`, makes the CLI tool scan for the number of files that have changed upon asking the scope question.\r\n\r\nIf the number of files is one, grab the filename and pre-fill it as the scope.\r\n\r\nOptional: add `boolean` opt `prefill_scope_for_single_files_relative` that defaults to `false` and determines whether the scope should be prefilled with `some.file` (when opt is `false`) or `some_dir/some.file` (when opt is `true`)\r\n\r\n### Additional context\r\n\r\nThis would have to be an opt-in feature for sure as some people skip the scope step.","author":{"url":"https://github.com/codevogel","@type":"Person","name":"codevogel"},"datePublished":"2024-05-07T10:03:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/1099/commitizen/issues/1099"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:57238caf-50be-151c-c73f-17795e7489a9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8172:14E1BC:23AC63:303F92:6977283E |
| html-safe-nonce | 85d91994e6738a6dfe4f219469a72a8dc1cfd04c6a3cc1dc797af88f8f40add5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTcyOjE0RTFCQzoyM0FDNjM6MzAzRjkyOjY5NzcyODNFIiwidmlzaXRvcl9pZCI6IjMxNDgyODg2NDgzODYzOTAwNzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4c548cb565fd4d6023dcb070cc19acc957ed174be0bbeb36e7bb7bbcdf5db158 |
| hovercard-subject-tag | issue:2282820495 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/commitizen-tools/commitizen/1099/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b3e5566c183103a6b5973ba2461f30a928b3d0d0519542878a25266420c4ff42/commitizen-tools/commitizen/issues/1099 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b3e5566c183103a6b5973ba2461f30a928b3d0d0519542878a25266420c4ff42/commitizen-tools/commitizen/issues/1099 |
| og:image:alt | Description I like using the scope descriptor to see which files a commit is altering If I commit a single file, it would be nice to have the option to auto-fill the 'scope' dialogue with the name ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | codevogel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/commitizen-tools/commitizen git https://github.com/commitizen-tools/commitizen.git |
| octolytics-dimension-user_id | 62252524 |
| octolytics-dimension-user_login | commitizen-tools |
| octolytics-dimension-repository_id | 106127589 |
| octolytics-dimension-repository_nwo | commitizen-tools/commitizen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 106127589 |
| octolytics-dimension-repository_network_root_nwo | commitizen-tools/commitizen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width