unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* project-find-file: switch to include non-tracked files
@ 2021-05-04 13:39 Manuel Uberti
  2021-05-04 14:04 ` Stefan Kangas
  2021-05-04 14:16 ` Dmitry Gutov
  0 siblings, 2 replies; 6+ messages in thread
From: Manuel Uberti @ 2021-05-04 13:39 UTC (permalink / raw)
  To: emacs-devel

Hello everyone,

there is a nice feature in helm-ls-git[1] which lets you browse files
non-tracked by the current VCS (bound to C-c i in helm-ls-git-map). Hitting C-c
i again brings you back to the tracked-files-only browsing.

Is something achievable with project-find-file?

I don't think this is a bug report, but if you prefer for this to be reported as
a bug I will do it.


All the best

[1] https://github.com/emacs-helm/helm-ls-git

-- 
Manuel Uberti
www.manueluberti.eu



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: project-find-file: switch to include non-tracked files
  2021-05-04 13:39 project-find-file: switch to include non-tracked files Manuel Uberti
@ 2021-05-04 14:04 ` Stefan Kangas
  2021-05-04 14:16 ` Dmitry Gutov
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Kangas @ 2021-05-04 14:04 UTC (permalink / raw)
  To: Manuel Uberti, emacs-devel

Manuel Uberti <manuel.uberti@inventati.org> writes:

> there is a nice feature in helm-ls-git[1] which lets you browse files
> non-tracked by the current VCS (bound to C-c i in helm-ls-git-map). Hitting C-c
> i again brings you back to the tracked-files-only browsing.

Good idea.  I would definitely use something like that.

> Is something achievable with project-find-file?
>
> I don't think this is a bug report, but if you prefer for this to be reported as
> a bug I will do it.

You can report bugs for feature requests, from Info node '(emacs) Bugs':

    If you think you have found a bug in Emacs, please report it.  We cannot
    promise to fix it, or always to agree that it is a bug, but we certainly
    want to hear about it.  The same applies for new features you would like
    to see added.

If you put "Severity: wishlist" as the first line of your email, it
will be automatically categorized as a feature request, but it is not a
requirement to do that.  It can be categorized manually later.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: project-find-file: switch to include non-tracked files
  2021-05-04 13:39 project-find-file: switch to include non-tracked files Manuel Uberti
  2021-05-04 14:04 ` Stefan Kangas
@ 2021-05-04 14:16 ` Dmitry Gutov
  2021-05-04 14:55   ` Manuel Uberti
  1 sibling, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2021-05-04 14:16 UTC (permalink / raw)
  To: Manuel Uberti, emacs-devel

Hi!

On 04.05.2021 16:39, Manuel Uberti wrote:
> there is a nice feature in helm-ls-git[1] which lets you browse files
> non-tracked by the current VCS (bound to C-c i in helm-ls-git-map). Hitting C-c
> i again brings you back to the tracked-files-only browsing.

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).



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: project-find-file: switch to include non-tracked files
  2021-05-04 14:16 ` Dmitry Gutov
@ 2021-05-04 14:55   ` Manuel Uberti
  2021-05-04 16:43     ` Dmitry Gutov
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel Uberti @ 2021-05-04 14:55 UTC (permalink / raw)
  To: Dmitry Gutov, emacs-devel

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.

What helm-ls-git offers is the possibility to hit C-c i and showing the
untracked files. This doesn't involve changing any setting, it's just a matter
of pressing C-c i whenever is needed. This is useful because generally I want
everything listed in .gitignore to be ignored by project-find-file, but there
are small exceptions such as this where I want to edit an ignored file without
using find-file to get to it.

-- 
Manuel Uberti
www.manueluberti.eu



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: project-find-file: switch to include non-tracked files
  2021-05-04 14:55   ` Manuel Uberti
@ 2021-05-04 16:43     ` Dmitry Gutov
  2021-05-04 16:57       ` Manuel Uberti
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2021-05-04 16:43 UTC (permalink / raw)
  To: Manuel Uberti, emacs-devel

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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: project-find-file: switch to include non-tracked files
  2021-05-04 16:43     ` Dmitry Gutov
@ 2021-05-04 16:57       ` Manuel Uberti
  0 siblings, 0 replies; 6+ messages in thread
From: Manuel Uberti @ 2021-05-04 16:57 UTC (permalink / raw)
  To: Dmitry Gutov, emacs-devel

On 04/05/21 18:43, Dmitry Gutov wrote:
> 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.

Both solutions sound good, but considering the prefix argument discussed below,
probably the second one seems like the nicest.

> We can add this behavior when a prefix argument is used (like
> C-u C-x p f'), but that's no dynamic switching.

This would be great. Dynamic switching is not a must-have for me, I was just
offering an example of a possible behaviour. What's important is being able to
get to the ignored file(s) through project-find-file.

-- 
Manuel Uberti
www.manueluberti.eu



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-04 16:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-04 13:39 project-find-file: switch to include non-tracked files Manuel Uberti
2021-05-04 14:04 ` Stefan Kangas
2021-05-04 14:16 ` Dmitry Gutov
2021-05-04 14:55   ` Manuel Uberti
2021-05-04 16:43     ` Dmitry Gutov
2021-05-04 16:57       ` Manuel Uberti

unofficial mirror of emacs-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-devel/0 emacs-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-devel emacs-devel/ https://yhetil.org/emacs-devel \
		emacs-devel@gnu.org
	public-inbox-index emacs-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.devel
	nntp://news.gmane.io/gmane.emacs.devel


code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs.git

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git