Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

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

Open
frangio opened this issue Jan 27, 2019 · 5 comments
Open

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

frangio opened this issue Jan 27, 2019 · 5 comments

Comments

@frangio
Copy link

frangio commented Jan 27, 2019

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
Copy link
Owner

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

@frangio
Copy link
Author

frangio commented Jan 28, 2019

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

@frangio
Copy link
Author

frangio commented Jan 28, 2019

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

@lambdalisue
Copy link
Owner

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
Copy link
Owner

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 lambdalisue changed the title % in :Gina commit is ignored Gina commit % does not work but Gina commit -- % Jan 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants