direx icon indicating copy to clipboard operation
direx copied to clipboard

Support for viewing a git repo tree.

Open dov opened this issue 9 years ago • 4 comments

Instead of using the file system traversal for building the tree, this option would delegate getting the files from a function that would return the output of "git ls-files".

dov avatar Jan 11 '16 12:01 dov

But then you'd make it only compatible with git projects. Also I don't know how much faster git ls-files would be. I guess if it is way faster then maybe this would make sense.

agzam avatar Dec 24 '18 21:12 agzam

By using an abstraction for the function that returns the files of the tree, git would just be one instantiation, in or an extension, if you'd like. There wouldn't be any core depenedncy on git. By such an abstraction function you could easily create trees for other repositories, or any other DAG.

Regarding git, the advantage of looking for git files only is that it solves the problem of what files to ignore in your list. I assume you have some heuristics of ignoring files ending with tilde, or .bak, or .log, or whatever. By using git you delegate that heuristics to git.

The functionality I suggested is a bit similar to the following git-find-file function that I typically use to find a file anywhere in a git repository: https://github.com/dov/dov-env/blob/master/emacs/git-find-file.el .

dov avatar Dec 24 '18 21:12 dov

I'm not sure what you mean by:

There wouldn't be any core dependency on git

git ls-files literally works only in git directories. Also Interesting function. I typically use magit-find-file whenever I need to find something in the repo, but this looks cool.

agzam avatar Dec 24 '18 21:12 agzam

I just meant that you can always put it in something like direx-git.el so it is totally separate from the direx.el .

Didn't know about magit-find-file, but git-find-file is much quicker. Especially since it seamlessly works with helm.

dov avatar Dec 24 '18 21:12 dov