threads / patch / 11070

patchAdding menu for Emacs git.el

Subject: [PATCH] Adding menu for Emacs git.el

## tl;dr

8 messages between Nov 30, 2007 and Dec 11, 2007. Diffs are folded; open one to read it.

replies: 7people: 3as markdown or json

=?utf-8?q?R=C3=A9mi=20Vanicat?=· Nov 30, 2007, 19:29 UTC · lore

Adding three menu to the git-status-mode of git.el : One for marking and unmarking, one for every thing you need when you have a conflict, and a last one for all the rest.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
---
This use easymenu.
 contrib/emacs/git.el |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 45 insertions(+), 1 deletions(-)
Show changes to contrib/emacs/git.el +45 −1
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index e147da0..f41b2ef 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -1297,7 +1297,51 @@ Return the list of files that haven't been handled."
     (define-key toggle-map "i" 'git-toggle-show-ignored)
     (define-key toggle-map "k" 'git-toggle-show-unknown)
     (define-key toggle-map "m" 'git-toggle-all-marks)
-    (setq git-status-mode-map map)))
+    (setq git-status-mode-map map))
+  (easy-menu-define git-menu-mark git-status-mode-map
+    "Git Merge Menu"
+    `("Merge"
+      ["Next Unmerged File" git-next-unmerged-file t]
+      ["Prev Unmerged File" git-prev-unmerged-file t]
+      ["Mark as Resolved" git-resolve-file t]
+      ["Interctive Merge File" git-find-file-imerge t]
+      ["Diff Against Common Base File" git-diff-file-base t]
+      ["Diff Combined" git-diff-file-combined t]
+      ["Diff Against Merge Head" git-diff-file-merge-head t]
+      ["Diff Against Mine" git-diff-file-mine t]
+      ["Diff Against Other" git-diff-file-other t]))
+  (easy-menu-define git-menu-mark git-status-mode-map
+    "Git Mark Menu"
+    `("Mark"
+      ["Mark File" git-mark-file t]
+      ["Mark All" git-mark-all t]
+      ["Unmark File" git-unmark-file t]
+      ["Unmark All" git-unmark-all t]
+      ["Toggle All Mark" git-toggle-all-marks t]))
+  (easy-menu-define git-menu git-status-mode-map
+    "Git Menu." 
+    `("Git"
+      ["Refresh" git-refresh-status t]
+      ["Commit" git-commit-file t]
+      "--------"
+      ["Add File" git-add-file t]
+      ["Revert File" git-revert-file t]
+      ["Ignore File" git-ignore-file t]
+      ["Remove File" git-remove-file t]
+      "--------"
+      ["Find File" git-find-file t]
+      ["View File" git-view-file t]
+      ["Diff File" git-diff-file t]
+      ["Interctive Diff File" git-diff-file-idiff t]
+      ["Log" git-log-file t]
+      "--------"
+      ["Quit" git-status-quit t]
+      "--------"
+      ["Show Uptodate" git-toggle-show-uptodate :style toggle :selected git-show-uptodate]
+      ["Toggle Show Ignored" git-toggle-show-ignored :style toggle :selected git-show-ignored]
+      ["Toggle Show Unknown" git-toggle-show-unknown :style toggle :selected git-show-unknown]))
+    
+)
 
 ;; git mode should only run in the *git status* buffer
 (put 'git-status-mode 'mode-class 'special)
-- 
1.5.3.6
Alexandre Julliard· Dec 2, 2007, 18:42 UTC · re: =?utf-8?q?R=C3=A9mi=20Vanicat?= · lore

Re: [PATCH] Adding menu for Emacs git.el

"=?utf-8?q?R=C3=A9mi=20Vanicat?=" <vanicat@debian.org>, Remi Vanicat <vanicat@debian.org> writes:

Show 5 quoted lines
> Adding three menu to the git-status-mode of git.el : One for marking
> and unmarking, one for every thing you need when you have a conflict,
> and a last one for all the rest.
>
> Signed-off-by: Rémi Vanicat <vanicat@debian.org>
It looks good to me. A couple of minor details:
> +      ["Interctive Diff File" git-diff-file-idiff t]
There's a typo here.
> +      ["Show Uptodate" git-toggle-show-uptodate :style toggle :selected git-show-uptodate]
> +      ["Toggle Show Ignored" git-toggle-show-ignored :style toggle :selected git-show-ignored]
> +      ["Toggle Show Unknown" git-toggle-show-unknown :style toggle :selected git-show-unknown]))
I'd get rid of 'Toggle' on the last two for consistency.
BTW do you have a copyright assignment for Emacs?
-- 
Alexandre Julliard
julliard@winehq.org
Remi Vanicat· Dec 3, 2007, 06:03 UTC · re: Alexandre Julliard · lore

Re: [PATCH] Adding menu for Emacs git.el

Adding three menus to the git-status-mode of git.el : One for marking and unmarking, one for what you do when you have a conflict, and the other one for all the rest.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
---
Alexandre Julliard <julliard@winehq.org> writes:
Show 10 quoted lines
> "=?utf-8?q?R=C3=A9mi=20Vanicat?=" <vanicat@debian.org>, Remi Vanicat
> <vanicat@debian.org> writes:
>
>> Adding three menu to the git-status-mode of git.el : One for marking
>> and unmarking, one for every thing you need when you have a conflict,
>> and a last one for all the rest.
>>
>> Signed-off-by: Rémi Vanicat <vanicat@debian.org>
>
> It looks good to me. A couple of minor details:

Here is the corrected patch [...]

> BTW do you have a copyright assignment for Emacs?
No, should I seek one ?
 contrib/emacs/git.el |   48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 46 insertions(+), 2 deletions(-)
Show changes to contrib/emacs/git.el +46 −2
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index e147da0..1db7698 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -49,7 +49,7 @@
 (eval-when-compile (require 'cl))
 (require 'ewoc)
 (require 'log-edit)
-
+(require 'easymenu)
 
 ;;;; Customizations
 ;;;; ------------------------------------------------------------
@@ -1297,7 +1297,51 @@ Return the list of files that haven't been handled."
     (define-key toggle-map "i" 'git-toggle-show-ignored)
     (define-key toggle-map "k" 'git-toggle-show-unknown)
     (define-key toggle-map "m" 'git-toggle-all-marks)
-    (setq git-status-mode-map map)))
+    (setq git-status-mode-map map))
+  (easy-menu-define git-menu-mark git-status-mode-map
+    "Git Merge Menu"
+    `("Merge"
+      ["Next Unmerged File" git-next-unmerged-file t]
+      ["Prev Unmerged File" git-prev-unmerged-file t]
+      ["Mark as Resolved" git-resolve-file t]
+      ["Interactive Merge File" git-find-file-imerge t]
+      ["Diff Against Common Base File" git-diff-file-base t]
+      ["Diff Combined" git-diff-file-combined t]
+      ["Diff Against Merge Head" git-diff-file-merge-head t]
+      ["Diff Against Mine" git-diff-file-mine t]
+      ["Diff Against Other" git-diff-file-other t]))
+  (easy-menu-define git-menu-mark git-status-mode-map
+    "Git Mark Menu"
+    `("Mark"
+      ["Mark File" git-mark-file t]
+      ["Mark All" git-mark-all t]
+      ["Unmark File" git-unmark-file t]
+      ["Unmark All" git-unmark-all t]
+      ["Toggle All Mark" git-toggle-all-marks t]))
+  (easy-menu-define git-menu git-status-mode-map
+    "Git Menu." 
+    `("Git"
+      ["Refresh" git-refresh-status t]
+      ["Commit" git-commit-file t]
+      "--------"
+      ["Add File" git-add-file t]
+      ["Revert File" git-revert-file t]
+      ["Ignore File" git-ignore-file t]
+      ["Remove File" git-remove-file t]
+      "--------"
+      ["Find File" git-find-file t]
+      ["View File" git-view-file t]
+      ["Diff File" git-diff-file t]
+      ["Interctive Diff File" git-diff-file-idiff t]
+      ["Log" git-log-file t]
+      "--------"
+      ["Quit" git-status-quit t]
+      "--------"
+      ["Show Uptodate" git-toggle-show-uptodate :style toggle :selected git-show-uptodate]
+      ["Show Ignored" git-toggle-show-ignored :style toggle :selected git-show-ignored]
+      ["Show Unknown" git-toggle-show-unknown :style toggle :selected git-show-unknown]))
+    
+)
 
 ;; git mode should only run in the *git status* buffer
 (put 'git-status-mode 'mode-class 'special)
-- 
1.5.3.6
Alexandre Julliard· Dec 3, 2007, 17:13 UTC · re: Remi Vanicat · lore

Re: [PATCH] Adding menu for Emacs git.el

Remi Vanicat <vanicat@debian.org> writes:
Show 5 quoted lines
> Here is the corrected patch
> [...]
>
>> BTW do you have a copyright assignment for Emacs?
> No, should I seek one ?

It's not necessary right now, but I'm hoping that git.el will eventually be merged into the main Emacs tree, and at that point we'll need a copyright assignment from you.

> +      ["Interctive Diff File" git-diff-file-idiff t]
The typo is still here.
-- 
Alexandre Julliard
julliard@winehq.org
Remi Vanicat· Dec 3, 2007, 21:06 UTC · re: Alexandre Julliard · lore

[PATCH v3] Adding menus for Emacs git.el

Adding three menus to the git-status-mode of git.el : One for marking and unmarking, one for what you do when you have a conflict, and the other one for all the rest. --- Alexandre Julliard <julliard@winehq.org> writes:

> Remi Vanicat <vanicat@debian.org> writes:
>> +      ["Interctive Diff File" git-diff-file-idiff t]
>
> The typo is still here.
Pff, The typo was in two place, and I forgot to check this... 
This time, I have run a spell checker on every menu entries, to be
sure. 
 contrib/emacs/git.el |   48 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 46 insertions(+), 2 deletions(-)
Show changes to contrib/emacs/git.el +45 −1
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index e147da0..7fbea55 100644
     (define-key toggle-map "i" 'git-toggle-show-ignored)
     (define-key toggle-map "k" 'git-toggle-show-unknown)
     (define-key toggle-map "m" 'git-toggle-all-marks)
-    (setq git-status-mode-map map)))
+    (setq git-status-mode-map map))
+  (easy-menu-define git-menu-mark git-status-mode-map
+    "Git Merge Menu"
+    `("Merge"
+      ["Next Unmerged File" git-next-unmerged-file t]
+      ["Prev Unmerged File" git-prev-unmerged-file t]
+      ["Mark as Resolved" git-resolve-file t]
+      ["Interactive Merge File" git-find-file-imerge t]
+      ["Diff Against Common Base File" git-diff-file-base t]
+      ["Diff Combined" git-diff-file-combined t]
+      ["Diff Against Merge Head" git-diff-file-merge-head t]
+      ["Diff Against Mine" git-diff-file-mine t]
+      ["Diff Against Other" git-diff-file-other t]))
+  (easy-menu-define git-menu-mark git-status-mode-map
+    "Git Mark Menu"
+    `("Mark"
+      ["Mark File" git-mark-file t]
+      ["Mark All" git-mark-all t]
+      ["Unmark File" git-unmark-file t]
+      ["Unmark All" git-unmark-all t]
+      ["Toggle All Mark" git-toggle-all-marks t]))
+  (easy-menu-define git-menu git-status-mode-map
+    "Git Menu." 
+    `("Git"
+      ["Refresh" git-refresh-status t]
+      ["Commit" git-commit-file t]
+      "--------"
+      ["Add File" git-add-file t]
+      ["Revert File" git-revert-file t]
+      ["Ignore File" git-ignore-file t]
+      ["Remove File" git-remove-file t]
+      "--------"
+      ["Find File" git-find-file t]
+      ["View File" git-view-file t]
+      ["Diff File" git-diff-file t]
+      ["Interactive Diff File" git-diff-file-idiff t]
+      ["Log" git-log-file t]
+      "--------"
+      ["Quit" git-status-quit t]
+      "--------"
+      ["Show Uptodate" git-toggle-show-uptodate :style toggle :selected git-show-uptodate]
+      ["Show Ignored" git-toggle-show-ignored :style toggle :selected git-show-ignored]
+      ["Show Unknown" git-toggle-show-unknown :style toggle :selected git-show-unknown]))
+    
+)
 
 ;; git mode should only run in the *git status* buffer
 (put 'git-status-mode 'mode-class 'special)
-- 
1.5.3.6
Junio C Hamano· Dec 11, 2007, 06:36 UTC · re: Remi Vanicat · lore

Re: [PATCH] Adding menu for Emacs git.el

Remi Vanicat <vanicat@debian.org> writes:
Show 25 quoted lines
> Adding three menus to the git-status-mode of git.el : One for marking
> and unmarking, one for what you do when you have a conflict, and the
> other one for all the rest.
>
> Signed-off-by: Rémi Vanicat <vanicat@debian.org>
> ---
>
> Alexandre Julliard <julliard@winehq.org> writes:
>
>> "=?utf-8?q?R=C3=A9mi=20Vanicat?=" <vanicat@debian.org>, Remi Vanicat
>> <vanicat@debian.org> writes:
>>
>>> Adding three menu to the git-status-mode of git.el : One for marking
>>> and unmarking, one for every thing you need when you have a conflict,
>>> and a last one for all the rest.
>>>
>>> Signed-off-by: Rémi Vanicat <vanicat@debian.org>
>>
>> It looks good to me. A couple of minor details:
>
> Here is the corrected patch
> [...]
>
>> BTW do you have a copyright assignment for Emacs?
> No, should I seek one ?
Alex, what is the current status of this patch?
Alexandre Julliard· Dec 11, 2007, 13:02 UTC · re: Junio C Hamano · lore

Re: [PATCH] Adding menu for Emacs git.el

Junio C Hamano <gitster@pobox.com> writes:
> Alex, what is the current status of this patch?

Patch v3 looked good but the patch file was corrupted. Here's the latest version, I have moved things around a bit to use only one menu and to be more similar to pcl-cvs.

From 0a67dfc88a8bbf479c37ba76521ebe39fa67f577 Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Tue, 11 Dec 2007 13:56:09 +0100
Subject: [PATCH] git.el: Added a menu for git-status-mode.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Originally written by Rémi Vanicat, I just changed the layout a little.
Signed-off-by: Rémi Vanicat <vanicat@debian.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 contrib/emacs/git.el |   43 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 42 insertions(+), 1 deletions(-)
Show changes to contrib/emacs/git.el +42 −1
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index e147da0..ae58f1c 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -49,6 +49,7 @@
 (eval-when-compile (require 'cl))
 (require 'ewoc)
 (require 'log-edit)
+(require 'easymenu)
 
 
 ;;;; Customizations
@@ -1297,7 +1298,47 @@ Return the list of files that haven't been handled."
     (define-key toggle-map "i" 'git-toggle-show-ignored)
     (define-key toggle-map "k" 'git-toggle-show-unknown)
     (define-key toggle-map "m" 'git-toggle-all-marks)
-    (setq git-status-mode-map map)))
+    (setq git-status-mode-map map))
+  (easy-menu-define git-menu git-status-mode-map
+    "Git Menu"
+    `("Git"
+      ["Refresh" git-refresh-status t]
+      ["Commit" git-commit-file t]
+      ("Merge"
+        ["Next Unmerged File" git-next-unmerged-file t]
+        ["Prev Unmerged File" git-prev-unmerged-file t]
+        ["Mark as Resolved" git-resolve-file t]
+        ["Interactive Merge File" git-find-file-imerge t]
+        ["Diff Against Common Base File" git-diff-file-base t]
+        ["Diff Combined" git-diff-file-combined t]
+        ["Diff Against Merge Head" git-diff-file-merge-head t]
+        ["Diff Against Mine" git-diff-file-mine t]
+        ["Diff Against Other" git-diff-file-other t])
+      "--------"
+      ["Add File" git-add-file t]
+      ["Revert File" git-revert-file t]
+      ["Ignore File" git-ignore-file t]
+      ["Remove File" git-remove-file t]
+      "--------"
+      ["Find File" git-find-file t]
+      ["View File" git-view-file t]
+      ["Diff File" git-diff-file t]
+      ["Interactive Diff File" git-diff-file-idiff t]
+      ["Log" git-log-file t]
+      "--------"
+      ["Mark" git-mark-file t]
+      ["Mark All" git-mark-all t]
+      ["Unmark" git-unmark-file t]
+      ["Unmark All" git-unmark-all t]
+      ["Toggle All Marks" git-toggle-all-marks t]
+      ["Hide Handled Files" git-remove-handled t]
+      "--------"
+      ["Show Uptodate Files" git-toggle-show-uptodate :style toggle :selected git-show-uptodate]
+      ["Show Ignored Files" git-toggle-show-ignored :style toggle :selected git-show-ignored]
+      ["Show Unknown Files" git-toggle-show-unknown :style toggle :selected git-show-unknown]
+      "--------"
+      ["Quit" git-status-quit t])))
+
 
 ;; git mode should only run in the *git status* buffer
 (put 'git-status-mode 'mode-class 'special)
-- 
1.5.3.7.959.gdf7e-dirty

-- 
Alexandre Julliard
julliard@winehq.org
Remi Vanicat· Dec 11, 2007, 16:27 UTC · re: Alexandre Julliard · lore

Re: [PATCH] Adding menu for Emacs git.el

2007/12/11, Alexandre Julliard <julliard@winehq.org>:
Show 8 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
>
> > Alex, what is the current status of this patch?
>
> Patch v3 looked good but the patch file was corrupted. Here's the latest
> version, I have moved things around a bit to use only one menu and to be
> more similar to pcl-cvs.
>
It look good

← back to recent threads