rejeep / git.el

An Elisp API for programmatically using Git
41 stars 5 forks source link

Can't clone repo #1

Open nlamirault opened 10 years ago

nlamirault commented 10 years ago

We can't clone a repository :

ELISP> (require 'git)
git
ELISP> (git-clone "https://github.com/rejeep/git.el" "/tmp/")
*** Eval error ***  Wrong type argument: stringp, nil

Evaluate this :

(git-clone "https://github.com/rejeep/git.el.git" "/tmp/")
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil nil)
  f-expand(nil)
  f-long(nil)
  f-full(nil)
  git-run("clone" "https://github.com/rejeep/git.el.git" "/tmp/")
  git-clone("https://github.com/rejeep/git.el.git" "/tmp/")
  eval((git-clone "https://github.com/rejeep/git.el.git" "/tmp/") nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)
rejeep commented 10 years ago

Can you run M-x toggle-debug-on-error first and then try the above again.

nlamirault commented 10 years ago

git-repo seems nil

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil nil)
  f-expand(nil)
  f-long(nil)
  f-full(nil)
  (let ((default-directory (f-full git-repo))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((exit-code ...)) (if (zerop exit-code) (buffer-string) (git-error "Error running command: %s %s\n%s" git-executable ... ...)))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  git-run("clone" "https://github.com/rejeep/git.el.git" "/tmp/")
  git-clone("https://github.com/rejeep/git.el.git" "/tmp/")
  eval((git-clone "https://github.com/rejeep/git.el.git" "/tmp/") nil)
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)
rejeep commented 10 years ago

Yes, perhaps this works better (I guess both should work)?

(let ((git-repo "/tmp/"))
  (git-clone "https://github.com/rejeep/git.el"))
nlamirault commented 10 years ago

OK. Thanks it works.

rejeep commented 10 years ago

I still think it should work the way you did it, so let's leave this issue open as a reminder.

K0HAX commented 8 years ago

I just ran into this as well.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  expand-file-name(nil nil)
  f-expand(nil)
  f-long(nil)
  f-full(nil)
  git-run("clone" "https://github.com/pschorf/helm-spotify.git" "~/.emacs.d/git/helm-spotify")
  git-clone("https://github.com/pschorf/helm-spotify.git" "~/.emacs.d/git/helm-spotify")
  eval-region(14452 14539)  ; Reading at buffer position 14452
  call-interactively(eval-region record nil)
  command-execute(eval-region record)
  execute-extended-command(nil "eval-region")
  smex-read-and-run(("eval-region" "magit-status" "helm-info" "buffer-menu" "my-open-calendar" "org-caldav-sync" "org-agenda" "comment-region" "ansi-term" "start-irc" "multi-term" "eval-expression" "uncomment-region" "sql-mysql" "eval-buffer" "load-library" "rename-buffer" "gnus" "twit" "org-todo" "web-mode" "todo-show" "make-frame" "message-tab" "log-edit-done" "org-todo-list" "remember-notes" "package-list-packages" "indent-new-comment-line" "cd" "5x5" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "w3m" "xdb" "bbdb" ...))
  smex()
  call-interactively(smex nil nil)
  command-execute(smex)
K0HAX commented 8 years ago

I fixed it with this.

(if (git-repo? "~/.emacs.d/git/helm-spotify")
    (progn
      (add-to-list 'load-path "~/.emacs.d/git/helm-spotify")
      (load "helm-spotify"))
  (progn
    (let ((git-repo "~/.emacs.d/git/"))
      (git-clone "https://github.com/pschorf/helm-spotify.git"))
    (add-to-list 'load-path "~/.emacs.d/git/helm-spotify")
    (load "helm-spotify")))