-
Notifications
You must be signed in to change notification settings - Fork 21
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
Ignore user pretty when generating diff patch log with <TAB> #54
Conversation
If the user has setup a custom pretty formatter (perhaps using format.pretty as a default), it can break fugitive's ability to parse the resulting log and extract the information it needs. This sets the output to a standard format (--pretty=medium is git's default).
This also appears to contain the changes for Besides that though, I'm not sure that this is a desirable change. Flog doesn't currently add any options to any of its default bindings which alters behaviour in a way that isn't directly required for the command it's trying to perform, and it's worked well so far. Besides established precedent, why would I as a user expect to see anything different when Flog calls IMO, even though I personally think being able to navigate between commits is more desirable, it should be on the user to fix it if it's the user's configuration causing the problem in cases like this. Flog provides the customizability to get around issues like this because it's nearly impossible to deal with every edge case. My suggested fix is implementing a custom binding for augroup flog
autocmd FileType floggraph nno <buffer> <silent> <Tab> :<C-U>call flog#run_tmp_command('vertical belowright Git show --format=medium %h -- %p')<CR>
augroup END However I'm still open for arguments as to why this should get in. It just doesn't mesh well with the philosophy of Flog. |
Sorry about that, if you end up wanting to merge this I'll clean it up.
One reason could be that the pretty formatter is assumed to be used for non-interactive output that git show/log/whatchanged generate. Flog and Fugitive take that that output and make it interactive in ways useful to the user. If in the current state, neither are able to correctly parse the output, it makes sense to enforce a default formatting. Otherwise, what's the utility beyond !git show?
Thanks for the tip, and thanks for your work on this plugin! |
I've considering this and I've come to the conclusion that if we are going to make any kind of guarantee that behavior like this is going to work 100% of the time, it needs a proper system implemented. I won't get into it, but I don't think the command system, being as thin as it is now, can make guarantees like this. It's simply too dumb to do it. The way it is now, if Fugitive wants to add certain global guarantees to commands like If commands are to become more reliable, it would be part of whatever comes after Flog, or a new breaking version. The plan would be to stop relying on Fugitive and Thank you for the issue and the PR, you really have given me a lot to think about. |
This PR fixes #53 .