hangxingliu / vscode-coding-tracker

:clock10: A coding activities tracker(time, file, type)
GNU General Public License v3.0
169 stars 36 forks source link

storing file paths relative to the project directory #22

Closed yorrd closed 6 years ago

yorrd commented 6 years ago

Hi again. There are several people in our team who use multiple computers which obviously have different file systems. Therefore, even if they're working on the same project, the file paths will differ and the data will be split instead of being merged.

I was wondering: is there a problem if we just ignore everything above the project level and store the relative path instead? The data will still be split by project, so different projects with the same files will still be split, as it is right now.

If you don't see an issue with this approach, I'd be happy to contribute a pull request implementing this behavior in the coming weeks. :+1:

hangxingliu commented 6 years ago

Actually, the file in project folder is store by relative path.

But there is an other case, you open a file located in project B into VSCode with current workspace is project A. The coding-tacker will store it in absolute path. Because it didn't know that file is located in project B.

For example:

  1. You know ther have two projects in your computer /path/to/A and /path/to/B
  2. You open /path/to/A folder in VSCode
  3. Then you open /path/to/B/README.md in this window

But it could be merged in analyzing. And I think it will be better too.

And if you rename the project path or project has different path in different computer, you can click Associate Projects button in the right-top side in Projects Report sub-page.


And do you think is add a option to report projects tracking data by project basename but not absolute path is a good idea and necessary.

For example, turn this option on, Thease three projects will be merged as same one:

  1. /home/Mike/projects/ETH-miner
  2. /home/John/projects/ETH-miner
  3. /home/John/archived/old-miner/ETH-miner
yorrd commented 6 years ago

Youre completely right, project associations make a lot more sense! I missed that button :)