@@ -10,6 +10,10 @@ local entry_display = require "telescope.pickers.entry_display"
10
10
local strings = require " plenary.strings"
11
11
local Path = require " plenary.path"
12
12
13
+ -- qqq
14
+ local U = require " plenary.utils"
15
+ -- !qqq
16
+
13
17
local conf = require (" telescope.config" ).values
14
18
local git_command = utils .__git_command
15
19
@@ -46,6 +50,10 @@ git.files = function(opts)
46
50
git_command ({ " -c" , " core.quotepath=false" , " ls-files" , " --exclude-standard" , " --cached" }, opts )
47
51
)
48
52
53
+ -- qqq
54
+ -- vim.notify("git.files: " .. vim.inspect(opts), vim.log.levels.ERROR)
55
+ -- !qqq
56
+
49
57
pickers
50
58
.new (opts , {
51
59
prompt_title = " Git Files" ,
@@ -191,6 +199,13 @@ git.bcommits = function(opts)
191
199
opts .git_command =
192
200
vim .F .if_nil (opts .git_command , git_command ({ " log" , " --pretty=oneline" , " --abbrev-commit" , " --follow" }, opts ))
193
201
202
+ -- qqq
203
+ -- vim.notify("git.bcommits: " .. vim.inspect(git_command) .. ", " .. vim.inspect(opts), vim.log.levels.ERROR)
204
+ -- if U.is_msys2 then
205
+ -- opts.current_file = U.posix_to_windows(opts.current_file)
206
+ -- end
207
+ -- !qqq
208
+
194
209
local title = " Git BCommits"
195
210
local finder = finders .new_oneshot_job (
196
211
utils .flatten {
@@ -371,6 +386,18 @@ git.status = function(opts)
371
386
372
387
local args = { " status" , " --porcelain=v1" , " --" , " ." }
373
388
389
+ -- qqq
390
+ -- Running "nvim ."->":Telescope git_status" ends up with posix-style path.
391
+ -- UPD. It gets fixed in later invocations.
392
+ -- if opts.cwd:find("^/") then
393
+ -- if U.is_msys2 then
394
+ -- opts.cwd = U.posix_to_windows(opts.cwd)
395
+ -- end
396
+ -- --vim.notify("git.status: opts.cwd = " .. vim.inspect(opts.cwd), vim.log.levels.ERROR)
397
+ -- --error(debug.traceback())
398
+ -- end
399
+ -- !qqq
400
+
374
401
local gen_new_finder = function ()
375
402
if vim .F .if_nil (opts .expand_dir , true ) then
376
403
table.insert (args , # args - 1 , " -uall" )
@@ -404,6 +431,13 @@ git.status = function(opts)
404
431
end
405
432
end
406
433
434
+ -- qqq
435
+ -- If we have no changes and status is empty why git_status does not exit
436
+ -- with notification? Is it supposed to be like that, right?
437
+ -- On "v0.1.8" version I get notification and Telescope just exits as it should be.
438
+ -- vim.notify("git.status: self.finder = " .. vim.inspect(self.finder) .. ", count = " .. vim.inspect(count) .. ", prompt = " .. vim.inspect(prompt) , vim.log.levels.WARN)
439
+ -- !qqq
440
+
407
441
if count == 0 and prompt == " " then
408
442
utils .notify (" builtin.git_status" , {
409
443
msg = " No changes found" ,
@@ -479,6 +513,15 @@ local set_opts_cwd = function(opts)
479
513
opts .cwd = vim .loop .cwd ()
480
514
end
481
515
516
+ -- qqq
517
+ -- Running "nvim ."->":Telescope git_status" ends up with posix-style path
518
+ -- vim.notify("set_opts_cwd: opts = " .. vim.inspect(opts), vim.log.levels.ERROR)
519
+ -- error(debug.traceback())
520
+ if U .is_msys2 then
521
+ opts .cwd = U .posix_to_windows (opts .cwd )
522
+ end
523
+ -- !qqq
524
+
482
525
local toplevel , ret = utils .get_os_command_output ({ " git" , " rev-parse" , " --show-toplevel" }, opts .cwd )
483
526
484
527
if ret ~= 0 then
0 commit comments