vcs-jump icon indicating copy to clipboard operation
vcs-jump copied to clipboard

Optionally make "merge" mode work in repo-wide sense

Open wincent opened this issue 4 years ago β€’ 0 comments

git-jump itself uses git ls-files -u and so if you have conflicts in "a/" but you've cd-ed into "b/" you won't see them. We might want to (optionally) override that behavior with something like:

diff --git a/bin/vcs-jump b/bin/vcs-jump
index 888ebdd..e2a33a7 100755
--- a/bin/vcs-jump
+++ b/bin/vcs-jump
@@ -113,7 +113,9 @@ end
 def mode_merge(__args__ignored)
   if git?
     prefix = "#{pwd}/"
-    command = 'git ls-files -u'
+    # TODO make this an option, and probably simplify path as well; write tests
+    # etc
+    command = 'git ls-files -u -- $(git rev-parse --show-toplevel)'
     filter = "perl -pe 's#^.*?\\t##{prefix}#'"
   else
     command = 'hg resolve -l'

I get that you might expect grep to work on the current directory only, and maybe even diff, but not so sure about merge.

wincent avatar Oct 22 '19 08:10 wincent