diff --git a/lua/telescope/builtin/__git.lua b/lua/telescope/builtin/__git.lua index 866934f4ae..4b9a9f3fba 100644 --- a/lua/telescope/builtin/__git.lua +++ b/lua/telescope/builtin/__git.lua @@ -56,7 +56,7 @@ end git.commits = function(opts) opts.entry_maker = vim.F.if_nil(opts.entry_maker, make_entry.gen_from_git_commits(opts)) - local git_command = vim.F.if_nil(opts.git_command, { "git", "log", "--graph", "--oneline", "--decorate", "--", "." }) + local git_command = vim.F.if_nil(opts.git_command, { "git", "log", "--pretty=oneline", "--abbrev-commit", "--", "." }) pickers .new(opts, { @@ -115,7 +115,8 @@ git.bcommits = function(opts) opts.current_line = (opts.current_file == nil) and get_current_buf_line(opts.winnr) or nil opts.current_file = vim.F.if_nil(opts.current_file, vim.api.nvim_buf_get_name(opts.bufnr)) opts.entry_maker = vim.F.if_nil(opts.entry_maker, make_entry.gen_from_git_commits(opts)) - local git_command = vim.F.if_nil(opts.git_command, { "git", "log", "--graph", "--oneline", "--decorate", "--follow" }) + local git_command = + vim.F.if_nil(opts.git_command, { "git", "log", "--pretty=oneline", "--abbrev-commit", "--follow" }) pickers .new(opts, { diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 450ebee466..2276dd2e4d 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -430,27 +430,17 @@ function make_entry.gen_from_git_commits(opts) return nil end - local marker, sha, msg = string.match(entry, "([*\\/| ]+) +([0-9a-f]*) +(.*)") - - if not sha then - marker = entry - sha = "" - msg = "" - end + local sha, msg = string.match(entry, "([^ ]+) (.+)") if not msg then + sha = entry msg = "" end - marker, _ = string.gsub(marker, "\\", "+") - marker, _ = string.gsub(marker, "/", "-") - marker, _ = string.gsub(marker, "+", "/") - marker, _ = string.gsub(marker, "-", "\\") - return make_entry.set_default_entry_mt({ value = sha, - ordinal = marker .. " " .. sha .. " " .. msg, - msg = marker .. " " .. msg, + ordinal = sha .. " " .. msg, + msg = msg, display = make_display, current_file = opts.current_file, }, opts)