From 3f1f5b7e5284b6c341429169e32161795def7e65 Mon Sep 17 00:00:00 2001 From: Brian Di Palma <1597820+briandipalma@users.noreply.github.com> Date: Sun, 12 Jun 2022 12:15:39 +0100 Subject: [PATCH] feat: add `--follow` to bcommits (#1997) Yes the diff to parent preview will be blank but at the very least a user can follow a file around various moves and get access to the SHA-ID for the move. --- lua/telescope/builtin/git.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/telescope/builtin/git.lua b/lua/telescope/builtin/git.lua index 74b7df9..71203bb 100644 --- a/lua/telescope/builtin/git.lua +++ b/lua/telescope/builtin/git.lua @@ -112,7 +112,10 @@ 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", "--pretty=oneline", "--abbrev-commit" }) + local git_command = vim.F.if_nil( + opts.git_command, + { "git", "log", "--pretty=oneline", "--abbrev-commit", "--follow" } + ) pickers.new(opts, { prompt_title = "Git BCommits",