Enhancement: Placeholder/new branch for edited files #481

Open
opened 2026-10-05 02:49:27 +02:00 by adam · 6 comments
Owner

Is your feature request related to a problem? Please describe.
Today the FM gets from current selected branch. The idea is to auto create a new branch when something is edited, but based on a placeholder/ask for user giving a few options.
Our standard is have a branch called feat/<your-change-subject>. User cannot push to main, so the return is always an error.

The same problems applies to commits: we have a standard one that asks for type and scope, so since it's a edition on a doc, will be a feat(docs). But since I can add a suffix, but not a prefix, I can't do that.

Describe the solution you'd like
Have a global option to create a branch and use a branch name based on filename or giving user the option to explain the changes, add this explanation to the <your-change-subject> on feat/<your-change-subject>.

Describe alternatives you've considered

Additional context

**Is your feature request related to a problem? Please describe.** Today the FM gets from current selected branch. The idea is to auto create a new branch when something is edited, but based on a placeholder/ask for user giving a few options. Our standard is have a branch called `feat/<your-change-subject>`. User cannot push to main, so the return is always an error. The same problems applies to commits: we have a standard one that asks for type and scope, so since it's a edition on a doc, will be a `feat(docs)`. But since I can add a suffix, but not a prefix, I can't do that. **Describe the solution you'd like** Have a global option to create a branch and use a branch name based on filename or giving user the option to explain the changes, add this explanation to the `<your-change-subject>` on `feat/<your-change-subject>`. **Describe alternatives you've considered** - **Additional context** - <!-- github-sync-id:1813955955 -->
Author
Owner

Thanks @AdrianoCahete for this suggestion.

To start on the implementation, I am checking the best approach that would also serve other needs.

To enable branching support, I am considering adding the following setting: frontMatter.git.disableOnBranch. This setting would be an array of branch names to which users cannot sync their changes. Instead, they would see this in the UI:

Xnapper-2023-09-18-12 02 26

If the user checked out another branch not on the list, they can sync without providing a new branch name. This allows the users to sync changes.

Another new setting would be the frontMatter.git.showCommitMessage, which will show a new input to set the commit message.

Xnapper-2023-09-18-12 04 13

If not provided, the default message from the frontMatter.git.commitMessage setting is used.

The last new setting would be the frontMatter.git.newBranchPrefix. This setting would be used to define the prefix for your branching strategy. Like in your example: feat/.

Would the following changes be enough to fit your needs?

Thanks @AdrianoCahete for this suggestion. To start on the implementation, I am checking the best approach that would also serve other needs. To enable `branching` support, I am considering adding the following setting: `frontMatter.git.disableOnBranch`. This setting would be an array of branch names to which users cannot sync their changes. Instead, they would see this in the UI: <img width="511" alt="Xnapper-2023-09-18-12 02 26" src="https://github.com/estruyf/vscode-front-matter/assets/2900833/bcd4ace1-668e-42b5-8d92-7a6c9f0d2bf5"> > If the user checked out another branch not on the list, they can sync without providing a new branch name. This allows the users to sync changes. Another new setting would be the `frontMatter.git.showCommitMessage`, which will show a new input to set the commit message. <img width="515" alt="Xnapper-2023-09-18-12 04 13" src="https://github.com/estruyf/vscode-front-matter/assets/2900833/32328cc6-2380-4a9f-87ee-8ed83fc3986d"> > If not provided, the default message from the `frontMatter.git.commitMessage` setting is used. The last new setting would be the `frontMatter.git.newBranchPrefix`. This setting would be used to define the prefix for your branching strategy. Like in your example: `feat/`. Would the following changes be enough to fit your needs? <!-- github-comment-id:1723108358 -->
Author
Owner

To enable branching support, I am considering adding the following setting: frontMatter.git.disableOnBranch. This setting would be an array of branch names to which users cannot sync their changes. Instead, they would see this in the UI:

The last new setting would be the frontMatter.git.newBranchPrefix. This setting would be used to define the prefix for your branching strategy. Like in your example: feat/.

I think that this setting will work for us, but the UI can have the select before the branch name, so user will choose from a dropdown all the options (and their descriptions) that we provide on config, like the "feat", "chore", "release", and adding the branch name after, internally creating a feat/branch-name.

I can do the Figma/visual idea later, but is something like:

Define branch to sync
[Prefix-Dropdown] [input to name branch]

it will be awesome if in this input we can add some rules that will warn or automatically applies, like no uppercase character, no space and other custom rules.

The idea is to make so simple that user will use only the Ui to sync all the content, view, edit and everything.

> To enable branching support, I am considering adding the following setting: frontMatter.git.disableOnBranch. This setting would be an array of branch names to which users cannot sync their changes. Instead, they would see this in the UI: > The last new setting would be the frontMatter.git.newBranchPrefix. This setting would be used to define the prefix for your branching strategy. Like in your example: feat/. I think that this setting will work for us, but the UI can have the select before the branch name, so user will choose from a dropdown all the options (and their descriptions) that we provide on config, like the "feat", "chore", "release", and adding the branch name after, internally creating a `feat/branch-name`. I can do the Figma/visual idea later, but is something like: ``` Define branch to sync [Prefix-Dropdown] [input to name branch] ``` it will be awesome if in this input we can add some rules that will warn or automatically applies, like no uppercase character, no space and other custom rules. The idea is to make so simple that user will use only the Ui to sync all the content, view, edit and everything. <!-- github-comment-id:1723394006 -->
Author
Owner

I can do the Figma/visual idea later, but is something like

That would be great @AdrianoCahete 🙏

> I can do the Figma/visual idea later, but is something like That would be great @AdrianoCahete 🙏 <!-- github-comment-id:1725006451 -->
Author
Owner

Related to #454

Related to #454 <!-- github-comment-id:1744842981 -->
Author
Owner

@AdrianoCahete have you had time to work on the Figma visual?

@AdrianoCahete have you had time to work on the Figma visual? <!-- github-comment-id:1744843044 -->
Author
Owner

Not yet, I'm not in my home this week and the next.

Not yet, I'm not in my home this week and the next. <!-- github-comment-id:1746743820 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#481