-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
DOCS/man/mpv: improve path docs and clarify config-dir path behavior #15218
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
4a33621
to
9013b36
Compare
@sfan5 @na-na-hi I used this local mp = require("mp")
local msg = require("mp.msg")
for _, prefix in ipairs({ "~~global/", "~~home/", "~~/" }) do
for _, n in ipairs({ "", "foo/bar" }) do
local p = prefix .. n
local res = mp.command_native({ "expand-path", p })
msg.info(p .. ": " .. type(res) .. " = <" .. tostring(res) .. ">")
end
end
for _, n in ipairs({ "encoding-profiles.conf", "mpv.conf" }) do
local res = mp.find_config_file(n)
msg.info("find: " .. n .. ": " .. type(res) .. " = <" .. tostring(res) .. ">")
end Behavior: $ mpv movie.mkv
[testpath] ~~global/: string = </etc/mpv>
[testpath] ~~global/foo/bar: string = </etc/mpv/foo/bar>
[testpath] ~~home/: string = </home/johnny/.config/mpv>
[testpath] ~~home/foo/bar: string = </home/johnny/.config/mpv/foo/bar>
[testpath] ~~/: string = </home/johnny/.config/mpv>
[testpath] ~~/foo/bar: string = </home/johnny/.config/mpv/foo/bar>
[testpath] find: encoding-profiles.conf: string = </etc/mpv/encoding-profiles.conf>
[testpath] find: mpv.conf: string = </home/johnny/.config/mpv/mpv.conf>
$ mpv --no-config --script=/home/johnny/.config/mpv/scripts/testpath.lua movie.mkv
[testpath] ~~global/: string = <>
[testpath] ~~global/foo/bar: string = <foo/bar>
[testpath] ~~home/: string = <>
[testpath] ~~home/foo/bar: string = <foo/bar>
[testpath] ~~/: string = <>
[testpath] ~~/foo/bar: string = <foo/bar>
[testpath] find: encoding-profiles.conf: nil = <nil>
[testpath] find: mpv.conf: nil = <nil> It's a full rewrite of the original commit contents, so check the changes in the new commit here (may need to press Ctrl-R to see the new commit if browser cached): https://github.com/mpv-player/mpv/pull/15218/commits I have tried compiling it with rst2html, and the result looks well-formatted. |
9013b36
to
bbc138b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just need to wrap commit message at 72 characters per line.
bbc138b
to
4a73cdc
Compare
Ah yeah. I've fixed that now. Didn't realize that mpv uses wrapping. I don't wrap commit messages normally, since it's actively harmful to the Git history and totally pointless and causes tons of extra work of manually wrapping and rewriting the lines until they wrap nicely (and some lines will then be very wide and others short since certain words won't fit on the same line), and the process of rephrasing/adding/removing some words later can waste minutes of moving and rewriting words to adapt the line wrapping again. And then when you view those patches in anything that won't exactly fit 72 characters wide, you'll get wonderful "double wrapping" where the viewport also wraps your already manually wrapped lines into a mess of very small fragments (especially on mobile or on tiling window managers or in split terminals)... All of that is much better handled by the viewer application than the committer. There's a reason why we don't manually wrap our Word documents. :D It's a very painful convention that dates back to manually emailed patches and mailing lists. Even there it was dubious, since email clients always wrap text automatically too. And people weren't manually wrapping their email messages back then, just the attached patches, which makes no sense. I wish that had never become a convention. But it's going out of favor. Modern clients like GitKraken don't even support manual wrapping. But when it's already the convention of a project it should of course be followed. Sorry about that! All done! :) And hey, at least it encourages people to write very short commit messages, since manual wrapping is so tedious. ;) |
4a73cdc
to
d64d1fe
Compare
Thanks for the feedback. I have pushed resolutions to all comments. The Changes: |
d64d1fe
to
f1a92e3
Compare
Per last review comment:
Changes (shows changes from both force pushes since last review): PS: I wasn't a fan of the That entry looks like this now. It seems like it's the path to the mpv.exe directory but can be overridden by |
f1a92e3
to
f199030
Compare
f199030
to
86d7425
Compare
Changes:
Hopefully it's ready now! :) Edit: Change-link above includes the last force-push after this comment too. |
The previous documentation was pretty scary and misleading, and was also outdated in several sections. It was also difficult to understand some of the paragraphs. The path documentation has now been overhauled to be much easier to understand and to document the latest mpv behavior.
86d7425
to
9fb2662
Compare
The previous documentation was pretty scary and misleading, and was also outdated in several sections.
It was also difficult to understand some of the paragraphs.
The path documentation has now been overhauled to be easier to understand and to document the latest mpv behavior.
This change documents the fact that there's no difference between
~~/foo
and~~home/foo
in terms of that "scary bug". They both use the exact same code and have the same--no-config
"bug" behavior.References:
Edit: Improved further, as described here: #15218 (comment)