lambdalisue / vim-gina

👣 Asynchronously control git repositories in Neovim/Vim 8
http://www.vim.org/scripts/script.php?script_id=5531
MIT License
688 stars 27 forks source link

Simplify committing #44

Closed bimlas closed 7 years ago

bimlas commented 7 years ago

It's absolutely unnecessary to do anything with the commit message cleanup, Git will prepare and clean by self.

Previously when there was no COMMIT_EDITMSG exist (case of a newly created/cloned repository), the error handling try/finally dropped an error about the missing file, it's fixed now.

I hope it really fixes #37

lambdalisue commented 7 years ago

I'll investigate it after middle of March but quick questions

  1. Is :e reload cache correctly? Users may close buffer without commit and opens again a bit later with extra changes. In this case the message part should NOT be changed but comment part

  2. Do you have any source that said COMMIT_EDITMSG exsist for this kind of feature? I'm not sure if gina should modify the file or keep

lambdalisue commented 7 years ago

I've tested and the confirmed that this PR breaks a feature of caching.

  1. Open Vim
  2. :Gina commit --allow-empty
  3. Write a commit message (say, This is a test message)
  4. Save a cache with :w
  5. Close the buffer without commit by :q and hit n<CR>
  6. Execute :Gina commit again
  7. A cached message should be shown but an initial commit message without saved cache is shown with this PR

So without fixing this breaks, I'm not going to approve this PR.

bimlas commented 7 years ago

I couldn't find a really better way to commit than the current solution.

What I tried:

The diff is updated and the comments are recovered.

Problems:

I think the current solution is better than my so closing the PR, but I don't like that it plays with reflog: it can be destructive in certain situation.