-
Notifications
You must be signed in to change notification settings - Fork 492
DotfileManager: add initial dotfile manager detection #1702
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
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds initial support for detecting the user's dotfile manager, addressing issue #1696. Key changes include:
- Adding dotfile manager options and initialization/cleanup hooks in options and modules.
- Implementing detection logic for bare git repositories, chezmoi, and YADM.
- Introducing new dotfile manager module files to integrate the detection and reporting.
Reviewed Changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/options/modules.h and modules.c | Added dotfileManager option setup and corresponding init/destroy |
src/modules/options.h and modules.h | Included dotfilemanager headers for module integration |
src/modules/dotfilemanager/* | Added module option, header, and implementation for dotfile manager |
src/detection/dotfilemanager/* | Implemented detection functions and README for dotfile manager |
src/common/modules.c | Added dotfileManager to the modules list |
Files not reviewed (3)
- CMakeLists.txt: Language not supported
- doc/json_schema.json: Language not supported
- presets/all.jsonc: Language not supported
Comments suppressed due to low confidence (2)
src/detection/dotfilemanager/dotfilemanager.c:52
- New dotfile manager detection functionality is introduced; please add tests to cover each detection case (bare git repository, chezmoi, and YADM).
const char* ffDetectDotfileManager(FFDotfileManagerResult* result)
src/modules/dotfilemanager/dotfilemanager.c:108
- [nitpick] The icon string '' used for initializing module args may not render consistently across all environments; consider verifying its suitability or documenting its intended behavior.
ffOptionInitModuleArg(&options->moduleArgs, "");
|
||
### Home manager | ||
|
||
[Home manager](https://github.com/nix-community/home-manager) has no standard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is frustrating. As far as I know it's commonly used by Nix community
ffStrbufSetS(&result->name, "bare git repository"); | ||
return true; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also check if git is installed
ffStrbufAppendS(&fullPath, "chezmoi"); | ||
|
||
if (ffPathExists(fullPath.chars, FF_PATHTYPE_DIRECTORY)) { | ||
ffStrbufSetS(&result->name, "chezmoi"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if chezmoi command exists
ffStrbufSet(&fullPath, configDir); | ||
ffStrbufAppendS(&fullPath, "yadm"); | ||
|
||
if (ffPathExists(fullPath.chars, FF_PATHTYPE_DIRECTORY)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Optionally, check version of these managers. |
Thanks for the speedy review! I'll have time to work on this again in a few days and will address all your comments. |
Fixes #1696.