vim-gina icon indicating copy to clipboard operation
vim-gina copied to clipboard

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

Open frangio opened this issue 6 years ago • 5 comments

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.

frangio avatar Jan 27 '19 22:01 frangio

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

lambdalisue avatar Jan 28 '19 07:01 lambdalisue

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

frangio avatar Jan 28 '19 18:01 frangio

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

frangio avatar Jan 28 '19 21:01 frangio

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 avatar Jan 30 '19 14:01 lambdalisue

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.

lambdalisue avatar Jan 30 '19 14:01 lambdalisue