{"action":"created","issue":{"url":"https://api.github.com/repos/magit/magit/issues/2836","repository_url":"https://api.github.com/repos/magit/magit","labels_url":"https://api.github.com/repos/magit/magit/issues/2836/labels{/name}","comments_url":"https://api.github.com/repos/magit/magit/issues/2836/comments","events_url":"https://api.github.com/repos/magit/magit/issues/2836/events","html_url":"https://github.com/magit/magit/issues/2836","id":184678255,"number":2836,"title":"Blaming a deleted file in the history causes error","user":{"login":"xuhdev","id":325476,"avatar_url":"https://avatars.githubusercontent.com/u/325476?v=3","gravatar_id":"","url":"https://api.github.com/users/xuhdev","html_url":"https://github.com/xuhdev","followers_url":"https://api.github.com/users/xuhdev/followers","following_url":"https://api.github.com/users/xuhdev/following{/other_user}","gists_url":"https://api.github.com/users/xuhdev/gists{/gist_id}","starred_url":"https://api.github.com/users/xuhdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuhdev/subscriptions","organizations_url":"https://api.github.com/users/xuhdev/orgs","repos_url":"https://api.github.com/users/xuhdev/repos","events_url":"https://api.github.com/users/xuhdev/events{/privacy}","received_events_url":"https://api.github.com/users/xuhdev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-23T08:38:16Z","updated_at":"2016-10-23T11:38:41Z","closed_at":null,"body":"To reproduce:\r\n\r\n1. `mkdir tmp && cd tmp && git init`\r\n2. `echo \"a\\nb\" > README`\r\n3. `git add README && git commit -m \"First commit\"`\r\n4. `git rm README && git commit -m \"Second commit\"`\r\n5. `git checkout HEAD\\^ README`\r\n6. `emacs README`, then run `magit-blame`\r\n\r\nExpected:\r\n\r\n```\r\nfatal: no such path 'README' in HEAD\r\n```\r\n\r\nBut got the following error:\r\n\r\n```\r\nDebugger entered--Lisp error: (wrong-type-argument stringp nil)\r\n  string-to-number(nil)\r\n  (list :hash (let ((hash (match-string 1 line))) (if (equal hash (make-string 40 48)) nil hash)) :previous-start (string-to-number (match-string 2 line)) :start (string-to-number (match-string 3 line)) :lines (string-to-number (match-string 4 line)))\r\n  (setq chunk (list :hash (let ((hash (match-string 1 line))) (if (equal hash (make-string 40 48)) nil hash)) :previous-start (string-to-number (match-string 2 line)) :start (string-to-number (match-string 3 line)) :lines (string-to-number (match-string 4 line))))\r\n  (cond ((equal line \"\")) ((not chunk) (string-match \"^\\\\(.\\\\{40\\\\}\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\)\" line) (setq chunk (list :hash (let ((hash (match-string 1 line))) (if (equal hash (make-string 40 48)) nil hash)) :previous-start (string-to-number (match-string 2 line)) :start (string-to-number (match-string 3 line)) :lines (string-to-number (match-string 4 line))))) ((string-match \"^filename \\\\(.+\\\\)\" line) (let* ((hash (plist-get chunk :hash)) (file (match-string 1 line))) (let ((it (gethash hash magit-blame-cache))) (if it (setq chunk (nconc chunk it)) (plist-put chunk :filename file) (puthash hash chunk magit-blame-cache)))) (magit-blame-make-overlay chunk) (setq chunk nil)) ((string-match \"^previous \\\\(.\\\\{40\\\\}\\\\) \\\\(.+\\\\)\" line) (plist-put chunk :previous-hash (match-string 1 line)) (plist-put chunk :previous-file (match-string 2 line))) ((string-match \"^\\\\([^ ]+?-mail\\\\) <\\\\([^>]+\\\\)>\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+?-\\\\(?:time\\\\|tz\\\\)\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (match-string 2 line))))\r\n  (let ((line (car --dolist-tail--))) (cond ((equal line \"\")) ((not chunk) (string-match \"^\\\\(.\\\\{40\\\\}\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\)\" line) (setq chunk (list :hash (let ((hash ...)) (if (equal hash ...) nil hash)) :previous-start (string-to-number (match-string 2 line)) :start (string-to-number (match-string 3 line)) :lines (string-to-number (match-string 4 line))))) ((string-match \"^filename \\\\(.+\\\\)\" line) (let* ((hash (plist-get chunk :hash)) (file (match-string 1 line))) (let ((it (gethash hash magit-blame-cache))) (if it (setq chunk (nconc chunk it)) (plist-put chunk :filename file) (puthash hash chunk magit-blame-cache)))) (magit-blame-make-overlay chunk) (setq chunk nil)) ((string-match \"^previous \\\\(.\\\\{40\\\\}\\\\) \\\\(.+\\\\)\" line) (plist-put chunk :previous-hash (match-string 1 line)) (plist-put chunk :previous-file (match-string 2 line))) ((string-match \"^\\\\([^ ]+?-mail\\\\) <\\\\([^>]+\\\\)>\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+?-\\\\(?:time\\\\|tz\\\\)\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (match-string 2 line)))) (process-put process (quote chunk) chunk) (setq --dolist-tail-- (cdr --dolist-tail--)))\r\n  (while --dolist-tail-- (let ((line (car --dolist-tail--))) (cond ((equal line \"\")) ((not chunk) (string-match \"^\\\\(.\\\\{40\\\\}\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\)\" line) (setq chunk (list :hash (let (...) (if ... nil hash)) :previous-start (string-to-number (match-string 2 line)) :start (string-to-number (match-string 3 line)) :lines (string-to-number (match-string 4 line))))) ((string-match \"^filename \\\\(.+\\\\)\" line) (let* ((hash (plist-get chunk :hash)) (file (match-string 1 line))) (let ((it ...)) (if it (setq chunk ...) (plist-put chunk :filename file) (puthash hash chunk magit-blame-cache)))) (magit-blame-make-overlay chunk) (setq chunk nil)) ((string-match \"^previous \\\\(.\\\\{40\\\\}\\\\) \\\\(.+\\\\)\" line) (plist-put chunk :previous-hash (match-string 1 line)) (plist-put chunk :previous-file (match-string 2 line))) ((string-match \"^\\\\([^ ]+?-mail\\\\) <\\\\([^>]+\\\\)>\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+?-\\\\(?:time\\\\|tz\\\\)\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" (match-string 1 line))) (match-string 2 line)))) (process-put process (quote chunk) chunk) (setq --dolist-tail-- (cdr --dolist-tail--))))\r\n  (let ((--dolist-tail-- lines)) (while --dolist-tail-- (let ((line (car --dolist-tail--))) (cond ((equal line \"\")) ((not chunk) (string-match \"^\\\\(.\\\\{40\\\\}\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\)\" line) (setq chunk (list :hash (let ... ...) :previous-start (string-to-number ...) :start (string-to-number ...) :lines (string-to-number ...)))) ((string-match \"^filename \\\\(.+\\\\)\" line) (let* ((hash ...) (file ...)) (let (...) (if it ... ... ...))) (magit-blame-make-overlay chunk) (setq chunk nil)) ((string-match \"^previous \\\\(.\\\\{40\\\\}\\\\) \\\\(.+\\\\)\" line) (plist-put chunk :previous-hash (match-string 1 line)) (plist-put chunk :previous-file (match-string 2 line))) ((string-match \"^\\\\([^ ]+?-mail\\\\) <\\\\([^>]+\\\\)>\" line) (plist-put chunk (intern (concat \":\" ...)) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+?-\\\\(?:time\\\\|tz\\\\)\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" ...)) (string-to-number (match-string 2 line)))) ((string-match \"^\\\\([^ ]+\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern (concat \":\" ...)) (match-string 2 line)))) (process-put process (quote chunk) chunk) (setq --dolist-tail-- (cdr --dolist-tail--)))))\r\n  (let ((chunk (process-get process (quote chunk))) (lines (split-string string \"\\n\" t))) (if (string-match-p \"\\n\\\\'\" string) nil (process-put process (quote chunk) chunk) (process-put process (quote partial-line) (car (last lines))) (setq lines (butlast lines))) (let ((--dolist-tail-- lines)) (while --dolist-tail-- (let ((line (car --dolist-tail--))) (cond ((equal line \"\")) ((not chunk) (string-match \"^\\\\(.\\\\{40\\\\}\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\)\" line) (setq chunk (list :hash ... :previous-start ... :start ... :lines ...))) ((string-match \"^filename \\\\(.+\\\\)\" line) (let* (... ...) (let ... ...)) (magit-blame-make-overlay chunk) (setq chunk nil)) ((string-match \"^previous \\\\(.\\\\{40\\\\}\\\\) \\\\(.+\\\\)\" line) (plist-put chunk :previous-hash (match-string 1 line)) (plist-put chunk :previous-file (match-string 2 line))) ((string-match \"^\\\\([^ ]+?-mail\\\\) <\\\\([^>]+\\\\)>\" line) (plist-put chunk (intern ...) (string-to-number ...))) ((string-match \"^\\\\([^ ]+?-\\\\(?:time\\\\|tz\\\\)\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern ...) (string-to-number ...))) ((string-match \"^\\\\([^ ]+\\\\) \\\\(.+\\\\)\" line) (plist-put chunk (intern ...) (match-string 2 line)))) (process-put process (quote chunk) chunk) (setq --dolist-tail-- (cdr --dolist-tail--))))))\r\n  (progn (let ((chunk (process-get process (quote chunk))) (lines (split-string string \"\\n\" t))) (if (string-match-p \"\\n\\\\'\" string) nil (process-put process (quote chunk) chunk) (process-put process (quote partial-line) (car (last lines))) (setq lines (butlast lines))) (let ((--dolist-tail-- lines)) (while --dolist-tail-- (let ((line (car --dolist-tail--))) (cond ((equal line \"\")) ((not chunk) (string-match \"^\\\\(.\\\\{40\\\\}\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\) \\\\([0-9]+\\\\)\" line) (setq chunk ...)) ((string-match \"^filename \\\\(.+\\\\)\" line) (let* ... ...) (magit-blame-make-overlay chunk) (setq chunk nil)) ((string-match \"^previous \\\\(.\\\\{40\\\\}\\\\) \\\\(.+\\\\)\" line) (plist-put chunk :previous-hash ...) (plist-put chunk :previous-file ...)) ((string-match \"^\\\\([^ ]+?-mail\\\\) <\\\\([^>]+\\\\)>\" line) (plist-put chunk ... ...)) ((string-match \"^\\\\([^ ]+?-\\\\(?:time\\\\|tz\\\\)\\\\) \\\\(.+\\\\)\" line) (plist-put chunk ... ...)) ((string-match \"^\\\\([^ ]+\\\\) \\\\(.+\\\\)\" line) (plist-put chunk ... ...))) (process-put process (quote chunk) chunk) (setq --dolist-tail-- (cdr --dolist-tail--)))))))\r\n  (if magit-blame-mode (progn (let ((chunk (process-get process (quote chunk))) (lines (split-string string \"\\n\" t))) (if (string-match-p \"\\n\\\\'\" string) nil (process-put process (quote chunk) chunk) (process-put process (quote partial-line) (car (last lines))) (setq lines (butlast lines))) (let ((--dolist-tail-- lines)) (while --dolist-tail-- (let ((line ...)) (cond (...) (... ... ...) (... ... ... ...) (... ... ...) (... ...) (... ...) (... ...)) (process-put process (quote chunk) chunk) (setq --dolist-tail-- (cdr --dolist-tail--))))))))\r\n  (save-current-buffer (set-buffer (process-get process (quote command-buf))) (if magit-blame-mode (progn (let ((chunk (process-get process (quote chunk))) (lines (split-string string \"\\n\" t))) (if (string-match-p \"\\n\\\\'\" string) nil (process-put process (quote chunk) chunk) (process-put process (quote partial-line) (car (last lines))) (setq lines (butlast lines))) (let ((--dolist-tail-- lines)) (while --dolist-tail-- (let (...) (cond ... ... ... ... ... ... ...) (process-put process ... chunk) (setq --dolist-tail-- ...))))))))\r\n  magit-blame-process-filter(#<process git> \"fatal: no such path 'README' in HEAD\\n\")\r\n  read-event(nil t 2)\r\n  sit-for(2)\r\n  execute-extended-command(nil \"magit-blame\" \"magit-bla\")\r\n  funcall-interactively(execute-extended-command nil \"magit-blame\" \"magit-bla\")\r\n  call-interactively(execute-extended-command nil nil)\r\n  command-execute(execute-extended-command)\r\n```"},"comment":{"url":"https://api.github.com/repos/magit/magit/issues/comments/255583787","html_url":"https://github.com/magit/magit/issues/2836#issuecomment-255583787","issue_url":"https://api.github.com/repos/magit/magit/issues/2836","id":255583787,"user":{"login":"tarsius","id":25046,"avatar_url":"https://avatars.githubusercontent.com/u/25046?v=3","gravatar_id":"","url":"https://api.github.com/users/tarsius","html_url":"https://github.com/tarsius","followers_url":"https://api.github.com/users/tarsius/followers","following_url":"https://api.github.com/users/tarsius/following{/other_user}","gists_url":"https://api.github.com/users/tarsius/gists{/gist_id}","starred_url":"https://api.github.com/users/tarsius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarsius/subscriptions","organizations_url":"https://api.github.com/users/tarsius/orgs","repos_url":"https://api.github.com/users/tarsius/repos","events_url":"https://api.github.com/users/tarsius/events{/privacy}","received_events_url":"https://api.github.com/users/tarsius/received_events","type":"User","site_admin":false},"created_at":"2016-10-23T11:38:41Z","updated_at":"2016-10-23T11:38:41Z","body":"Ah, with an *empty* file I can reproduce this."}}
{"actor":{"display_login":"tarsius"}}