magit / forge

Work with Git forges from the comfort of Magit
GNU General Public License v3.0
1.31k stars 116 forks source link

wrong number of arguments with forge-pull #622

Closed Davidbrcz closed 8 months ago

Davidbrcz commented 8 months ago

Hello

I work with a self hosted gitlab forge (everything has been working great for the last 3 years). This week, forge-pull yields an error, and nothing gets pulled

The full backstrace

Debugger entered--Lisp error: (wrong-number-of-arguments (2 . 2) 3)
  #f(compiled-function (repo until) #<bytecode -0x1bb2c74a080dc971>)(#<forge-gitlab-repository forge-gitlab-repository-1573de735a08> nil nil)
  apply(#f(compiled-function (repo until) #<bytecode -0x1bb2c74a080dc971>) #<forge-gitlab-repository forge-gitlab-repository-1573de735a08> (nil nil))
  forge--pull(#<forge-gitlab-repository forge-gitlab-repository-1573de735a08> nil nil)
  forge-pull(nil nil t)
  funcall-interactively(forge-pull nil nil t)
  command-execute(forge-pull record)
  counsel-M-x-action("forge-pull")
  ivy-call()
  ivy-read("M-x " [haskell-interactive-previous-buffer lsp-erlang-ls-server-start-fun vc-src-responsible-p eshell-insert-buffer-name nexti lsp-pwsh-help-completion Set\ Slice el-name python-nav-beginning-of-defun-regexp vc-sccs-log-view-mode-hook fg-added L-RE-COUNT treemacs-dom-node->set-position! yas-x-prompt gnus-article-nndoc-name SHORTCUT hs-hide-comments-when-hiding-all cl-struct-flycheck-syntax-check-tags gnus-mime-security-details-buffer gnus-agent-group-covered-p beg-of-line ef-themes--load-theme eshell-return-exits-minibuffer C-i treemacs--button-symbol-switch nnoo-map-functions gnus-try-warping-via-registry kotlin-language-server ⋱\ \\ddots-8 mu4e-cited-7-face aya-marker-one-line register-list-edit-value-mode-abbrev-table lsp-elixir-suggest-specs xref--push-markers vc-bzr-shelve-menu WatchKind proced-memory-high-usage nnimap-status-message gnus-summary-limit-to-marks org-agenda-menu-show-matcher nnmail-message-id-cache-file :project-root article-fill-long-lines smime-buffer-as-string-region dashboard-mode diredfl-symlink APP hydra-rectangle/keymap bibtex-text-in-string posframe-poshandler-frame-bottom-left-corner ...] :predicate #f(compiled-function (sym) #<bytecode 0x105a2554ec4f001c>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  command-execute(counsel-M-x)

Tried to recompiled .emacs.d and to remove it altogether to get a fresh install of packages. error still there.

Magit version 20240125.1835 Forge version 20240127.1100

Thanks !

PS: Love magit & forge, awesome work.

dduenker commented 8 months ago

I am getting the same error, also using a self hosted GitLab.

jamadden commented 8 months ago

A quick fix is to add &optional callback to the forge--pull definition in forge-gitlab.el, i.e.:

(cl-defmethod forge--pull ((repo forge-gitlab-repository) until
                           &optional callback)

It isn't actually calling the callback, which was added in https://github.com/magit/forge/commit/02cd2836c6cf603ce50c6c204471bfb77fc45f1e , apparently to speed up refreshing in some cases, so I don't know if this breaks anything else.

The optional callback argument was added to the GitHub integration in https://github.com/magit/forge/commit/896a934f622ee8bcaf88dabcc08d085cdccc6482 , way back in 2019, but it didn't make it to the Gitlab integration.

It's unblocked me (so far) but YMMV.

tarsius commented 8 months ago

@jamadden Thanks for digging up the relevant commits.

dduenker commented 8 months ago

Thanks @tarsius and @jamadden, it is working again. :)