Skip to content
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

[Windows]: Channel git-repos doesn't seem to work properly #24

Open
JustBarnt opened this issue Nov 14, 2024 · 6 comments
Open

[Windows]: Channel git-repos doesn't seem to work properly #24

JustBarnt opened this issue Nov 14, 2024 · 6 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@JustBarnt
Copy link

Description
When running tv git-repos it only picks up very few repos. As seen in the screenshot.
I know on my C:/ alone I have way more than whats there, not to mention when I run tv git-repos on my D:/ it produces the same results. I don't think it is scanning properly on windows.

On my C:/ alone I have repositories for C:\users\<username>\.config\ which houses all my TUI related configs like you'd see on a unix machine, I have my nvim configuration as well, and all the nvim-data/lazyvim items as well that get git cloned, which also are not getting picked up.

This ends up being what gets scanned.
image

Example

  1. Install television as instructed.
  2. Run tv git-repos

Expected behavior
Television should pick up all git repositories on the filesystem.

Actual behavior
Television is returning very few directories.

Environment

  • OS Name: Microsoft Windows 11 Pro
  • OS Version: 10.0.22631 N/A Build 22631
  • Rust version: rustc 1.80.1 (3f5fd8dd4 2024-08-06)
  • Project version:
    television 0.4.21
    target triple: x86_64-pc-windows-msvc
    build: 1.80.1 (2024-11-14)
    -Terminal:
    Wezterm: wezterm 20240812-215703-30345b36

Additional context
It also may be good to be able to include a list of directories to ignore when searching instead of it just showing all based of the README description of git-repos?

@JustBarnt JustBarnt added the bug Something isn't working label Nov 14, 2024
@JustBarnt
Copy link
Author

I know absolutely no rust, but because I like to learn, I was reading through the git-repos.rs file. I found this line

I think when the channel is created looks like it only runs through the BaseDirs.home_dir() results which according to what I can find is only is C:\Users\<username>. Would this be a cause where it would be better to have a configurable list of directories we can setup in the config.toml file instead?

I am compleletly wrong please let me know. Like I said I have no rust experience just using this to try and learn and be helpful! 🤣

@alexpasmantier
Copy link
Owner

Your help is very much welcome since it's difficult for me to get my hands on a windows machine and debug these right now.

Adding custom base paths from the config for the git-repos channel does sound like the way to go 👍🏻

I'm wondering if your git-repos not being found might be a cause of the crawler ignoring hidden directories (which might mean repos in your .config folder for instance might never be inspected).

Will check that out ASAP.

@JustBarnt
Copy link
Author

@alexpasmantier Yeah I suspected that is the issue, once I did some lookup on the documentation for BaseDirs.home_dir() in rust and say that it was only the C:/Users/<username> drive and then it was already pushing folders like .config, appdata, etc to be hidden.

But thank you for being so quick on these!

@alexpasmantier alexpasmantier added the good first issue Good for newcomers label Nov 20, 2024
@JustBarnt
Copy link
Author

@alexpasmantier I was curious if you have had a chance to look more into this? I see you have been busy with other stuff so I was just curious!

@alexpasmantier
Copy link
Owner

@JustBarnt

I'm currently working on a new feature which will enable users to define their own custom channels.

While this won't exactly solve the built-in GitRepos channel crawling problem on Windows, it will enable you to create a fully working replacement channel for that usecase with just 3 lines of config until I'm able to address the original issue.

The idea is pretty simple and users will be able to define their channels using a toml file. A simple example of this might be:

#recipes.toml

[[recipes]]
name = "Git log"
source_command = 'git log --oneline --date=short --pretty="format:%h %s %an %cd" "$@"'
preview_command = 'git show -p --stat --pretty=fuller --color=always {0}'

[[recipes]]
name = "Git branches"
...

[[recipes]]
name = "S3 buckets"
...

etc.

And the corresponding output:

Screenshot 2024-12-03 at 15 15 49

@JustBarnt
Copy link
Author

@alexpasmantier Ohhh! This looks like an awesome feature! I can't wait to try this out! Well thanks for the update, I'm looking very forward to this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants