pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.28k stars 125 forks source link

Is there a way to increase the timeout for a git push command ? like in configurations... #375

Closed Sanix-Darker closed 1 year ago

Sanix-Darker commented 1 year ago

Issue Description

Type: bug report

Describe what happened (or what feature you want)

When am trying to create a new Pull Request, and because I have to provide a key-pass-phrase, am getting this error while trying to push :

Pushing 'xxxx' to 'origin:xxxx' ...
Error executing Lua callback: ...dk/.config/nvim/plugged/plenary.nvim/lua/plenary/job.lua:499: 'git push origin xxxx:xxxx' was unable to complete in 5000 ms
stack traceback:
        [C]: in function 'error'
        ...dk/.config/nvim/plugged/plenary.nvim/lua/plenary/job.lua:499: in function 'wait'
        ...dk/.config/nvim/plugged/plenary.nvim/lua/plenary/job.lua:453: in function 'sync'
        .../dk/.config/nvim/plugged/octo.nvim/lua/octo/commands.lua:806: in function 'create_pr'
        .../dk/.config/nvim/plugged/octo.nvim/lua/octo/commands.lua:93: in function 'a'
        .../dk/.config/nvim/plugged/octo.nvim/lua/octo/commands.lua:356: in function 'octo'
        .../dk/.config/nvim/plugged/octo.nvim/lua/octo/commands.lua:16: in function <.../dk/.config/nvim/plugged/octo.nvim/lua/octo/commands.lua:15>

I guess, it's because the timeout is too short ?

Describe what you expected to happen

Maybe a big timeout ? Or a way to increase that timing in configuration ? 🤔

How to reproduce it (as minimally and precisely as possible)

  1. SetUp a git profile with ssh and keys protected with a key pass phrase
  2. inside a new repo, try to create a new Pull Request

Tell us your environment

Am on ubuntu, with nvim nightly :

NVIM v0.9.0-dev-974+g631775c05
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wno-unused-result -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -DNVIM_UNIBI_HAS_VAR_FROM -I/__w/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/build/src/nvim/auto -I/__w/neovim/neovim/build/include -I/__w/neovim/neovim/build/cmake.config -I/__w/neovim/neovim/src -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/.deps/usr/include
Compiled by root@a2476459f125

Features: +acl +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

and the last version of octo.nvim

Anything else we need to know?

I really like this project, and if possible I will want to contribute to this bug/fixmelio... ? with some suggestions 😬

pwntester commented 1 year ago

Thanks for the report and offering your help. The timeout is indeed hardcoded here. You can add a new config option in the config file and then use it from file-entry.lua. eg:

local config = require "octo.config"
local conf = config.get_config()
-- use the config option
-- eg: `conf.timeout`

Dont forget to document the option in the README and assign it 5000 as the default

Thanks!