pt-plugins / PT-Plugin-Plus

PT 助手 Plus,为 Microsoft Edge、Google Chrome、Firefox 浏览器插件(Web Extensions),主要用于辅助下载 PT 站的种子。
MIT License
6.91k stars 850 forks source link

feat(PTP): add freeleech tag #1979

Closed tomyangsh closed 2 months ago

tomyangsh commented 2 months ago

为 PTP 搜索结果添加 Free 标签

注:由于将原有的 crlf 统一替换为了 lf,所以 diff 中看起来好像整个文件都重写了(

ted423 commented 2 months ago
E:\Github\PT-Plugin-Plus>git config  --list
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
http.sslbackend=openssl
http.sslcainfo=C:/Program Files/Git/mingw64/etc/ssl/certs/ca-bundle.crt
core.autocrlf=true
core.fscache=true
core.symlinks=true
core.fsmonitor=true
pull.rebase=false
credential.helper=manager
credential.https://dev.azure.com.usehttppath=true
init.defaultbranch=master
user.name=x
user.email=x
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.editor=x
diff.guitool=vscode
difftool.vscode.path=C:/Program Files/Microsoft VS Code/code.exe
difftool.vscode.cmd="C:/Program Files/Microsoft VS Code/code.exe" --wait --diff "$LOCAL" "$REMOTE"
merge.guitool=vscode
mergetool.vscode.path=C:/Program Files/Microsoft VS Code/code.exe
mergetool.vscode.cmd="C:/Program Files/Microsoft VS Code/code.exe" --wait "$MERGED"
pull.rebase=false

我这默认win下github-desktop装的 默认

core.autocrlf=true

解释是

This means that Git will process all text files and make sure that CRLF is replaced with LF when writing that file to the object database and turn all LF back into CRLF when writing out into the working directory. This is the recommended setting on Windows because it ensures that your repository can be used on other platforms while retaining CRLF in your working directory.
ted423 commented 2 months ago

因此你这个提交在我看来仍然是crlf 但从这里获取是https://raw.githubusercontent.com/pt-plugins/PT-Plugin-Plus/dev/resource/sites/passthepopcorn.me/getSearchResult.js

lf的

事实上我从这个项目的url获取别的文件也是lf的。所以我感觉你可能要检查下你的git 配置。

不知道发生了什么,正常应该保存在这个项目里的文件都是lf的。 因为action里编译应该都是在linux下面跑的

ted423 commented 2 months ago

比如 https://raw.githubusercontent.com/pt-plugins/PT-Plugin-Plus/dev/resource/sites/pandapt.net/config.json 下下来是lf的

image

ted423 commented 2 months ago

又验证了一下 https://github.com/pt-plugins/PT-Plugin-Plus/raw/e7d941a7910a3d6b5fae937e52cd57bb2fb3825c/resource/sites/passthepopcorn.me/getSearchResult.js

直接下载这个文件也是lf的,所以会不会是因为你用了wsl之类的? 因为理论linux直接检出应该是lf的文件

ted423 commented 2 months ago

又验证了一下 https://github.com/pt-plugins/PT-Plugin-Plus/raw/e7d941a7910a3d6b5fae937e52cd57bb2fb3825c/resource/sites/passthepopcorn.me/getSearchResult.js

直接下载这个文件也是lf的,所以会不会是因为你用了wsl之类的? 因为理论linux直接检出应该是lf的文件

这里弄错了,原因是查看软件的一个bug,重新加载文件,状态栏没有更新,导致一直显示lf,但实际老的提交确实是crlf