NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
3.92k stars 231 forks source link

Cherry picking errors #644

Open timsofteng opened 1 year ago

timsofteng commented 1 year ago

Description

I'm trying to figure out how to do cherry picking with neogit but I get a lot of errors. I press A twice and then choose commit with enter. and I see a lot of errors on the screen

Снимок экрана 2023-07-19 в 15 32 29

Here is the log

  1 git cherry-pick --ff 6b0115591773b248f80e95137aea0a8c8e789b82                                                                                                (38.000 ms) [stderr 7]
  | The previous cherry-pick is now empty, possibly due to conflict resolution.
  | If you wish to commit it anyway, use:
  |
  |     git commit --allow-empty
  |
  | Otherwise, please use 'git cherry-pick --skip'
  |

Neovim version

NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3

Operating system and version

macOS 13.4.1 (22F82)

Steps to reproduce

Open repo Press A twice Press enter on the commit

Expected behavior

No response

Actual behavior

Cherry picking doesn't work or I don't understand how does it work.

Minimal config

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])
local package_root = "/tmp/nvim/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
  require("packer").startup({
    {
      "wbthomason/packer.nvim",
      {
        "TimUntersberger/neogit",
        requires = {
          { "nvim-lua/plenary.nvim" },
          { "sindrets/diffview.nvim" },
        },
        config = function()
          print("loaded neogit")
          require("neogit").setup()
        end,
      },
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. "/plugin/packer_compiled.lua",
      display = { non_interactive = true },
    },
  })
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing neogit and dependencies.")
  vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
require("packer").sync()
CKolkey commented 1 year ago

The status buffer doesnt auto-refresh (yet) - if you hit c-r does the conflict show up?

CKolkey commented 1 year ago

Check out if https://github.com/NeogitOrg/neogit/pull/614 has a better UX

timsofteng commented 1 year ago

@CKolkey btw is it possible to select several commits?

CKolkey commented 1 year ago

Yea, linewise visual mode on the commits

ten3roberts commented 1 year ago

I got an error "unexpected type \<table>" when doing that on master (before help popup merge :P)

image
timsofteng commented 1 year ago

Yea, linewise visual mode on the commits

How to do it properly? Still don't understand sorry. I switch mode to visual but it doesn't help to pick up multiple commits.

ten3roberts commented 1 year ago

Try V

timsofteng commented 1 year ago

V just activate visual mode and then I cannot do cherry picking. I press enter and it do what it do in common vim's visual mode.

CKolkey commented 1 year ago

Might be a bug if you can't, but that's how it should work to cherry pick multiple commits. Is this from the log buffer or the status buffer?

timsofteng commented 1 year ago

@CKolkey I'll open another issue with video cause it is out of scope

timsofteng commented 1 year ago

The issue still exists on latest master. I see a lot of error and have no idea how to do cherry pick.

CKolkey commented 1 year ago

If you run the same command from the terminal, does it produce the same error?