Skip to content

plugins/oil-git-status: init #3292

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

FKouhai
Copy link
Member

@FKouhai FKouhai commented May 6, 2025

this PR adds oil-git-status to nixvim, since it recently got into master branch of nixpkgs
https://github.com/refractalize/oil-git-status.nvim

@FKouhai

This comment was marked as outdated.

@FKouhai

This comment was marked as outdated.

@FKouhai

This comment was marked as outdated.

@FKouhai

This comment was marked as outdated.

@FKouhai

This comment was marked as outdated.

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from 0312925 to 0c3010b Compare May 6, 2025 21:54
@FKouhai

This comment was marked as outdated.

@MattSturgeon

This comment was marked as outdated.

@FKouhai

This comment was marked as outdated.

@FKouhai
Copy link
Member Author

FKouhai commented May 7, 2025

finally I made it work
image

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from 0c3010b to 584b1a9 Compare May 7, 2025 21:17
@FKouhai
Copy link
Member Author

FKouhai commented May 7, 2025

pushed with a comment on how to successfully lazy load this plugin

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch 2 times, most recently from bcef5a7 to 3ab6924 Compare May 7, 2025 21:55
@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch 2 times, most recently from ed2bd70 to 2d4ba0d Compare May 8, 2025 18:26
Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

Thanks for your persistence, looks like this is nearly there 🚀

@FKouhai
Copy link
Member Author

FKouhai commented May 8, 2025

Thanks for your persistence, looks like this is nearly there 🚀

thank you :) you've been giving me really good reviews I really appreciate them

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch 2 times, most recently from bb12cca to fe8ff6c Compare May 8, 2025 19:55
@MattSturgeon

This comment was marked as resolved.

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from fe8ff6c to e109b87 Compare May 8, 2025 20:01
@FKouhai

This comment was marked as resolved.

@FKouhai

This comment was marked as resolved.

@GaetanLepage

This comment was marked as resolved.

@FKouhai

This comment was marked as resolved.

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from e109b87 to 08dca3c Compare May 8, 2025 20:28
@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from 08dca3c to a2525d2 Compare May 8, 2025 20:35
@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from a2525d2 to 830c9c8 Compare May 8, 2025 20:40
Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

when = !config.plugins.oil.enable;
message = ''
This plugin requires `plugins.oil` to be enabled
plugins.oil.enable = true;
Copy link
Member

Choose a reason for hiding this comment

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

This is kinda subjective, but if we interpolate the actual option, users will see either plugins.oil.enable or programs.nixvim.plugins.oil.enable depending on whether their nixvim configuration is a programs.nixvim submodule.

This also has the advantage of ensuring no typos.

Suggested change
plugins.oil.enable = true;
${options.plugins.oil.enable} = true;

To do this, you need the options module arg of course.

Also, nit: I would indent the code example and add a colon to the end of the previous line, to be consistent with the other warning.

Copy link
Member Author

Choose a reason for hiding this comment

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

yep I like that :)

when = !config.plugins.oil.settings.win_options.signcolumn or null != "yes:2,";
message = ''
This plugin requires the following `plugins.oil` setting:
plugins.oil.settings={
Copy link
Member

Choose a reason for hiding this comment

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

Same optional/subjective suggestion:

Suggested change
plugins.oil.settings={
${plugins.oil.settings} = {

Also, nit: spaces around the = please 🙂

'';
}
{
when = !config.plugins.oil.settings.win_options.signcolumn or null != "yes:2,";
Copy link
Member

Choose a reason for hiding this comment

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

Q: is this the only supported valid string, or are there other values that'd work?

E.g. would it be more correct to check lib.strings.hasInfix "yes:2" signcolumn?

I'm unfamiliar with oil, but the value looks suspiciously like something that can be configured with more complex syntax and still work for oil-git-status?

Copy link
Member Author

Choose a reason for hiding this comment

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

so 2 would be min number of sign columns

Copy link
Member

Choose a reason for hiding this comment

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

Is it valid to e.g. have something like "yes:2,3" or "yes:2,10" to have a min & max?

If so, maybe we want lib.strings.hasPrefix "yes:2,"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that's valid . the generated lua is this

 require("oil").setup({ win_options = { signcolumn = "yes:2" } })

it has to be a number bigger than 2 I think I could skip that , to avoid confusion

Copy link
Member Author

Choose a reason for hiding this comment

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

maybe we could use lib.strings,hasPrefix "yes:"

Copy link
Member Author

Choose a reason for hiding this comment

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

I just tried to run the tests without the , and they pass as well so I'd saw we are good

Copy link
Member Author

Choose a reason for hiding this comment

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

image
image

Copy link
Member

Choose a reason for hiding this comment

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

once it gets generated to lua it's already stripped

Is there a custom option apply function doing that? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

might be part of the translation layer, like since in this case it's only that value being set it might just get stripped to prevent a typo or something like that

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any custom behaviour in the option declaration:

signcolumn = helpers.defaultNullOpts.mkStr "no" "";

might be part of the translation layer,

If you mean the lua translation layer, that's not relevant to your warning. You are reading the option value (i.e. a nix value) not the rendered lua.

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from 830c9c8 to 37a6d08 Compare May 8, 2025 21:56
Copy link
Member

@MattSturgeon MattSturgeon left a comment

Choose a reason for hiding this comment

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

LGTM, one whitespace nit and a rebase needed, then I think its good to merge.

Once the whitespace is fixed, can you fetch our repo and rebase onto main?

git fetch --all
git rebase upstream/main
git push --force-with-lease

Thanks for your hard work on this!

@FKouhai FKouhai force-pushed the feat/add_oil_git_status branch from 37a6d08 to aa1ae69 Compare May 8, 2025 22:19
@FKouhai
Copy link
Member Author

FKouhai commented May 8, 2025

LGTM, one whitespace nit and a rebase needed, then I think its good to merge.

Once the whitespace is fixed, can you fetch our repo and rebase onto main?

git fetch --all
git rebase upstream/main
git push --force-with-lease

Thanks for your hard work on this!

nah man thank you for bearing with me, sometimes I can be a bit intense, and thanks for the reviews they were extremely helpful and I got to learn a lot from this :)

@FKouhai

This comment was marked as outdated.

This comment was marked as outdated.

@MattSturgeon
Copy link
Member

@Mergifyio queue

Copy link
Contributor

mergify bot commented May 8, 2025

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at aa1ae69

Copy link
Contributor

mergify bot commented May 8, 2025

This pull request, with head sha aa1ae69b573e64ce145672663471795daed2ec9e, has been successfully merged with fast-forward by Mergify.

This pull request will be automatically closed by GitHub.

As soon as GitHub detects that the sha aa1ae69b573e64ce145672663471795daed2ec9e is part of the main branch, it will mark this pull request as merged.

It is possible for this pull request to remain open if this detection does not happen, this usually happens when a force-push is done on this branch feat/add_oil_git_status, this means GitHub will fail to detect the merge.

@mergify mergify bot merged commit aa1ae69 into nix-community:main May 8, 2025
4 checks passed
@mergify mergify bot temporarily deployed to github-pages May 8, 2025 22:29 Inactive
@FKouhai FKouhai deleted the feat/add_oil_git_status branch May 8, 2025 22:30
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.

3 participants