-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Question/Discussion] using .git/info/exclude to exclude local file instead of .gitignore #2014
Comments
Is this just a |
@mark2185 yup it just goes inside of |
Sounds like a neat addition, didn't even know about it. Would you be interested in opening a PR? The logic should be the same as with adding to |
@mark2185 I would love too, can you point me ate where the logic for this is. I was looking but was having a hard time finding it :) |
Off the top of my head - look into the files changed in PR #2004, that should be a start. Look where are the changed functions called from. Let me know if you need additional pointers and I'll take a closer look next time I'm at my laptop. |
So having another look at this it seems like there are a few references to gitignore in |
The one you're looking for is in files_controller.go, this sets the function ignore as the handler for when someone presses What we're trying to go for now is adding a new mapping ( The handlers could be ordinary lambdas that do what checkSelectedFileNode does before invoking Does that help? Do let us know if there's anything else to clear up! :) |
ok so just did my first try on it and send you a draft PR for it. It probably needs some more work. One question I still have is how to actually add the |
Just saw this after making the draft PR. will have look again at this over the weekend and amend my PR with your comments :) It definitely helps :) |
@mark2185 looking at this at the moment. I don't think your suggestion will work because it calls to |
That's perfectly reasonable, it could/should take a parameter as the destination file.
That, as well as the rest of the steps down to the bottom, such as |
@mark2185 ok so the Refactoring was successful and ignore is back to working order. However, I can't get exclude (a.k.a |
BTW @jesseduffield your video on adding a feature was really helpful in getting to grips with the bits of the codebase I have to touch. Thank you for making it. I hope you will make more like it in the future |
No worries @gozes ! I'm in the process of trying to free up more time to make more videos / guides so hopefully there'll be more in the near future |
I believe this can be closed now :) Great work! @gozes |
should there be an option to use .git/info/exclude in the File window?
A bit of context from the git docs as to what .git/info/exclude is
Your thoughts
I really think it will be quite useful to have let say
I
in the File window to add files to the exclude file along side thei
command we already have.I use this quite a bit to put my editor config for a repo. Another good example of using this is to put the VSCode
devcontainer.json
used in the Remote container extension so that you can have your own container to run a project in. Has anyone else used the exclude file before if so what do you think will it be useful to have this in lazygit?The text was updated successfully, but these errors were encountered: