* [PATCH] git.el: Make it easy to add unmerged files
@ 2009-08-30 14:55 Martin Nordholts
2009-08-30 15:58 ` Alexandre Julliard
0 siblings, 1 reply; 5+ messages in thread
From: Martin Nordholts @ 2009-08-30 14:55 UTC (permalink / raw)
To: git, Junio C Hamano, julliard
(Resending as I managed to mangle the previous patch despite trying not to...)
It is nice and easy to git-add ignored and unknown files in a
git-status buffer. Make it equally easy to add unmerged files which is
a common use case.
Signed-off-by: Martin Nordholts <martinn@src.gnome.org>
---
contrib/emacs/git.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 8c70ad8..3af5d00 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -1046,7 +1046,7 @@ The FILES list must be sorted."
(defun git-add-file ()
"Add marked file(s) to the index cache."
(interactive)
- (let ((files (git-get-filenames (git-marked-files-state 'unknown 'ignored))))
+ (let ((files (git-get-filenames (git-marked-files-state 'unknown 'ignored 'unmerged))))
;; FIXME: add support for directories
(unless files
(push (file-relative-name (read-file-name "File to add: " nil nil t)) files))
--
1.6.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] git.el: Make it easy to add unmerged files
2009-08-30 14:55 [PATCH] git.el: Make it easy to add unmerged files Martin Nordholts
@ 2009-08-30 15:58 ` Alexandre Julliard
2009-09-02 5:48 ` Martin Nordholts
0 siblings, 1 reply; 5+ messages in thread
From: Alexandre Julliard @ 2009-08-30 15:58 UTC (permalink / raw)
To: Martin Nordholts; +Cc: git, Junio C Hamano
Martin Nordholts <martin@chromecode.com> writes:
> (Resending as I managed to mangle the previous patch despite trying not to...)
>
> It is nice and easy to git-add ignored and unknown files in a
> git-status buffer. Make it equally easy to add unmerged files which is
> a common use case.
That's not quite what adding a file means in git.el, unmerged files are
considered added already, and marking them resolved is done through the
git-resolve-file command. Of course that was implemented before git
overloaded the meaning of git-add to mean git-update-index, so maybe we
should follow the trend and use git-add-file for all index updates. In
that case git-resolve-file should probably be removed.
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] git.el: Make it easy to add unmerged files
2009-08-30 15:58 ` Alexandre Julliard
@ 2009-09-02 5:48 ` Martin Nordholts
2009-09-02 8:48 ` Alexandre Julliard
0 siblings, 1 reply; 5+ messages in thread
From: Martin Nordholts @ 2009-09-02 5:48 UTC (permalink / raw)
To: Alexandre Julliard; +Cc: git, Junio C Hamano
On 08/30/2009 05:58 PM, Alexandre Julliard wrote:
> Martin Nordholts <martin@chromecode.com> writes:
>
>> (Resending as I managed to mangle the previous patch despite trying not to...)
>>
>> It is nice and easy to git-add ignored and unknown files in a
>> git-status buffer. Make it equally easy to add unmerged files which is
>> a common use case.
>
> That's not quite what adding a file means in git.el, unmerged files are
> considered added already, and marking them resolved is done through the
> git-resolve-file command. Of course that was implemented before git
> overloaded the meaning of git-add to mean git-update-index, so maybe we
> should follow the trend and use git-add-file for all index updates. In
> that case git-resolve-file should probably be removed.
Since git instructs the user to use git-add for marking unmerged files
as resolved ("After resolving the conflicts, mark the corrected paths
with 'git add <paths>' or 'git rm <paths>' and commit the result.") and
doesn't even mention git-update-index, I think we should change git.el
accordingly.
But why do we need to also remove and disable git-resolve-file from
git.el? It doesn't hurt to keep that function and the keybinding, does
it?
/ Martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] git.el: Make it easy to add unmerged files
2009-09-02 5:48 ` Martin Nordholts
@ 2009-09-02 8:48 ` Alexandre Julliard
0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Julliard @ 2009-09-02 8:48 UTC (permalink / raw)
To: Martin Nordholts; +Cc: git, Junio C Hamano
Martin Nordholts <martin@chromecode.com> writes:
> On 08/30/2009 05:58 PM, Alexandre Julliard wrote:
>> Martin Nordholts <martin@chromecode.com> writes:
>>
>>> (Resending as I managed to mangle the previous patch despite trying not to...)
>>>
>>> It is nice and easy to git-add ignored and unknown files in a
>>> git-status buffer. Make it equally easy to add unmerged files which is
>>> a common use case.
>>
>> That's not quite what adding a file means in git.el, unmerged files are
>> considered added already, and marking them resolved is done through the
>> git-resolve-file command. Of course that was implemented before git
>> overloaded the meaning of git-add to mean git-update-index, so maybe we
>> should follow the trend and use git-add-file for all index updates. In
>> that case git-resolve-file should probably be removed.
>
> Since git instructs the user to use git-add for marking unmerged files
> as resolved ("After resolving the conflicts, mark the corrected paths
> with 'git add <paths>' or 'git rm <paths>' and commit the result.") and
> doesn't even mention git-update-index, I think we should change git.el
> accordingly.
>
> But why do we need to also remove and disable git-resolve-file from
> git.el? It doesn't hurt to keep that function and the keybinding, does
> it?
It doesn't hurt much, but having two keybindings for the same thing is a
bit wasteful since there aren't that many simple bindings available. If
we remove it, it opens the door to later reusing the 'R' key for
something else (a git-rename function would be the obvious choice).
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] git.el: Make it easy to add unmerged files
@ 2009-08-30 14:35 Martin Nordholts
0 siblings, 0 replies; 5+ messages in thread
From: Martin Nordholts @ 2009-08-30 14:35 UTC (permalink / raw)
To: git, Junio C Hamano, julliard
It is nice and easy to git-add ignored and unknown files in a
git-status buffer. Make it equally easy to add unmerged files which is
a common use case.
Signed-off-by: Martin Nordholts <martinn@src.gnome.org>
---
contrib/emacs/git.el | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 8c70ad8..3af5d00 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -1046,7 +1046,7 @@ The FILES list must be sorted."
(defun git-add-file ()
"Add marked file(s) to the index cache."
(interactive)
- (let ((files (git-get-filenames (git-marked-files-state 'unknown
'ignored))))
+ (let ((files (git-get-filenames (git-marked-files-state 'unknown
'ignored 'unmerged))))
;; FIXME: add support for directories
(unless files
(push (file-relative-name (read-file-name "File to add: " nil
nil t)) files))
--
1.6.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-09-02 8:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-30 14:55 [PATCH] git.el: Make it easy to add unmerged files Martin Nordholts
2009-08-30 15:58 ` Alexandre Julliard
2009-09-02 5:48 ` Martin Nordholts
2009-09-02 8:48 ` Alexandre Julliard
-- strict thread matches above, loose matches on Subject: below --
2009-08-30 14:35 Martin Nordholts
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).