{"thread":{"id":"20791","subject":"[PATCH] git.el: Make it easy to add unmerged files","startedAt":"2009-08-30T14:55:48Z","lastAt":"2009-09-02T08:48:52Z","messageCount":4,"participants":["Martin Nordholts","Alexandre Julliard"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"122117","messageId":"4A9A92F4.2090209@chromecode.com","threadId":"20791","inReplyTo":null,"subject":"[PATCH] git.el: Make it easy to add unmerged files","fromName":"Martin Nordholts","fromEmail":"martin@chromecode.com","sentAt":"2009-08-30T14:55:48Z","receivedAt":"2009-08-30T14:55:48Z","isPatch":true,"sender":{"key":"martin@chromecode.com","avatar":null},"body":"(Resending as I managed to mangle the previous patch despite trying not to...)\n\nIt is nice and easy to git-add ignored and unknown files in a\ngit-status buffer. Make it equally easy to add unmerged files which is\na common use case.\n\nSigned-off-by: Martin Nordholts <martinn@src.gnome.org>\n---\n contrib/emacs/git.el |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/emacs/git.el b/contrib/emacs/git.el\nindex 8c70ad8..3af5d00 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-- \n1.6.2.5\n"},{"id":"122118","messageId":"87ws4l47k2.fsf@wine.dyndns.org","threadId":"20791","inReplyTo":"4A9A92F4.2090209@chromecode.com","subject":"Re: [PATCH] git.el: Make it easy to add unmerged files","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2009-08-30T15:58:53Z","receivedAt":"2009-08-30T15:58:53Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Martin Nordholts <martin@chromecode.com> writes:\n\n> (Resending as I managed to mangle the previous patch despite trying not to...)\n>\n> It is nice and easy to git-add ignored and unknown files in a\n> git-status buffer. Make it equally easy to add unmerged files which is\n> a common use case.\n\nThat's not quite what adding a file means in git.el, unmerged files are\nconsidered added already, and marking them resolved is done through the\ngit-resolve-file command. Of course that was implemented before git\noverloaded the meaning of git-add to mean git-update-index, so maybe we\nshould follow the trend and use git-add-file for all index updates. In\nthat case git-resolve-file should probably be removed.\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"},{"id":"122288","messageId":"4A9E0717.9040801@chromecode.com","threadId":"20791","inReplyTo":"87ws4l47k2.fsf@wine.dyndns.org","subject":"Re: [PATCH] git.el: Make it easy to add unmerged files","fromName":"Martin Nordholts","fromEmail":"martin@chromecode.com","sentAt":"2009-09-02T05:48:07Z","receivedAt":"2009-09-02T05:48:07Z","isPatch":true,"sender":{"key":"martin@chromecode.com","avatar":null},"body":"On 08/30/2009 05:58 PM, Alexandre Julliard wrote:\n> Martin Nordholts <martin@chromecode.com> writes:\n> \n>> (Resending as I managed to mangle the previous patch despite trying not to...)\n>>\n>> It is nice and easy to git-add ignored and unknown files in a\n>> git-status buffer. Make it equally easy to add unmerged files which is\n>> a common use case.\n> \n> That's not quite what adding a file means in git.el, unmerged files are\n> considered added already, and marking them resolved is done through the\n> git-resolve-file command. Of course that was implemented before git\n> overloaded the meaning of git-add to mean git-update-index, so maybe we\n> should follow the trend and use git-add-file for all index updates. In\n> that case git-resolve-file should probably be removed.\n\nSince git instructs the user to use git-add for marking unmerged files\nas resolved (\"After resolving the conflicts, mark the corrected paths\nwith 'git add <paths>' or 'git rm <paths>' and commit the result.\") and\ndoesn't even mention git-update-index, I think we should change git.el\naccordingly.\n\nBut why do we need to also remove and disable git-resolve-file from\ngit.el? It doesn't hurt to keep that function and the keybinding, does\nit?\n\n / Martin\n"},{"id":"122300","messageId":"87iqg120ln.fsf@wine.dyndns.org","threadId":"20791","inReplyTo":"4A9E0717.9040801@chromecode.com","subject":"Re: [PATCH] git.el: Make it easy to add unmerged files","fromName":"Alexandre Julliard","fromEmail":"julliard@winehq.org","sentAt":"2009-09-02T08:48:52Z","receivedAt":"2009-09-02T08:48:52Z","isPatch":true,"sender":{"key":"julliard@winehq.org","avatar":null},"body":"Martin Nordholts <martin@chromecode.com> writes:\n\n> On 08/30/2009 05:58 PM, Alexandre Julliard wrote:\n>> Martin Nordholts <martin@chromecode.com> writes:\n>> \n>>> (Resending as I managed to mangle the previous patch despite trying not to...)\n>>>\n>>> It is nice and easy to git-add ignored and unknown files in a\n>>> git-status buffer. Make it equally easy to add unmerged files which is\n>>> a common use case.\n>> \n>> That's not quite what adding a file means in git.el, unmerged files are\n>> considered added already, and marking them resolved is done through the\n>> git-resolve-file command. Of course that was implemented before git\n>> overloaded the meaning of git-add to mean git-update-index, so maybe we\n>> should follow the trend and use git-add-file for all index updates. In\n>> that case git-resolve-file should probably be removed.\n>\n> Since git instructs the user to use git-add for marking unmerged files\n> as resolved (\"After resolving the conflicts, mark the corrected paths\n> with 'git add <paths>' or 'git rm <paths>' and commit the result.\") and\n> doesn't even mention git-update-index, I think we should change git.el\n> accordingly.\n>\n> But why do we need to also remove and disable git-resolve-file from\n> git.el? It doesn't hurt to keep that function and the keybinding, does\n> it?\n\nIt doesn't hurt much, but having two keybindings for the same thing is a\nbit wasteful since there aren't that many simple bindings available. If\nwe remove it, it opens the door to later reusing the 'R' key for\nsomething else (a git-rename function would be the obvious choice).\n\n-- \nAlexandre Julliard\njulliard@winehq.org\n"}]}