Comments (12)
came to report this issue too. my use case is also git status
from pathpicker.
Can you show the output of your git status
command @hobzcalvin ? I believe this might be due to git doing abbreviated file paths which I fixed in #18 (well, at least warned against)
from pathpicker.
I have the same issue, I can't open files when I'm not in the toplevel git directory.
from pathpicker.
09:11:13@~/test/myrepo/inside> git status
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
nested/morethings.stuff
nothing added to commit but untracked files present (use "git add" to track)
09:11:15@~/test/myrepo/inside> git status | fpp
executing command:
git add '/Users/grant/test/myrepo/nested/morethings.stuff'
fatal: pathspec '/Users/grant/test/myrepo/nested/morethings.stuff' did not match any files
09:11:26@~/test/myrepo/inside> cd ..
09:11:54@~/test/myrepo> git status | fpp
executing command:
git add '/Users/grant/test/myrepo/inside/nested/morethings.stuff'
09:12:01@~/test/myrepo> git status
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: inside/nested/morethings.stuff
09:12:07@~/test/myrepo>
from pathpicker.
+1, can not edit files with Vim unless I'm in a Git top level directory. Vim receives quoted path string and assumes it to be a new file name.
from pathpicker.
Weirdddd since we parse the top level directory for both git and mercurial here:
https://github.com/facebook/PathPicker/blob/master/src/parse.py#L38-L66
@hobzcalvin I can't repro myself -- can you output the result of:
git --version
git rev-parse --show-toplevel
when insidemyrepo/inside
git rev-parse --show-toplevel
when inside ofmyrepo
? im wondering if our top level dir parsing is not correct
from pathpicker.
I was able to reproduce this issue locally but only when the selected file was within a sub-folder of the current working directory. See attached screencast.
Here's the output of git status
and git status | fpp
+ ls -l
marcoswk src [master•] $ git status
On branch master
Your branch is up-to-date with 'facebook/master'.
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: new/issue20.py
modified: test.py
marcoswk src [master•] $ git status | fpp
getting input
executing command:
ls -l '/Users/marcoswk/workspace/PathPicker/new/issue20.py' './test.py'
ls: /Users/marcoswk/workspace/PathPicker/new/issue20.py: No such file or directory
-rw-r--r--@ 1 marcoswk staff 8238 May 11 21:09 ./test.py
As you can see, for whatever reason, the full path except the src
directory is used when selecting the new/issue20.py
file.
from pathpicker.
"I was able to reproduce this issue locally but only when the selected file was within a sub-folder of the current working directory."
This is true for me as well. If I go up to the top level git dir, then it works.
However, if I try it from a subfolder then I can reproduce the issue.
from pathpicker.
Gah yeah, this is an issue specific to git status. Heres the relevant block from the manpage:
The paths mentioned in the output, unlike many other Git commands, are made relative to the current directory if you are working in a subdirectory (this is on purpose, to help cutting and pasting). See the status.relativePaths config option below.
Emphasis mine. 😢 😭 You can of course turn this off but who will do that:
If the config variable status.relativePaths is set to false, then all paths shown are relative to the repository root, not to the current directory.
Whereas of course git diff (and a bunch of other git commands) are made relative to the top level tree:
[pcottle:~/Dropbox (Facebook)/wip/PathPicker:master]$ git diff HEAD~2 --stat
src/colorPrinter.py | 2 +-
src/parse.py | 16 ++++++++--------
src/processInput.py | 1 +
src/screenControl.py | 1 -
src/test.py | 10 +++++-----
5 files changed, 15 insertions(+), 15 deletions(-)
[pcottle:~/Dropbox (Facebook)/wip/PathPicker:master]$ cd src/
[pcottle:~/Dropbox (Facebook)/wip/PathPicker/src:master]$ git diff HEAD~2 --stat
src/colorPrinter.py | 2 +-
src/parse.py | 16 ++++++++--------
src/processInput.py | 1 +
src/screenControl.py | 1 -
src/test.py | 10 +++++-----
5 files changed, 15 insertions(+), 15 deletions(-)
I feel like we have two options:
- Dangerously introspect into the format of the piped input and detect if its a git status command, and then totally rework our logic. not ideal
- use filesystem validation to check for top-level git directory path prepending and, if that fails, switch to
./
and check again.
I'll take a crack at 2. later today, since we need to move in that direction regardless
from pathpicker.
What if you prepended a sequence of "../" until you had a file match and displayed only paths whose existence was confirmed?
from pathpicker.
What if you prepended a sequence of "../" until you had a file match and displayed only paths whose existence was confirmed?
hrm, id rather check either the git level top dir or just the current dir, since going up forever seems a bit cargo-cultish (like killing a fly with a sledgehammer). this is next on my plate though after this release
from pathpicker.
This is fixed in #114!!
from pathpicker.
Related Issues (20)
- Allow configuring keyboard controls
- Command mode is broken in latest master HOT 1
- fpp-git on AUR is quite outdated HOT 2
- Feature Request: Make man page easier to read, put each flag in its own line. HOT 5
- Filename within `#` cannot be pick
- The way of determining shell is not reliable.
- Demo videos in homepage not loading on mobile HOT 2
- Issue and PR templates HOT 2
- Skip the `F` key in quick select mode
- Problems with paths with spaces in them
- New release before EOY? HOT 6
- Support for git diffs
- Standalone Executable File
- fpp not opening files in $EDITOR HOT 7
- Infinite loop when selecting entry with certain width relative to window width HOT 1
- Release 0.9.5 but fpp --version says 0.9.2 HOT 1
- feature request: open files in vim tab pages
- chore: use pre-commit hook
- ci: update versions and add `paths-ignore`
- macOS Python segfault HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathpicker.