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

Global .ignore file #8300

Closed

Conversation

SecretPocketCat
Copy link

I was missing an option to use a global .ignore file to globally ignore (some) binary files. Some of those (e.g. images) might be checked into VCS, so the global git ignore is not helpful in that case.
I considered just checking whether the file exists and adding it but then switched to adding it to the config instead. The option could also be a path to the global .ignore.

A command to create such a default global .ignore could be added, but a follow-up PR would probably make more sense for that.

@SecretPocketCat SecretPocketCat changed the title Global ignore file Global .ignore file Sep 16, 2023
@@ -171,6 +171,7 @@ All git related options are only enabled in a git repository.
|`deduplicate-links` | Ignore symlinks that point at files already shown in the picker | true
|`parents` | Enables reading ignore files from parent directories | true
|`ignore` | Enables reading `.ignore` files | true
|`global-ignore` | Enables reading a global `.ignore` file from the same directory as the config.toml configuration | true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a feature flag? If the user doesn't have an ignore file then this feature is effectively disabled anyway

Copy link
Author

@SecretPocketCat SecretPocketCat Sep 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's mentioned in the OP.

I considered just checking whether the file exists and adding it [...]

Should I switch to that approach?
Where should I put the info about the global .ignore? configuration.md or some place else?

BTW. Thanks for taking the time to look at this. 🙂

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's the current version?

@SecretPocketCat
Copy link
Author

I somehow overlooked this comment in the docs

Set options for file picker and global search. Ignoring a file means it is not visible in the Helix file picker and global search.

I should probably add the global ignore to the global search too then.

An alternative approach would be adding a global ignore for each (e.g. file_picker.ignore & global_search.ignore) to make it more granular. Not sure if that would be all that useful though and not just muddy the configuration waters.

@SecretPocketCat
Copy link
Author

Closing in favour of #8099

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants