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

Use -- instead of - for arguments? #68

Open
wookayin opened this issue Oct 18, 2021 · 4 comments
Open

Use -- instead of - for arguments? #68

wookayin opened this issue Oct 18, 2021 · 4 comments
Labels
feedback wanted Feedback wanted from the community

Comments

@wookayin
Copy link

I would want to use -- for arguments (which is more a conventional and standard way), for example:

:Flog --all

instead of

:Flog -all

The reason I want this is it is more compatible with raw git log command so I can have the same code for generating raw git command lines and :Flog commands.

So it'd be nice to have all arguments coming with double dashes. For backward compatibility we could keep the single-dash arguments. Any thoughts?

@wookayin wookayin changed the title Use -- instead of -? Use -- instead of - for arguments? Oct 18, 2021
@rbong
Copy link
Owner

rbong commented Oct 18, 2021

Flog uses a more similar argument format to builtin vim commands. Flog arguments are not shell arguments, they are arguments for a vim command. It translates any arguments that go to git log. Flog also doesn't aim for feature parity with git log arguments, some of the things a shell command does are difficult to do in vim.

That said if this issue gets support I would be willing to switch. This is just the ideas that went into how it works now.

Backwards compatibility may not be something I want to do, I don't want to maintain both forever. If it ends up being easy, though, I would support both until it becomes unfavorable.

@rbong rbong added the feedback wanted Feedback wanted from the community label Jan 26, 2023
@ferdinandyb
Copy link

I sort of like fugitive's way of :Git [whatever] is almost always the same or very similar to git [whatever] on the CLI. On the other hand with :Flog -- [whatever] you can pretty much get the same thing I guess? But I do have to not, I run into it often enough that I want to do a git log [something] in Flog and type double dash options.

@rbong
Copy link
Owner

rbong commented Jul 19, 2024

I sort of like fugitive's way of :Git [whatever] is almost always the same or very similar to git [whatever] on the CLI. On the other hand with :Flog -- [whatever] you can pretty much get the same thing I guess? But I do have to not, I run into it often enough that I want to do a git log [something] in Flog and type double dash options.

Thank you very much for weighing in. We need all the feedback we can get on this issue.

I should explain that for the most part, Fugitive commands correspond directly to a git command because that's just... well, what they are. Flog on the other hand is much less a direct analog for git log than any Fugitive command is for its corresponding Git command.

When you are passing arguments to Flog, you are passing arguments to a Vim command. It may translate those options to a Git command, and I might try to keep argument name parity, but it almost always is doing something extra inbetween inside Vim and it may not work exactly the same - in some cases they're implemented entirely internally.

The biggest thing is that as long as Vim cannot complete arguments in the form -arg "quoted arg with spaces", we can probably never have complete argument parity. So be aware that when you're asking for this, you're not asking for arguments to be the exact same as git log, you are asking them to be a bit closer but still required to be specified in a different way.

There definitely will be issues where people are confused why they can't specify arguments with quotes if we do this, so please weigh that against stylistic preference for double dashes.

@ferdinandyb
Copy link

ferdinandyb commented Jul 21, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback wanted Feedback wanted from the community
Projects
None yet
Development

No branches or pull requests

3 participants