koog1000 / vscode-fossil

Integrated Fossil source control for Visual Studio Code
Other
68 stars 8 forks source link

New branch results in empty commit #11

Closed jungle-boogie closed 4 years ago

jungle-boogie commented 5 years ago

Hi,

Would it be possible to have the extension create a new branch when you commit files? I might be doing something wrong, but it seems that a new branch is created and committed without anything in it. Then you can choose the newly created branch from the branch selection thing for your commit.

Thanks!

koog1000 commented 5 years ago

When you create a new branch it performs a fossil branch new NAME BASE where base is the current checkout sha and name is the name you choose. Doing this, fossil automatically creates a commit, the extension doesn't make the commit.

Can make a commit to a new branch with the --branch NEW-BRANCH-NAME option, but it is not clear how to work this into the commit flow without disrupting non new branch commits. Can you explain a little more what you had in mind?

jungle-boogie commented 5 years ago

Hi,

Thanks for getting back to me.

When Stephen made this commit today, he made the branch and with the same commit, files were modified: https://www.fossil-scm.org/fossil/info/d8ebbd76cc9ae94b

How can I do this with your extension?

koog1000 commented 5 years ago

Yes I understand your question and the extension does not support that right now. My point in the last comment is that these types of commits are in the minority so they should not impede the current commit flow.

As an example, if it were implemented in such a way that prompted the user for a new branch name every time you committed this would be a huge inconvenience for the majority of commits. So as I said, it's not clear to me how this should be implemented with the minimal change in commit flow.

koog1000 commented 5 years ago

Of course, you can perform all of the fossil commands in your terminal. The terminal shortcut in VSCode is Ctrl+`.

Your commit would look like fossil commit --branch NEW_BRANCH_NAME -m "COMMIT_MESSAGE"

jungle-boogie commented 5 years ago

Thank you for the reply and sorry for the complications. I didn’t mean to imply you didn’t understand what I meant.

When I’m back in VS code, I’ll see if there’s something practical I can recommend.

Maybe at a minimum, a message can appear explaining the commit will be empty and a confirmation message to continue.

jungle-boogie commented 4 years ago

At this time, I don't have a better solution, other than just a warning the commit will be empty.