Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden questions #71

Merged
merged 4 commits into from
Nov 18, 2014
Merged

Hidden questions #71

merged 4 commits into from
Nov 18, 2014

Conversation

Malabarba
Copy link
Collaborator

Hit "h" to hide a question.

@vermiculus
Copy link
Owner

Looks good except for a couple notes.

  • list-questions will not work unless you are authenticated.
  • Looking at Jonathon's answer to this question will yield the stack trace that follows. For some reason, "URL: %s, %s to visit" is resolving to nil. (?) Doesn't make any sense to me, but perhaps you've seen something like this before. It seems to only happen when displaying a link (as opposed to a link: www.example.com).

Hiding functionality works without a hitch.

I'm not sure the above is your fault (I don't think it is), but I'm putting it down as a reminder to myself to run the same test on master.

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  propertize(nil face default)
  (format (propertize "URL: %s, %s to visit" (quote face) (quote minibuffer-prompt)) (propertize url (quote face) (quote default)) (propertize "RET" (quote face) (quote font-lock-function-name-face)))
  (propertize text (quote help-echo) (format (propertize "URL: %s, %s to visit" (quote face) (quote minibuffer-prompt)) (propertize url (quote face) (quote default)) (propertize "RET" (quote face) (quote font-lock-function-name-face))) (quote url) url (quote face) (quote link) (quote mouse-face) (quote highlight) (quote button) t (quote follow-link) t (quote action) (function sx-question-mode-follow-link))
  sx-question-mode--propertize-link("keychain" nil)
  (replace-match (sx-question-mode--propertize-link (if sx-question-mode-pretty-links text (match-string-no-properties 0)) url) :fixedcase :literal nil 0)
  (let* ((text (match-string-no-properties 1)) (url (or (match-string-no-properties 2) (sx-question-mode-find-reference (match-string-no-properties 3) text)))) (replace-match (sx-question-mode--propertize-link (if sx-question-mode-pretty-links text (match-string-no-properties 0)) url) :fixedcase :literal nil 0))
  (while (search-forward-regexp sx-question-mode--link-regexp nil t) (let* ((text (match-string-no-properties 1)) (url (or (match-string-no-properties 2) (sx-question-mode-find-reference (match-string-no-properties 3) text)))) (replace-match (sx-question-mode--propertize-link (if sx-question-mode-pretty-links text (match-string-no-properties 0)) url) :fixedcase :literal nil 0)))
  (save-excursion (goto-char (point-min)) (while (search-forward-regexp sx-question-mode--link-regexp nil t) (let* ((text (match-string-no-properties 1)) (url (or (match-string-no-properties 2) (sx-question-mode-find-reference (match-string-no-properties 3) text)))) (replace-match (sx-question-mode--propertize-link (if sx-question-mode-pretty-links text (match-string-no-properties 0)) url) :fixedcase :literal nil 0))))
  sx-question-mode--process-links-in-buffer()
  (progn (erase-buffer) (insert text) (markdown-mode) (font-lock-mode -1) (if sx-question-mode-bullet-appearance (progn (font-lock-add-keywords nil (list (cons "^[[:blank:]]*\\(?1:[-*+]\\)[[:blank:]]" (cons 1 (cons ... ...))))))) (font-lock-add-keywords nil (list (cons "\\(?:[[:blank:]]\\|^\\)\\(?1:@\\(?:\\sw\\|\\s_\\)+\\)\\_>" (quote (1 font-lock-builtin-face))))) (font-lock-fontify-region (point-min) (point-max)) (sx-question-mode--process-links-in-buffer) (goto-char (point-min)) (while (null (eobp)) (if (sx-question-mode--move-over-pre) nil (skip-chars-forward "
\n[:blank:]") (fill-paragraph) (forward-paragraph))) (buffer-string))
  (unwind-protect (progn (erase-buffer) (insert text) (markdown-mode) (font-lock-mode -1) (if sx-question-mode-bullet-appearance (progn (font-lock-add-keywords nil (list (cons "^[[:blank:]]*\\(?1:[-*+]\\)[[:blank:]]" (cons 1 ...)))))) (font-lock-add-keywords nil (list (cons "\\(?:[[:blank:]]\\|^\\)\\(?1:@\\(?:\\sw\\|\\s_\\)+\\)\\_>" (quote (1 font-lock-builtin-face))))) (font-lock-fontify-region (point-min) (point-max)) (sx-question-mode--process-links-in-buffer) (goto-char (point-min)) (while (null (eobp)) (if (sx-question-mode--move-over-pre) nil (skip-chars-forward "
\n[:blank:]") (fill-paragraph) (forward-paragraph))) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (erase-buffer) (insert text) (markdown-mode) (font-lock-mode -1) (if sx-question-mode-bullet-appearance (progn (font-lock-add-keywords nil (list (cons "^[[:blank:]]*\\(?1:[-*+]\\)[[:blank:]]" ...))))) (font-lock-add-keywords nil (list (cons "\\(?:[[:blank:]]\\|^\\)\\(?1:@\\(?:\\sw\\|\\s_\\)+\\)\\_>" (quote (1 font-lock-builtin-face))))) (font-lock-fontify-region (point-min) (point-max)) (sx-question-mode--process-links-in-buffer) (goto-char (point-min)) (while (null (eobp)) (if (sx-question-mode--move-over-pre) nil (skip-chars-forward "
\n[:blank:]") (fill-paragraph) (forward-paragraph))) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (erase-buffer) (insert text) (markdown-mode) (font-lock-mode -1) (if sx-question-mode-bullet-appearance (progn (font-lock-add-keywords nil (list ...)))) (font-lock-add-keywords nil (list (cons "\\(?:[[:blank:]]\\|^\\)\\(?1:@\\(?:\\sw\\|\\s_\\)+\\)\\_>" (quote ...)))) (font-lock-fontify-region (point-min) (point-max)) (sx-question-mode--process-links-in-buffer) (goto-char (point-min)) (while (null (eobp)) (if (sx-question-mode--move-over-pre) nil (skip-chars-forward "
\n[:blank:]") (fill-paragraph) (forward-paragraph))) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  sx-question-mode--fill-and-fontify("If you already have Cygwin installed you can use [keychain][keychain] and [keychain-environment][key-env] to manage your keys.\n\nUse the shell of your choice to launch keychain, then\n\n    (require 'keychain-environment)\n    (keychain-refresh-environment)\n\nto ensure the keys are loaded into Emacs.\n\n [keychain]:http://www.funtoo.org/Keychain\n [key-env]:http://www.emacswiki.org/emacs/keychain-environment.el")
  (insert "\n" (sx-question-mode--fill-and-fontify \.body_markdown) (propertize sx-question-mode-separator (quote face) (quote sx-question-mode-header)))
  (progn (insert "\n" (sx-question-mode--fill-and-fontify \.body_markdown) (propertize sx-question-mode-separator (quote face) (quote sx-question-mode-header))))
  (let ((p (point-marker)) (result (progn (insert "\n" (sx-question-mode--fill-and-fontify \.body_markdown) (propertize sx-question-mode-separator (quote face) (quote sx-question-mode-header)))))) (let ((ov (make-overlay p (point))) (props (quote (face sx-question-mode-content-face)))) (while props (overlay-put ov (car (prog1 props (setq props (cdr props)))) (car (prog1 props (setq props (cdr props)))))) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result)
  (progn (sx-question-mode--insert-header sx-question-mode-header-author (sx-question-mode--propertize-display-name \.owner) (quote sx-question-mode-author) sx-question-mode-header-date (concat (sx-time-seconds-to-date \.creation_date) (if \.last_edit_date (progn (format sx-question-mode-last-edit-format (sx-time-since \.last_edit_date) (sx-question-mode--propertize-display-name \.last_editor))))) (quote sx-question-mode-date)) (if \.title (progn (sx-question-mode--insert-header sx-question-mode-header-tags (mapconcat (function sx-question--tag-format) \.tags " ") (quote sx-question-mode-tags)))) (insert "\n" (propertize sx-question-mode-separator (quote face) (quote sx-question-mode-header) (quote sx-question-mode--section) 4)) (let ((p (point-marker)) (result (progn (insert "\n" (sx-question-mode--fill-and-fontify \.body_markdown) (propertize sx-question-mode-separator (quote face) (quote sx-question-mode-header)))))) (let ((ov (make-overlay p (point))) (props (quote (face sx-question-mode-content-face)))) (while props (overlay-put ov (car (prog1 props (setq props ...))) (car (prog1 props (setq props ...))))) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result))
  (let ((p (point-marker)) (result (progn (sx-question-mode--insert-header sx-question-mode-header-author (sx-question-mode--propertize-display-name \.owner) (quote sx-question-mode-author) sx-question-mode-header-date (concat (sx-time-seconds-to-date \.creation_date) (if \.last_edit_date (progn ...))) (quote sx-question-mode-date)) (if \.title (progn (sx-question-mode--insert-header sx-question-mode-header-tags (mapconcat ... \.tags " ") (quote sx-question-mode-tags)))) (insert "\n" (propertize sx-question-mode-separator (quote face) (quote sx-question-mode-header) (quote sx-question-mode--section) 4)) (let ((p (point-marker)) (result (progn ...))) (let ((ov ...) (props ...)) (while props (overlay-put ov ... ...)) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result)))) (let ((ov (make-overlay p (point))) (props (quote (sx-question-mode--section-content t)))) (while props (overlay-put ov (car (prog1 props (setq props (cdr props)))) (car (prog1 props (setq props (cdr props)))))) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result)
  (let ((\.title (cdr (assoc (quote title) data))) (\.owner (cdr (assoc (quote owner) data))) (\.creation_date (cdr (assoc (quote creation_date) data))) (\.last_edit_date (cdr (assoc (quote last_edit_date) data))) (\.last_editor (cdr (assoc (quote last_editor) data))) (\.tags (cdr (assoc (quote tags) data))) (\.body_markdown (cdr (assoc (quote body_markdown) data))) (\.comments (cdr (assoc (quote comments) data)))) (insert sx-question-mode-header-title (apply (function propertize) (or \.title sx-question-mode-answer-title) (quote sx-question-mode--section) (if \.title 1 2) sx-question-mode--title-properties)) (let ((p (point-marker)) (result (progn (sx-question-mode--insert-header sx-question-mode-header-author (sx-question-mode--propertize-display-name \.owner) (quote sx-question-mode-author) sx-question-mode-header-date (concat (sx-time-seconds-to-date \.creation_date) (if \.last_edit_date ...)) (quote sx-question-mode-date)) (if \.title (progn (sx-question-mode--insert-header sx-question-mode-header-tags ... ...))) (insert "\n" (propertize sx-question-mode-separator (quote face) (quote sx-question-mode-header) (quote sx-question-mode--section) 4)) (let ((p ...) (result ...)) (let (... ...) (while props ...) (setq sx-question-mode--overlays ...)) result)))) (let ((ov (make-overlay p (point))) (props (quote (sx-question-mode--section-content t)))) (while props (overlay-put ov (car (prog1 props (setq props ...))) (car (prog1 props (setq props ...))))) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result) (if \.comments (progn (insert "\n" (apply (function propertize) sx-question-mode-comments-title (quote face) (quote sx-question-mode-title-comments) (quote sx-question-mode--section) 3 sx-question-mode--title-properties)) (let ((p (point-marker)) (result (progn (insert "\n") (let ... ... result)))) (let ((ov (make-overlay p ...)) (props (quote ...))) (while props (overlay-put ov (car ...) (car ...))) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result))))
  (progn (let ((\.title (cdr (assoc (quote title) data))) (\.owner (cdr (assoc (quote owner) data))) (\.creation_date (cdr (assoc (quote creation_date) data))) (\.last_edit_date (cdr (assoc (quote last_edit_date) data))) (\.last_editor (cdr (assoc (quote last_editor) data))) (\.tags (cdr (assoc (quote tags) data))) (\.body_markdown (cdr (assoc (quote body_markdown) data))) (\.comments (cdr (assoc (quote comments) data)))) (insert sx-question-mode-header-title (apply (function propertize) (or \.title sx-question-mode-answer-title) (quote sx-question-mode--section) (if \.title 1 2) sx-question-mode--title-properties)) (let ((p (point-marker)) (result (progn (sx-question-mode--insert-header sx-question-mode-header-author (sx-question-mode--propertize-display-name \.owner) (quote sx-question-mode-author) sx-question-mode-header-date (concat ... ...) (quote sx-question-mode-date)) (if \.title (progn ...)) (insert "\n" (propertize sx-question-mode-separator ... ... ... 4)) (let (... ...) (let ... ... ...) result)))) (let ((ov (make-overlay p (point))) (props (quote (sx-question-mode--section-content t)))) (while props (overlay-put ov (car (prog1 props ...)) (car (prog1 props ...)))) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result) (if \.comments (progn (insert "\n" (apply (function propertize) sx-question-mode-comments-title (quote face) (quote sx-question-mode-title-comments) (quote sx-question-mode--section) 3 sx-question-mode--title-properties)) (let ((p (point-marker)) (result (progn ... ...))) (let ((ov ...) (props ...)) (while props (overlay-put ov ... ...)) (setq sx-question-mode--overlays (cons ov sx-question-mode--overlays))) result)))))
  (let ((p (point-marker)) (result (progn (let ((\.title (cdr ...)) (\.owner (cdr ...)) (\.creation_date (cdr ...)) (\.last_edit_date (cdr ...)) (\.last_editor (cdr ...)) (\.tags (cdr ...)) (\.body_markdown (cdr ...)) (\.comments (cdr ...))) (insert sx-question-mode-header-title (apply (function propertize) (or \.title sx-question-mode-answer-title) (quote sx-question-mode--section) (if \.title 1 2) sx-question-mode--title-properties)) (let ((p ...) (result ...)) (let (... ...) (while props ...) (setq sx-question-mode--overlays ...)) result) (if \.comments (progn (insert "\n" ...) (let ... ... result))))))) (add-text-properties p (point) (list (quote sx-question-mode--data-here) data)) result)
  sx-question-mode--print-section(((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/543#543") (body_markdown . "If you already have Cygwin installed you can use [keychain][keychain] and [keychain-environment][key-env] to manage your keys.\n\nUse the shell of your choice to launch keychain, then\n\n    (require 'keychain-environment)\n    (keychain-refresh-environment)\n\nto ensure the keys are loaded into Emacs.\n\n [keychain]:http://www.funtoo.org/Keychain\n [key-env]:http://www.emacswiki.org/emacs/keychain-environment.el") (question_id . 478) (answer_id . 543) (creation_date . 1412163813) (last_activity_date . 1412163813) (score . 0) (is_accepted . :json-false) (comments . [((body . "Hmmm. I tried this, and nothing really changed. The <code>magit-push</code> command hung just like it always does.") (body_markdown . "Hmmm. I tried this, and nothing really changed. The `magit-push` command hung just like it always does.") (comment_id . 3729) (post_id . 543) (creation_date . 1414445082) (score . 0) (edited . :json-false) (owner (link . "http://emacs.stackexchange.com/users/35/ryan") (display_name . "Ryan") (accept_rate . 75) (user_type . "registered") (user_id . 35) (reputation . 435)))]) (owner (link . "http://emacs.stackexchange.com/users/337/jonathan-leech-pepin") (display_name . "Jonathan Leech-Pepin") (user_type . "moderator") (user_id . 337) (reputation . 1250))))
  mapc(sx-question-mode--print-section [((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/486#486") (body_markdown . "Usually, the problem is that Emacs can't access the password prompt of git on Windows. Thus, it seems to \"hang\" on push, where it really is waiting for your password. You can circumvent this by using an ssh key instead of a username/password in your git repo, and doing the first push manually in the shell (git will remember your ssh password after the first push).") (question_id . 478) (answer_id . 486) (creation_date . 1412062236) (last_activity_date . 1412062236) (score . 4) (community_owned_date . 1412062236) (is_accepted . :json-false) (comments . [((body . "The Git bash shell doesn't seem to be remembering my ssh password, so more pushes are just seeing the same thing.") (body_markdown . "The Git bash shell doesn't seem to be remembering my ssh password, so more pushes are just seeing the same thing.") (comment_id . 783) (post_id . 486) (creation_date . 1412119030) (score . 1) (edited . :json-false) (owner (link . "http://emacs.stackexchange.com/users/35/ryan") (display_name . "Ryan") (accept_rate . 75) (user_type . "registered") (user_id . 35) (reputation . 435)))]) (owner (link . "http://emacs.stackexchange.com/users/80/bastibe") (display_name . "bastibe") (user_type . "registered") (user_id . 80) (reputation . 236))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/530#530") (body_markdown . "I never figured out how to fix this with just MSYS Git and Emacs, but here's seamless workaround.\n\nAdd [Git Credential Winstore](https://gitcredentialstore.codeplex.com/) to your $PATH.  Git-Credential-Winstore will use the Windows keychain to manage your passwords for you and Magit will happily push to remote repositories.\n\nIn your `.gitconfig` file, set the following:\n\n    [credential]\n            helper = \"winstore\"\n\nThis works because the [Git Credential Docs](http://git-scm.com/docs/gitcredentials) state that \"if the helper name is not an absolute path, then the string git credential- is prepended.\" I prefer this approach.\n\nAlternately, you can simply run git-credential-winstore.exe and it will install itself to your AppData folder and fill in your `.gitconfig` file with a hardcoded path to it's location.  After running it, your `.gitconfig` will look like this:\n\n    [credential]\n            helper = !\"c:\\\\Users\\Joe\\\\\\AppData\\\\Roaming\\\\GitCredStore\\\\git-credential-winstore.exe\"\n\nThe exclamation point instructs Git to treat the string as an absolute path.\n\n") (question_id . 478) (answer_id . 530) (creation_date . 1412114170) (last_edit_date . 1412204780) (last_activity_date . 1412204780) (score . 0) (is_accepted . :json-false) (last_editor (link . "http://emacs.stackexchange.com/users/256/joes") (display_name . "JoeS") (user_type . "registered") (user_id . 256) (reputation . 119)) (owner (link . "http://emacs.stackexchange.com/users/256/joes") (display_name . "JoeS") (user_type . "registered") (user_id . 256) (reputation . 119))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/543#543") (body_markdown . "If you already have Cygwin installed you can use [keychain][keychain] and [keychain-environment][key-env] to manage your keys.\n\nUse the shell of your choice to launch keychain, then\n\n    (require 'keychain-environment)\n    (keychain-refresh-environment)\n\nto ensure the keys are loaded into Emacs.\n\n [keychain]:http://www.funtoo.org/Keychain\n [key-env]:http://www.emacswiki.org/emacs/keychain-environment.el") (question_id . 478) (answer_id . 543) (creation_date . 1412163813) (last_activity_date . 1412163813) (score . 0) (is_accepted . :json-false) (comments . [((body . "Hmmm. I tried this, and nothing really changed. The <code>magit-push</code> command hung just like it always does.") (body_markdown . "Hmmm. I tried this, and nothing really changed. The `magit-push` command hung just like it always does.") (comment_id . 3729) (post_id . 543) (creation_date . 1414445082) (score . 0) (edited . :json-false) (owner (link . "http://emacs.stackexchange.com/users/35/ryan") (display_name . "Ryan") (accept_rate . 75) (user_type . "registered") (user_id . 35) (reputation . 435)))]) (owner (link . "http://emacs.stackexchange.com/users/337/jonathan-leech-pepin") (display_name . "Jonathan Leech-Pepin") (user_type . "moderator") (user_id . 337) (reputation . 1250))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3662#3662") (body_markdown . "If you haven't already done so, I would recommend using SSH instead of HTTP as many have recommended to me during my investigation of this.  That said, I was able to resolve this issue using the below FAQ:\n\nhttps://github.com/magit/magit/wiki/FAQ#windows-cannot-push-with-ssh-passphrase\n\nThe missing component (from Github's Git Bash .bashrc script) is that it doesn't handle ssh-agent startup for interfaces such as the Windows command line or emacs.  Following the above steps initiates ssh-agent upon emacs startup.  Note, you will have to start Git Bash and enter your SSH passphrase upon starting/restarting your machine.\n") (question_id . 478) (answer_id . 3662) (creation_date . 1416249575) (last_edit_date . 1416322721) (last_activity_date . 1416322721) (score . 1) (is_accepted . :json-false) (last_editor (link . "http://emacs.stackexchange.com/users/598/patternmatching") (display_name . "PatternMatching") (user_type . "registered") (user_id . 598) (reputation . 11)) (owner (link . "http://emacs.stackexchange.com/users/598/patternmatching") (display_name . "PatternMatching") (user_type . "registered") (user_id . 598) (reputation . 11))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3664#3664") (body_markdown . "As @bastibe pointed, Magit is probably waiting for a password input and just hangs in there...\n\nI recall the following working when I was forced to used Windows :-). I don't recall the exact command name, also make sure that the `exec-path` contains `c:/Program Files (x86)/Git/bin/`.\n\n    (setenv \"GIT_ASKPASS\" \"git-gui--askpass\")") (question_id . 478) (answer_id . 3664) (creation_date . 1416254220) (last_activity_date . 1416254220) (score . 0) (is_accepted . :json-false) (owner (link . "http://emacs.stackexchange.com/users/943/rimero") (display_name . "rimero") (user_type . "registered") (user_id . 943) (reputation . 211))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3668#3668") (body_markdown . "I too have experience this behavior for a while, and until today haven't gotten around to really trying to fix it. I did so by placed the following in my init-file:\n\n    (setenv \"GIT_SSH\" \"C:/Path/to/PuTTY/plink.exe\")\n\nI also tested this by opening up a clean Emacs (`emacs -Q`), loading `magit`, and evaluating that line, and it worked.\n\nThis works with `Pageant`, so there is no need to mess with `ssh-agent`.") (question_id . 478) (answer_id . 3668) (creation_date . 1416265783) (last_activity_date . 1416265783) (score . 0) (is_accepted . :json-false) (owner (link . "http://emacs.stackexchange.com/users/675/scott-weldon") (display_name . "Scott Weldon") (user_type . "registered") (user_id . 675) (reputation . 165)))])
  (let ((\.answers (cdr (assoc (quote answers) question)))) (mapc (function sx-question-mode--print-section) \.answers))
  sx-question-mode--print-question(((site . "emacs") (title . "magit-push hangs on Windows") (link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows") (body_markdown . "I'm using GNU Emacs on Windows, and I am unable to use `magit-push` to push my local changes to a remote repository. This happens with remote repositories regardless of if they are accessed with SSH or HTTPS. What do I need to do to make `magit-push` work on Windows as seamlessly (or at least nearly so) as it does on my Linux machines?\n\nAll I see in the `*Messages*` buffer is\n\n    Running c:/Program Files (x86)/Git/bin/git.exe push -v origin master:refs/heads/master\n\nThe same shows in the `*magit-process*` buffer, more or less. Nothing more useful. I am able to git push from the command line, but it does ask for my ssh key's password. Might that be the problem? I've tried loading the key with Pageant (PuTTY's key agent), but that didn't seem to make a difference.\n\nIf it's helpful, I have Cygwin installed, and would be happy with a solution that involved forcing Emacs to use Cygwin's executables.") (question_id . 478) (last_edit_date . 1412165371) (creation_date . 1412034996) (last_activity_date . 1416322721) (score . 7) (answer_count . 6) (view_count . 107) (is_answered . t) (last_editor (link . "http://emacs.stackexchange.com/users/25/gilles") (display_name . "Gilles") (user_type . "registered") (user_id . 25) (reputation . 2913)) (owner (link . "http://emacs.stackexchange.com/users/35/ryan") (display_name . "Ryan") (accept_rate . 75) (user_type . "registered") (user_id . 35) (reputation . 435)) (tags . ["magit" "microsoft-windows" "git" "ssh"]) (answers . [((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/486#486") (body_markdown . "Usually, the problem is that Emacs can't access the password prompt of git on Windows. Thus, it seems to \"hang\" on push, where it really is waiting for your password. You can circumvent this by using an ssh key instead of a username/password in your git repo, and doing the first push manually in the shell (git will remember your ssh password after the first push).") (question_id . 478) (answer_id . 486) (creation_date . 1412062236) (last_activity_date . 1412062236) (score . 4) (community_owned_date . 1412062236) (is_accepted . :json-false) (comments . [((body . "The Git bash shell doesn't seem to be remembering my ssh password, so more pushes are just seeing the same thing.") (body_markdown . "The Git bash shell doesn't seem to be remembering my ssh password, so more pushes are just seeing the same thing.") (comment_id . 783) (post_id . 486) (creation_date . 1412119030) (score . 1) (edited . :json-false) (owner ... ... ... ... ... ...))]) (owner (link . "http://emacs.stackexchange.com/users/80/bastibe") (display_name . "bastibe") (user_type . "registered") (user_id . 80) (reputation . 236))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/530#530") (body_markdown . "I never figured out how to fix this with just MSYS Git and Emacs, but here's seamless workaround.\n\nAdd [Git Credential Winstore](https://gitcredentialstore.codeplex.com/) to your $PATH.  Git-Credential-Winstore will use the Windows keychain to manage your passwords for you and Magit will happily push to remote repositories.\n\nIn your `.gitconfig` file, set the following:\n\n    [credential]\n            helper = \"winstore\"\n\nThis works because the [Git Credential Docs](http://git-scm.com/docs/gitcredentials) state that \"if the helper name is not an absolute path, then the string git credential- is prepended.\" I prefer this approach.\n\nAlternately, you can simply run git-credential-winstore.exe and it will install itself to your AppData folder and fill in your `.gitconfig` file with a hardcoded path to it's location.  After running it, your `.gitconfig` will look like this:\n\n    [credential]\n            helper = !\"c:\\\\Users\\Joe\\\\\\AppData\\\\Roaming\\\\GitCredStore\\\\git-credential-winstore.exe\"\n\nThe exclamation point instructs Git to treat the string as an absolute path.\n\n") (question_id . 478) (answer_id . 530) (creation_date . 1412114170) (last_edit_date . 1412204780) (last_activity_date . 1412204780) (score . 0) (is_accepted . :json-false) (last_editor (link . "http://emacs.stackexchange.com/users/256/joes") (display_name . "JoeS") (user_type . "registered") (user_id . 256) (reputation . 119)) (owner (link . "http://emacs.stackexchange.com/users/256/joes") (display_name . "JoeS") (user_type . "registered") (user_id . 256) (reputation . 119))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/543#543") (body_markdown . "If you already have Cygwin installed you can use [keychain][keychain] and [keychain-environment][key-env] to manage your keys.\n\nUse the shell of your choice to launch keychain, then\n\n    (require 'keychain-environment)\n    (keychain-refresh-environment)\n\nto ensure the keys are loaded into Emacs.\n\n [keychain]:http://www.funtoo.org/Keychain\n [key-env]:http://www.emacswiki.org/emacs/keychain-environment.el") (question_id . 478) (answer_id . 543) (creation_date . 1412163813) (last_activity_date . 1412163813) (score . 0) (is_accepted . :json-false) (comments . [((body . "Hmmm. I tried this, and nothing really changed. The <code>magit-push</code> command hung just like it always does.") (body_markdown . "Hmmm. I tried this, and nothing really changed. The `magit-push` command hung just like it always does.") (comment_id . 3729) (post_id . 543) (creation_date . 1414445082) (score . 0) (edited . :json-false) (owner ... ... ... ... ... ...))]) (owner (link . "http://emacs.stackexchange.com/users/337/jonathan-leech-pepin") (display_name . "Jonathan Leech-Pepin") (user_type . "moderator") (user_id . 337) (reputation . 1250))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3662#3662") (body_markdown . "If you haven't already done so, I would recommend using SSH instead of HTTP as many have recommended to me during my investigation of this.  That said, I was able to resolve this issue using the below FAQ:\n\nhttps://github.com/magit/magit/wiki/FAQ#windows-cannot-push-with-ssh-passphrase\n\nThe missing component (from Github's Git Bash .bashrc script) is that it doesn't handle ssh-agent startup for interfaces such as the Windows command line or emacs.  Following the above steps initiates ssh-agent upon emacs startup.  Note, you will have to start Git Bash and enter your SSH passphrase upon starting/restarting your machine.\n") (question_id . 478) (answer_id . 3662) (creation_date . 1416249575) (last_edit_date . 1416322721) (last_activity_date . 1416322721) (score . 1) (is_accepted . :json-false) (last_editor (link . "http://emacs.stackexchange.com/users/598/patternmatching") (display_name . "PatternMatching") (user_type . "registered") (user_id . 598) (reputation . 11)) (owner (link . "http://emacs.stackexchange.com/users/598/patternmatching") (display_name . "PatternMatching") (user_type . "registered") (user_id . 598) (reputation . 11))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3664#3664") (body_markdown . "As @bastibe pointed, Magit is probably waiting for a password input and just hangs in there...\n\nI recall the following working when I was forced to used Windows :-). I don't recall the exact command name, also make sure that the `exec-path` contains `c:/Program Files (x86)/Git/bin/`.\n\n    (setenv \"GIT_ASKPASS\" \"git-gui--askpass\")") (question_id . 478) (answer_id . 3664) (creation_date . 1416254220) (last_activity_date . 1416254220) (score . 0) (is_accepted . :json-false) (owner (link . "http://emacs.stackexchange.com/users/943/rimero") (display_name . "rimero") (user_type . "registered") (user_id . 943) (reputation . 211))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3668#3668") (body_markdown . "I too have experience this behavior for a while, and until today haven't gotten around to really trying to fix it. I did so by placed the following in my init-file:\n\n    (setenv \"GIT_SSH\" \"C:/Path/to/PuTTY/plink.exe\")\n\nI also tested this by opening up a clean Emacs (`emacs -Q`), loading `magit`, and evaluating that line, and it worked.\n\nThis works with `Pageant`, so there is no need to mess with `ssh-agent`.") (question_id . 478) (answer_id . 3668) (creation_date . 1416265783) (last_activity_date . 1416265783) (score . 0) (is_accepted . :json-false) (owner (link . "http://emacs.stackexchange.com/users/675/scott-weldon") (display_name . "Scott Weldon") (user_type . "registered") (user_id . 675) (reputation . 165)))])))
  (save-current-buffer (set-buffer (sx-question-mode--display-buffer window)) (erase-buffer) (sx-question-mode) (sx-question-mode--print-question data) (current-buffer))
  (let ((inhibit-read-only t)) (save-current-buffer (set-buffer (sx-question-mode--display-buffer window)) (erase-buffer) (sx-question-mode) (sx-question-mode--print-question data) (current-buffer)))
  sx-question-mode--display(((site . "emacs") (title . "magit-push hangs on Windows") (link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows") (body_markdown . "I'm using GNU Emacs on Windows, and I am unable to use `magit-push` to push my local changes to a remote repository. This happens with remote repositories regardless of if they are accessed with SSH or HTTPS. What do I need to do to make `magit-push` work on Windows as seamlessly (or at least nearly so) as it does on my Linux machines?\n\nAll I see in the `*Messages*` buffer is\n\n    Running c:/Program Files (x86)/Git/bin/git.exe push -v origin master:refs/heads/master\n\nThe same shows in the `*magit-process*` buffer, more or less. Nothing more useful. I am able to git push from the command line, but it does ask for my ssh key's password. Might that be the problem? I've tried loading the key with Pageant (PuTTY's key agent), but that didn't seem to make a difference.\n\nIf it's helpful, I have Cygwin installed, and would be happy with a solution that involved forcing Emacs to use Cygwin's executables.") (question_id . 478) (last_edit_date . 1412165371) (creation_date . 1412034996) (last_activity_date . 1416322721) (score . 7) (answer_count . 6) (view_count . 107) (is_answered . t) (last_editor (link . "http://emacs.stackexchange.com/users/25/gilles") (display_name . "Gilles") (user_type . "registered") (user_id . 25) (reputation . 2913)) (owner (link . "http://emacs.stackexchange.com/users/35/ryan") (display_name . "Ryan") (accept_rate . 75) (user_type . "registered") (user_id . 35) (reputation . 435)) (tags . ["magit" "microsoft-windows" "git" "ssh"]) (answers . [((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/486#486") (body_markdown . "Usually, the problem is that Emacs can't access the password prompt of git on Windows. Thus, it seems to \"hang\" on push, where it really is waiting for your password. You can circumvent this by using an ssh key instead of a username/password in your git repo, and doing the first push manually in the shell (git will remember your ssh password after the first push).") (question_id . 478) (answer_id . 486) (creation_date . 1412062236) (last_activity_date . 1412062236) (score . 4) (community_owned_date . 1412062236) (is_accepted . :json-false) (comments . [((body . "The Git bash shell doesn't seem to be remembering my ssh password, so more pushes are just seeing the same thing.") (body_markdown . "The Git bash shell doesn't seem to be remembering my ssh password, so more pushes are just seeing the same thing.") (comment_id . 783) (post_id . 486) (creation_date . 1412119030) (score . 1) (edited . :json-false) (owner ... ... ... ... ... ...))]) (owner (link . "http://emacs.stackexchange.com/users/80/bastibe") (display_name . "bastibe") (user_type . "registered") (user_id . 80) (reputation . 236))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/530#530") (body_markdown . "I never figured out how to fix this with just MSYS Git and Emacs, but here's seamless workaround.\n\nAdd [Git Credential Winstore](https://gitcredentialstore.codeplex.com/) to your $PATH.  Git-Credential-Winstore will use the Windows keychain to manage your passwords for you and Magit will happily push to remote repositories.\n\nIn your `.gitconfig` file, set the following:\n\n    [credential]\n            helper = \"winstore\"\n\nThis works because the [Git Credential Docs](http://git-scm.com/docs/gitcredentials) state that \"if the helper name is not an absolute path, then the string git credential- is prepended.\" I prefer this approach.\n\nAlternately, you can simply run git-credential-winstore.exe and it will install itself to your AppData folder and fill in your `.gitconfig` file with a hardcoded path to it's location.  After running it, your `.gitconfig` will look like this:\n\n    [credential]\n            helper = !\"c:\\\\Users\\Joe\\\\\\AppData\\\\Roaming\\\\GitCredStore\\\\git-credential-winstore.exe\"\n\nThe exclamation point instructs Git to treat the string as an absolute path.\n\n") (question_id . 478) (answer_id . 530) (creation_date . 1412114170) (last_edit_date . 1412204780) (last_activity_date . 1412204780) (score . 0) (is_accepted . :json-false) (last_editor (link . "http://emacs.stackexchange.com/users/256/joes") (display_name . "JoeS") (user_type . "registered") (user_id . 256) (reputation . 119)) (owner (link . "http://emacs.stackexchange.com/users/256/joes") (display_name . "JoeS") (user_type . "registered") (user_id . 256) (reputation . 119))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/543#543") (body_markdown . "If you already have Cygwin installed you can use [keychain][keychain] and [keychain-environment][key-env] to manage your keys.\n\nUse the shell of your choice to launch keychain, then\n\n    (require 'keychain-environment)\n    (keychain-refresh-environment)\n\nto ensure the keys are loaded into Emacs.\n\n [keychain]:http://www.funtoo.org/Keychain\n [key-env]:http://www.emacswiki.org/emacs/keychain-environment.el") (question_id . 478) (answer_id . 543) (creation_date . 1412163813) (last_activity_date . 1412163813) (score . 0) (is_accepted . :json-false) (comments . [((body . "Hmmm. I tried this, and nothing really changed. The <code>magit-push</code> command hung just like it always does.") (body_markdown . "Hmmm. I tried this, and nothing really changed. The `magit-push` command hung just like it always does.") (comment_id . 3729) (post_id . 543) (creation_date . 1414445082) (score . 0) (edited . :json-false) (owner ... ... ... ... ... ...))]) (owner (link . "http://emacs.stackexchange.com/users/337/jonathan-leech-pepin") (display_name . "Jonathan Leech-Pepin") (user_type . "moderator") (user_id . 337) (reputation . 1250))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3662#3662") (body_markdown . "If you haven't already done so, I would recommend using SSH instead of HTTP as many have recommended to me during my investigation of this.  That said, I was able to resolve this issue using the below FAQ:\n\nhttps://github.com/magit/magit/wiki/FAQ#windows-cannot-push-with-ssh-passphrase\n\nThe missing component (from Github's Git Bash .bashrc script) is that it doesn't handle ssh-agent startup for interfaces such as the Windows command line or emacs.  Following the above steps initiates ssh-agent upon emacs startup.  Note, you will have to start Git Bash and enter your SSH passphrase upon starting/restarting your machine.\n") (question_id . 478) (answer_id . 3662) (creation_date . 1416249575) (last_edit_date . 1416322721) (last_activity_date . 1416322721) (score . 1) (is_accepted . :json-false) (last_editor (link . "http://emacs.stackexchange.com/users/598/patternmatching") (display_name . "PatternMatching") (user_type . "registered") (user_id . 598) (reputation . 11)) (owner (link . "http://emacs.stackexchange.com/users/598/patternmatching") (display_name . "PatternMatching") (user_type . "registered") (user_id . 598) (reputation . 11))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3664#3664") (body_markdown . "As @bastibe pointed, Magit is probably waiting for a password input and just hangs in there...\n\nI recall the following working when I was forced to used Windows :-). I don't recall the exact command name, also make sure that the `exec-path` contains `c:/Program Files (x86)/Git/bin/`.\n\n    (setenv \"GIT_ASKPASS\" \"git-gui--askpass\")") (question_id . 478) (answer_id . 3664) (creation_date . 1416254220) (last_activity_date . 1416254220) (score . 0) (is_accepted . :json-false) (owner (link . "http://emacs.stackexchange.com/users/943/rimero") (display_name . "rimero") (user_type . "registered") (user_id . 943) (reputation . 211))) ((link . "http://emacs.stackexchange.com/questions/478/magit-push-hangs-on-windows/3668#3668") (body_markdown . "I too have experience this behavior for a while, and until today haven't gotten around to really trying to fix it. I did so by placed the following in my init-file:\n\n    (setenv \"GIT_SSH\" \"C:/Path/to/PuTTY/plink.exe\")\n\nI also tested this by opening up a clean Emacs (`emacs -Q`), loading `magit`, and evaluating that line, and it worked.\n\nThis works with `Pageant`, so there is no need to mess with `ssh-agent`.") (question_id . 478) (answer_id . 3668) (creation_date . 1416265783) (last_activity_date . 1416265783) (score . 0) (is_accepted . :json-false) (owner (link . "http://emacs.stackexchange.com/users/675/scott-weldon") (display_name . "Scott Weldon") (user_type . "registered") (user_id . 675) (reputation . 165)))])) #<window 24 on *stack-question*>)
  sx-question-list-display-question()
  sx-question-list-view-next(1)
  call-interactively(sx-question-list-view-next nil nil)

@Malabarba
Copy link
Collaborator Author

No, it looks like it's the url variable that's nil, when it should be a string.
I thought I had put all safeguards in place to avoid that. Obviously I missed something.

Let's open a separate issue for that though. It has nothing to do with this commit.

@Malabarba
Copy link
Collaborator Author

Fixed

@vermiculus
Copy link
Owner

Since there are many more applications that would be impacted by "the ability to change behavior depending on authenticated/unauthenticated state", I'm good with merging this. We'll have to come back to this point, though, so I'm opening #75.

vermiculus added a commit that referenced this pull request Nov 18, 2014
@vermiculus vermiculus merged commit 821bf63 into master Nov 18, 2014
@vermiculus vermiculus deleted the hidden-questions branch November 26, 2014 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants