wakatime / wakatime-cli

Command line interface used by all WakaTime text editor plugins
https://wakatime.com/plugins
BSD 3-Clause "New" or "Revised" License
281 stars 41 forks source link

If filename contains `.git`, it will remove `.git` #804

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 1 year ago

Expected behavior (what should have happened): ustc-ivclab.github.io

Actual behavior (what went wrong):

screen-2023-01-13-21-56-18

Environment:

Logs:

{"caller":"pkg/filter/filter.go:33","file":"fern://drawer:1/file:///dev/shm/ustc-ivclab.github.io$","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T19:45:46+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673005518,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"fern://drawer:1/file:///dev/shm/ustc-ivclab.github.io$","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T19:45:46+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673005518,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"fern://drawer:1/file:///dev/shm/ustc-ivclab.github.io$","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T19:49:04+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673005736,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"fern://drawer:1/file:///dev/shm/ustc-ivclab.github.io$","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T20:00:40+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673006438,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"/dev/shm/ustc-ivclab.github.io/_layouts/post.html","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T20:01:19+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673006440,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"/dev/shm/ustc-ivclab.github.io/_layouts/post.html","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T20:01:35+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673006481,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"/dev/shm/ustc-ivclab.github.io/_layouts/post.html","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T20:02:30+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673006495,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"/dev/shm/ustc-ivclab.github.io/_layouts/post.html","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io$\"","now":"2023-01-06T20:03:03+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673006560,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"fern://drawer:1/file:///dev/shm/ustc-ivclab.github.io/_posts/people/faculty;$","func":"filter.WithFiltering","level":"error","message":"filter file: skipping because of non-existing file \"/dev/shm/ustc-ivclab.github.io/fern:/drawer:1/file:/dev/shm/ustc-ivclab.github.io/_posts/people/faculty;$\"","now":"2023-01-06T20:04:55+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673006672,"version":"1.60.4"}
{"caller":"pkg/filter/filter.go:33","file":"/dev/shm/ustc-ivclab.github.io/.git/COMMIT_EDITMSG","func":"filter.WithFiltering","level":"error","message":"filter by pattern: skipping because matches exclude pattern \"(?i)COMMIT_EDITMSG$\"","now":"2023-01-06T20:15:56+08:00","os/arch":"linux/amd64","plugin":"vim/800 neovim-wakatime/10.0.0","time":1673007354,"version":"1.60.4"}
alanhamlett commented 1 year ago

Something else must be going on here... We don't remove .git from files or project names.

To make sure, I was able to send a file name and project name testing.github.io and it reflected correctly on the dashboard.

Check to make sure you don't have any ~/.wakatime.cfg regex patterns renaming projects, or any .wakatime-project file in that folder.

Freed-Wu commented 1 year ago

I found the reason: https://github.com/wbingli/zsh-wakatime/blob/master/zsh-wakatime.plugin.zsh#L15

alanhamlett commented 1 year ago

Yea, that regex shouldn't match .git when contained within another string. I see you already opened an issue there, thanks!