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

Gina commit % does not work but Gina commit -- % #194

Open frangio opened 5 years ago

frangio commented 5 years ago

I expected :Gina commit % to commit the current file but it instead silently ignores %.

:Gina add % does expand the % so I expected that to work consistently across commands.

lambdalisue commented 5 years ago

How about :Gina commit -- %? Does that work? I haven't used git commit <single file> so I didn't consider such a case.

frangio commented 5 years ago

Yes, -- % does work. Interesting. Is that by design though?

frangio commented 5 years ago

Also just noticed % is ignored in other commands like :Gina diff %.

lambdalisue commented 5 years ago

Well, it's a bit complecated. Gina add % works because Gina add uses Gina _raw add command internally and that command expand any arguments which look like % or %:p or so on (for convinience). However, Gina commit does not touch unexpected arguments so % leaves as-is.

You said Gina diff % doesn' work but it's wrong usage. The correct one is Gina diff :%. Read :help gina-misc-treeish for more detail.

lambdalisue commented 5 years ago

So, it's complicated to change the current behavior and at least Gina commit -- % works. I think I'm not going to fix the behavior. Sorry for that.