{"thread":{"id":"20835","subject":"[PATCH] git.el: Use git-add-file for unmerged files, remove git-resolve-file","startedAt":"2009-09-03T20:27:24Z","lastAt":"2009-09-09T19:10:43Z","messageCount":6,"participants":["Martin Nordholts","Alexandre Julliard","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"122368","messageId":"4AA026AC.10907@gmail.com","threadId":"20835","inReplyTo":null,"subject":"[PATCH] git.el: Use git-add-file for unmerged files, remove git-resolve-file","fromName":"Martin Nordholts","fromEmail":"enselic@gmail.com","sentAt":"2009-09-03T20:27:24Z","receivedAt":"2009-09-03T20:27:24Z","isPatch":true,"sender":{"key":"enselic@gmail.com","avatar":"https://gravatar.com/avatar/74df556deac89f8da8c185cdbf811d51d7205eb48770305e84d7c1435755510e?d=mp&s=160"},"body":"Use `git-add-file' to mark unmerged files as resolved in the\n*git-status* buffer to be consistent with git's CLI instructions. Also\nremove `git-resolve-file' to make it clear that that \"R\" is a now a\nfree keybinding.\n\nSigned-off-by: Martin Nordholts <martinn@src.gnome.org>\n---\n contrib/emacs/git.el |   13 +------------\n 1 files changed, 1 insertions(+), 12 deletions(-)\n\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex 8c70ad8..214930a 100644\n--- a/contrib/emacs/git.el\n+++ b/contrib/emacs/git.el\n@@ -1046,7 +1046,7 @@ The FILES list must be sorted.\"\n (defun git-add-file ()\n   \"Add marked file(s) to the index cache.\"\n   (interactive)\n-  (let ((files (git-get-filenames (git-marked-files-state 'unknown 'ignored))))\n+  (let ((files (git-get-filenames (git-marked-files-state 'unknown 'ignored 'unmerged))))\n     ;; FIXME: add support for directories\n     (unless files\n       (push (file-relative-name (read-file-name \"File to add: \" nil nil t)) files))\n@@ -1119,15 +1119,6 @@ The FILES list must be sorted.\"\n               (when buffer (with-current-buffer buffer (revert-buffer t t t)))))\n           (git-success-message \"Reverted\" names))))))\n \n-(defun git-resolve-file ()\n-  \"Resolve conflicts in marked file(s).\"\n-  (interactive)\n-  (let ((files (git-get-filenames (git-marked-files-state 'unmerged))))\n-    (when files\n-      (when (apply 'git-call-process-display-error \"update-index\" \"--\" files)\n-        (git-update-status-files files)\n-        (git-success-message \"Resolved\" files)))))\n-\n (defun git-remove-handled ()\n   \"Remove handled files from the status list.\"\n   (interactive)\n@@ -1556,7 +1547,6 @@ amended version of it.\"\n     (define-key map \"P\"   'git-prev-unmerged-file)\n     (define-key map \"q\"   'git-status-quit)\n     (define-key map \"r\"   'git-remove-file)\n-    (define-key map \"R\"   'git-resolve-file)\n     (define-key map \"t\"    toggle-map)\n     (define-key map \"T\"   'git-toggle-all-marks)\n     (define-key map \"u\"   'git-unmark-file)\n@@ -1598,7 +1588,6 @@ amended version of it.\"\n       (\"Merge\"\n \t[\"Next Unmerged File\" git-next-unmerged-file t]\n \t[\"Prev Unmerged File\" git-prev-unmerged-file t]\n-\t[\"Mark as Resolved\" git-resolve-file t]\n \t[\"Interactive Merge File\" git-find-file-imerge t]\n \t[\"Diff Against Common Base File\" git-diff-file-base t]\n \t[\"Diff Combined\" git-diff-file-combined t]\n-- \n1.6.2.5\n"},{"id":"122716","messageId":"873a6x9t0l.fsf@wine.dyndns.org","threadId":"20835","inReplyTo":"4AA026AC.10907@gmail.com","subject":"Re: [PATCH] git.el: Use git-add-file for unmerged files, remove git-resolve-file","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2009-09-08T18:43:38Z","receivedAt":"2009-09-08T18:43:38Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Martin Nordholts <enselic@gmail.com> writes:\n\n> Use `git-add-file' to mark unmerged files as resolved in the\n> *git-status* buffer to be consistent with git's CLI instructions. Also\n> remove `git-resolve-file' to make it clear that that \"R\" is a now a\n> free keybinding.\n>\n> Signed-off-by: Martin Nordholts <martinn@src.gnome.org>\n\nLooks good, thanks.\n\nAcked-by: Alexandre Julliard <julliard@winehq.org>\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"},{"id":"122728","messageId":"7vhbvdxj49.fsf@alter.siamese.dyndns.org","threadId":"20835","inReplyTo":"873a6x9t0l.fsf@wine.dyndns.org","subject":"Re: [PATCH] git.el: Use git-add-file for unmerged files, remove git-resolve-file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-09-08T20:43:34Z","receivedAt":"2009-09-08T20:43:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexandre Julliard <julliard@winehq.org> writes:\n\n> Martin Nordholts <enselic@gmail.com> writes:\n>\n>> Use `git-add-file' to mark unmerged files as resolved in the\n>> *git-status* buffer to be consistent with git's CLI instructions. Also\n>> remove `git-resolve-file' to make it clear that that \"R\" is a now a\n>> free keybinding.\n>>\n>> Signed-off-by: Martin Nordholts <martinn@src.gnome.org>\n>\n> Looks good, thanks.\n>\n> Acked-by: Alexandre Julliard <julliard@winehq.org>\n\nThanks, both.\n"},{"id":"122743","messageId":"7vtyzdrq1h.fsf@alter.siamese.dyndns.org","threadId":"20835","inReplyTo":"4AA026AC.10907@gmail.com","subject":"Re: [PATCH] git.el: Use git-add-file for unmerged files, remove git-resolve-file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-09-08T23:10:34Z","receivedAt":"2009-09-08T23:10:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Martin Nordholts <enselic@gmail.com> writes:\n\n> Use `git-add-file' to mark unmerged files as resolved in the\n> *git-status* buffer to be consistent with git's CLI instructions. Also\n> remove `git-resolve-file' to make it clear that that \"R\" is a now a\n> free keybinding.\n\nI do not know all the details of how Emacs keybinding works, but I had an\nimpression that something-x sequence is triggered if you type something-X\nand you do not have an explicit binding for something-X but you do have a\nbinding for something-x.\n\nIOW, if I only have\n\n\t(define-key global-map \"\\C-xc\" 'compile)\n\nthen both \"\\C-xc\" and \"\\C-xC\" runs \"compile\", but in addition to the\nabove if I also have\n\n\t(define-key global-map \"\\C-xC\" 'grep-find)\n\nthen I can invoke these two commands with lower- and upper- case 'c/C'\nafter control-x.\n\nIf people have been relying on the historical behaviour that typing \"R\"\nmarked the path resolved (which may internally have been implemented with\nwhatever way), and if you are removing that binding, wouldn't that now\nexpose them to whatever happens to be bound to \"r\"?\n\nAnd worse, it is bound to git-remove-file.  Shouldn't you at least rebind\nthe \"R\" to something safer, like beep?\n\nAm I grossly misunderstanding how Emacs keybindings work?  Is the\nexperiment I did in the initial part of the message with the global-map\nrelying on some \"magic\" that only appears in global-map, and there is no\nproblem doing this in the map this patch is about?\n\n> Signed-off-by: Martin Nordholts <martinn@src.gnome.org>\n> Acked-by: Alexandre Julliard <julliard@winehq.org>\n> ---\n>  contrib/emacs/git.el |   13 +------------\n>  1 files changed, 1 insertions(+), 12 deletions(-)\n>\n> diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\n> index 8c70ad8..214930a 100644\n> --- a/contrib/emacs/git.el\n> +++ b/contrib/emacs/git.el\n> @@ -1046,7 +1046,7 @@ The FILES list must be sorted.\"\n>  (defun git-add-file ()\n>    \"Add marked file(s) to the index cache.\"\n>    (interactive)\n> -  (let ((files (git-get-filenames (git-marked-files-state 'unknown 'ignored))))\n> +  (let ((files (git-get-filenames (git-marked-files-state 'unknown 'ignored 'unmerged))))\n>      ;; FIXME: add support for directories\n>      (unless files\n>        (push (file-relative-name (read-file-name \"File to add: \" nil nil t)) files))\n> @@ -1119,15 +1119,6 @@ The FILES list must be sorted.\"\n>                (when buffer (with-current-buffer buffer (revert-buffer t t t)))))\n>            (git-success-message \"Reverted\" names))))))\n>  \n> -(defun git-resolve-file ()\n> -  \"Resolve conflicts in marked file(s).\"\n> -  (interactive)\n> -  (let ((files (git-get-filenames (git-marked-files-state 'unmerged))))\n> -    (when files\n> -      (when (apply 'git-call-process-display-error \"update-index\" \"--\" files)\n> -        (git-update-status-files files)\n> -        (git-success-message \"Resolved\" files)))))\n> -\n>  (defun git-remove-handled ()\n>    \"Remove handled files from the status list.\"\n>    (interactive)\n> @@ -1556,7 +1547,6 @@ amended version of it.\"\n>      (define-key map \"P\"   'git-prev-unmerged-file)\n>      (define-key map \"q\"   'git-status-quit)\n>      (define-key map \"r\"   'git-remove-file)\n> -    (define-key map \"R\"   'git-resolve-file)\n>      (define-key map \"t\"    toggle-map)\n>      (define-key map \"T\"   'git-toggle-all-marks)\n>      (define-key map \"u\"   'git-unmark-file)\n> @@ -1598,7 +1588,6 @@ amended version of it.\"\n>        (\"Merge\"\n>  \t[\"Next Unmerged File\" git-next-unmerged-file t]\n>  \t[\"Prev Unmerged File\" git-prev-unmerged-file t]\n> -\t[\"Mark as Resolved\" git-resolve-file t]\n>  \t[\"Interactive Merge File\" git-find-file-imerge t]\n>  \t[\"Diff Against Common Base File\" git-diff-file-base t]\n>  \t[\"Diff Combined\" git-diff-file-combined t]\n> -- \n> 1.6.2.5\n"},{"id":"122767","messageId":"87ocpk6qwe.fsf@wine.dyndns.org","threadId":"20835","inReplyTo":"7vtyzdrq1h.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] git.el: Use git-add-file for unmerged files, remove git-resolve-file","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2009-09-09T16:09:53Z","receivedAt":"2009-09-09T16:09:53Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I do not know all the details of how Emacs keybinding works, but I had an\n> impression that something-x sequence is triggered if you type something-X\n> and you do not have an explicit binding for something-X but you do have a\n> binding for something-x.\n>\n> IOW, if I only have\n>\n> \t(define-key global-map \"\\C-xc\" 'compile)\n>\n> then both \"\\C-xc\" and \"\\C-xC\" runs \"compile\", but in addition to the\n> above if I also have\n>\n> \t(define-key global-map \"\\C-xC\" 'grep-find)\n>\n> then I can invoke these two commands with lower- and upper- case 'c/C'\n> after control-x.\n>\n> If people have been relying on the historical behaviour that typing \"R\"\n> marked the path resolved (which may internally have been implemented with\n> whatever way), and if you are removing that binding, wouldn't that now\n> expose them to whatever happens to be bound to \"r\"?\n\nNo, I don't claim to understand exactly how that works for the C-x case,\nbut it doesn't apply here, \"r\" and \"R\" are two different bindings.\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"},{"id":"122773","messageId":"7vhbvcszm4.fsf@alter.siamese.dyndns.org","threadId":"20835","inReplyTo":"87ocpk6qwe.fsf@wine.dyndns.org","subject":"Re: [PATCH] git.el: Use git-add-file for unmerged files, remove git-resolve-file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-09-09T19:10:43Z","receivedAt":"2009-09-09T19:10:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexandre Julliard <julliard@winehq.org> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> I do not know all the details of how Emacs keybinding works, but I had an\n>> impression that something-x sequence is triggered if you type something-X\n>> and you do not have an explicit binding for something-X but you do have a\n>> binding for something-x.\n>>\n>> IOW, if I only have\n>>\n>> \t(define-key global-map \"\\C-xc\" 'compile)\n>>\n>> then both \"\\C-xc\" and \"\\C-xC\" runs \"compile\", but in addition to the\n>> above if I also have\n>>\n>> \t(define-key global-map \"\\C-xC\" 'grep-find)\n>>\n>> then I can invoke these two commands with lower- and upper- case 'c/C'\n>> after control-x.\n>>\n>> If people have been relying on the historical behaviour that typing \"R\"\n>> marked the path resolved (which may internally have been implemented with\n>> whatever way), and if you are removing that binding, wouldn't that now\n>> expose them to whatever happens to be bound to \"r\"?\n>\n> No, I don't claim to understand exactly how that works for the C-x case,\n> but it doesn't apply here, \"r\" and \"R\" are two different bindings.\n\nThanks.  I just wanted to make sure that a user who is used to typing \"R\"\nwon't get the file removed with the new code.\n"}]}