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

Add command for close section for commit #54

Closed
wants to merge 9 commits into from

Conversation

bakunyo
Copy link
Contributor

@bakunyo bakunyo commented Dec 10, 2015

Hello, jreybert.

I want to add a command that can close commit section.
Added key 'CU' means 'commit undo'.

Could you see this PR and merge if the commit is acceptable.

@bakunyo
Copy link
Contributor Author

bakunyo commented Dec 10, 2015

Additional comment.
Once open a commit section, it keep on showing without commit done or quit vim.
So I want to close commit section.

@jreybert
Copy link
Owner

Hi bakunyo,

thanks for your PR! I had it in my mind for a while, and I never took the time to add it. You did a good job, too bad that travis is unstable at this moment. I don't see why your commit would fail with the test suite, I think it should be OK. We will see when travis will be back to normal.

Anyway, waiting for travis revival, I would have sevral requests to make this PR complete:

  • rebase your commit upon next branch
  • add this new command CU in README and doc/magit.txt
  • the function must do nothing if b:magit_current_commit_mode == ''
  • when you cancel the commit, could you write the current commit message (using s:mg_get_commit_msg()) in the COMMIT_EDITMSG file (see s:mg_get_commit_section())

Thanks

@zimski
Copy link

zimski commented Dec 11, 2015

Hello,
Vimagit act as a regular vim buffer, so i think just pressing (u key) is good enough or maybe i miss something :)

Need to press two times the u key if you start writing the commit

@bakunyo
Copy link
Contributor Author

bakunyo commented Dec 12, 2015

Hello jreybert,

Thanks for comment!
I have sent another PR #55 , includes some commits referenced your comments.

@bakunyo
Copy link
Contributor Author

bakunyo commented Dec 12, 2015

Hello zimski,

Thanks for your comment.
It can almost solve closing-commit-section problems!

Though in rare cases, some changes might be staged or unstaged after commit section opened.
Then this 'CU' command looks attractive I think.

@bakunyo
Copy link
Contributor Author

bakunyo commented Dec 12, 2015

Sorry for sending too PRs.
I wonder which branch(master or next) should be received PR.

Could you close either isn't needed.

@jreybert
Copy link
Owner

@zimski no, just pressing 'u' won't be enough. vimagit is not a nomrla vim buffer. It has some internal variable states. It has one to check that a commit message write is ongoing. Just pressing 'u' won't update this variable.

@bakunyo bakunyo closed this Dec 31, 2015
@bakunyo bakunyo deleted the add-close-commit branch December 31, 2015 06:44
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

Successfully merging this pull request may close these issues.

None yet

3 participants