|
From: | Dmitry Gutov |
Subject: | Re: project-find-file: switch to include non-tracked files |
Date: | Tue, 4 May 2021 19:43:14 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 |
On 04.05.2021 17:55, Manuel Uberti wrote:
On 04/05/21 16:16, Dmitry Gutov wrote:The current behavior is to include the untracked files (unless they are in .gitignore). And you can specify additional ignores through the project-vc-ignores variable. If that is not enough, please outline your usage scenario(s).Sure, I'll try to explain myself better. I have Git-versioned projects where I usually track an .envrc.sample file for everyone to use as a starting point on their own machines. Developers are instructed to copy that file to a local (i.e., untracked) .envrc file. Since there could (and usually will) be information we don't want to be tracked on Git (e.g., one's own system-related customizations), .envrc is listed in .gitignore. Every now and then, I need to open that .envrc file and add something, but because it is listed in .gitignore, the file doesn't show up in project-find-file.
Aha! So you want to open an _ignored_ file (which is also untracked, of course).
There are two ways to solve this:- Add "whitelisting" syntax to project-vc-ignores and the project-ignores method. Then you edit the value of this variable, whitelisting .envrc in the given project (or globally), and project-find-file will always include it.
- We add an arg like NO-PROJECT-IGNORES to the project-files method. Then project-find-file could use it in (some?) circumstances.
What helm-ls-git offers is the possibility to hit C-c i and showing the untracked files.
Patches or even plain suggestions welcome for the GUI side of this, at least. I'm not sure how to add a behavior like this on 'C-c i' to the default completing-read interface, which is what project-find-file ultimately calls (and can dispatch to alternative UIs like Ivy)
We can add this behavior when a prefix argument is used (like C-u C-x p f'), but that's no dynamic switching.
[Prev in Thread] | Current Thread | [Next in Thread] |