r1094 - in /trunk/packages/vim-scripts: debian/changelog debian/vim-scripts.status ftplugin/git.vim html/ftplugin_git.vim.html

jamessan at users.alioth.debian.org jamessan at users.alioth.debian.org
Mon Nov 26 12:31:12 UTC 2007


Author: jamessan
Date: Mon Nov 26 12:31:12 2007
New Revision: 1094

URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=1094
Log:
Update git-commit addon.  (Closes: #452954)

Modified:
    trunk/packages/vim-scripts/debian/changelog
    trunk/packages/vim-scripts/debian/vim-scripts.status
    trunk/packages/vim-scripts/ftplugin/git.vim
    trunk/packages/vim-scripts/html/ftplugin_git.vim.html

Modified: trunk/packages/vim-scripts/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/changelog?rev=1094&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/changelog (original)
+++ trunk/packages/vim-scripts/debian/changelog Mon Nov 26 12:31:12 2007
@@ -6,7 +6,7 @@
   [ James Vega ]
   * Updated addons:
     - Supertab, Omni CPP Complete, NERD Commenter, VCS Command, Align,
-      Calendar, Taglist, Bufexplorer.
+      Calendar, Taglist, Bufexplorer, git-commit (Closes: #452954).
   * debian/control:
     - Add myself to Uploaders.
     - Add vim to Build-Depends-Indep in order to generate NERD_commenter's
@@ -16,7 +16,7 @@
     - Cause NERD_commenter to generate its documentation at build time.
       (Closes: #444287)
 
- -- James Vega <jamessan at debian.org>  Tue, 20 Nov 2007 13:39:31 -0500
+ -- James Vega <jamessan at debian.org>  Mon, 26 Nov 2007 12:21:28 +0000
 
 vim-scripts (7.1.3) unstable; urgency=low
 

Modified: trunk/packages/vim-scripts/debian/vim-scripts.status
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/debian/vim-scripts.status?rev=1094&op=diff
==============================================================================
--- trunk/packages/vim-scripts/debian/vim-scripts.status (original)
+++ trunk/packages/vim-scripts/debian/vim-scripts.status Mon Nov 26 12:31:12 2007
@@ -306,9 +306,9 @@
 author:      Pierre Habouzit
 author_url:  http://www.vim.org/account/profile.php?user_id=12628
 email:       madcoder at debian.org
-license:     no license
+license:     license [2], see below
 extras:	     syntax/git.vim
-version:     0.1
+version:     0.2
 
 script_name: autoload/omni/cpp/complete.vim
 addon:	     omnicppcomplete

Modified: trunk/packages/vim-scripts/ftplugin/git.vim
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/ftplugin/git.vim?rev=1094&op=diff
==============================================================================
--- trunk/packages/vim-scripts/ftplugin/git.vim (original)
+++ trunk/packages/vim-scripts/ftplugin/git.vim Mon Nov 26 12:31:12 2007
@@ -1,66 +1,48 @@
-if exists("b:did_ftplugin")
-  finish
-endif
+"=============================================================================
+" Copyright:    Copyright © Pierre Habouzit
+"               Permission is hereby granted to use and distribute this code,
+"               with or without modifications, provided that this copyright
+"               notice is copied with it. Like anything else that's free,
+"               bufexplorer.vim is provided *as is* and comes with no
+"               warranty of any kind, either expressed or implied. In no
+"               event will the copyright holder be liable for any damages
+"               resulting from the use of this software.
+" Description:  git-commit(1) helper
+" Maintainer:   Pierre Habouzit <madcoder at debian.org>
+" Last Changed: Mon, 26 Nov 2007 10:06:15 +0100
+" Usage:        This file should live in your ftplugin directory.
+"
+"               The configurations variables are:
+"
+"                 g:git_diff_opts        - options to add to git diff,
+"                                          (default "-C -C")
+"                 g:git_diff_spawn_mode  - use auto-split on commit ?
+"                                          * 1 == hsplit
+"                                          * 2 == vsplit
+"                                          * none else (default)
+"
+"               The default keymaping is:
+"
+"                 <Leader>gd   - view the diff in a hsplit
+"                 <Leader>ghd  - view the diff in a hsplit
+"                 <Leader>gvd  - view the diff in a vsplit
+"========================================================================={{{=
+
+if exists("b:did_ftplugin") | finish | endif
 
 let b:did_ftplugin = 1
 
 setlocal tw=74
 setlocal nowarn nowb
 
-"{{{ function Git_diff_windows
-
-function! Git_diff_windows(vertsplit, auto)
-    let i = 0
-    let list_of_files = ''
-
-    " drop everything until '#  (will commit)' and the next empty line
-    while i <= line('$')
-        let line = getline(i)
-        if line == '# Changes to be committed:'
-            let i = i + 3
-            break
-        endif
-
-        let i = i + 1
-    endwhile
-
-    " read file names until we have EOF or an empty line
-    while i <= line('$')
-        let line = getline(i)
-        if line =~ '^#\s*[a-z ]*:.*->.*$'
-            let file = substitute(line, '^#[^:]*:.*->\s*\(.*\)\s*$', '\1', '')
-            let list_of_files = list_of_files . ' '.file
-            let file = substitute(line, '^#[^:]*:\s*\(.*\)\s*->.*$', '\1', '')
-            let list_of_files = list_of_files . ' '.file
-        elseif line =~ '^#\s*[a-z ]*:'
-            let file = substitute(line, '^#[^:]*:\s*\(.*\)\s*$', '\1', '')
-            let list_of_files = list_of_files . ' '.file
-        elseif line =~ '^#\s*$'
-            break
-        endif
-
-        let i = i + 1
-    endwhile
-
-    if list_of_files == ""
-        return
-    endif
-
+function! Git_diff_windows(vertsplit, auto, opts)
     if a:vertsplit
         rightbelow vnew
     else
         rightbelow new
     endif
     silent! setlocal ft=diff previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile
-    let gitDir = system('git rev-parse --git-dir 2>/dev/null')
-    let gitDir = substitute(gitDir, '.git\n', '', '')
-    let wd = getcwd()
-    if gitDir != ''
-        exe 'cd '.gitDir
-    endif
-    exe 'normal :r!LANG=C git diff HEAD -- ' . list_of_files . "\n1Gdd"
-    exe 'normal :r!LANG=C git diff --stat HEAD -- ' . list_of_files . "\no\<esc>1GddO\<esc>"
-    exe 'cd '.wd
+    exe "normal :r!LANG=C git diff --stat -p --cached ".a:opts."\no\<esc>1GddO\<esc>"
     setlocal nomodifiable
     noremap <buffer> q :bw<cr>
     if a:auto
@@ -70,14 +52,19 @@
     endif
 endfunction
 
-"}}}
-
 noremap <buffer> <Leader>gd :call Git_diff_windows(0, 0)<cr>
 noremap <buffer> <Leader>ghd :call Git_diff_windows(0, 0)<cr>
 noremap <buffer> <Leader>gvd :call Git_diff_windows(1, 0)<cr>
 
-if g:git_diff_spawn_mode == 1
-    call Git_diff_windows(0, 1)
-elseif g:git_diff_spawn_mode == 2
-    call Git_diff_windows(1, 1)
+if !exists("g:git_diff_opts")
+    let g:git_diff_opts = "-C -C"
 endif
+if exists("g:git_diff_spawn_mode")
+    if g:git_diff_spawn_mode == 1
+        call Git_diff_windows(0, 1, g:git_diff_opts)
+    elseif g:git_diff_spawn_mode == 2
+        call Git_diff_windows(1, 1, g:git_diff_opts)
+    endif
+endif
+
+" }}}

Modified: trunk/packages/vim-scripts/html/ftplugin_git.vim.html
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim-scripts/html/ftplugin_git.vim.html?rev=1094&op=diff
==============================================================================
--- trunk/packages/vim-scripts/html/ftplugin_git.vim.html (original)
+++ trunk/packages/vim-scripts/html/ftplugin_git.vim.html Mon Nov 26 12:31:12 2007
@@ -154,7 +154,7 @@
   <td class="lightbg"><b>&nbsp;script karma&nbsp;</b></td>
   <td>
     Rating <b>5/2</b>,
-    Downloaded by 100  </td>
+    Downloaded by 115  </td>
 </tr>
 </table>
 <p>
@@ -204,12 +204,20 @@
     <th valign="top">release notes</th>
 </tr>
 <tr>
-        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=7279">git.tar</a></td>
-    <td class="rowodd" valign="top" nowrap><b>0.1</b></td>
-    <td class="rowodd" valign="top" nowrap><i>2007-06-21</i></td>
+        <td class="rowodd" valign="top" nowrap><a href="download_script.php?src_id=7990">git.tar</a></td>
+    <td class="rowodd" valign="top" nowrap><b>0.2</b></td>
+    <td class="rowodd" valign="top" nowrap><i>2007-11-26</i></td>
     <td class="rowodd" valign="top" nowrap>7.0</td>
     <td class="rowodd" valign="top"><i><a href="/account/profile.php?user_id=12628">Pierre Habouzit</a></i></td>
-    <td class="rowodd" valign="top" width="2000">Initial upload</td>
+    <td class="rowodd" valign="top" width="2000">use GIT_INDEX_FILE and git diff --stat -p --cached&#8230;
<br>
<br>thanks a lot to Junio and Jan Hudec for the tip&#8230;</td>
+</tr>
+<tr>
+        <td class="roweven" valign="top" nowrap><a href="download_script.php?src_id=7279">git.tar</a></td>
+    <td class="roweven" valign="top" nowrap><b>0.1</b></td>
+    <td class="roweven" valign="top" nowrap><i>2007-06-21</i></td>
+    <td class="roweven" valign="top" nowrap>7.0</td>
+    <td class="roweven" valign="top"><i><a href="/account/profile.php?user_id=12628">Pierre Habouzit</a></i></td>
+    <td class="roweven" valign="top" width="2000">Initial upload</td>
 </tr>
 </table>
 <!-- finish off the framework -->




More information about the pkg-vim-maintainers mailing list