mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 14:23:51 -05:00
Compare commits
6 Commits
ae43d82a4c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61b51c09b7 | ||
|
|
e0715fe729 | ||
|
|
53d6ba99bc | ||
|
|
d3e2b58dec | ||
|
|
593f831d6f | ||
|
|
4a745ea72f |
81
LICENSE
81
LICENSE
@@ -1,81 +0,0 @@
|
||||
VIM LICENSE
|
||||
|
||||
I) There are no restrictions on distributing unmodified copies of
|
||||
fugitive.vim except that they must include this license text. You can
|
||||
also distribute unmodified parts of fugitive.vim, likewise unrestricted
|
||||
except that they must include this license text. You are also allowed to
|
||||
include executables that you made from the unmodified fugitive.vim
|
||||
sources, plus your own usage examples and Vim scripts.
|
||||
|
||||
II) It is allowed to distribute a modified (or extended) version of
|
||||
fugitive.vim, including executables and/or source code, when the following
|
||||
four conditions are met:
|
||||
1) This license text must be included unmodified.
|
||||
2) The modified fugitive.vim must be distributed in one of the following
|
||||
five ways:
|
||||
a) If you make changes to fugitive.vim yourself, you must clearly
|
||||
describe in the distribution how to contact you. When the
|
||||
maintainer asks you (in any way) for a copy of the modified
|
||||
fugitive.vim you distributed, you must make your changes, including
|
||||
source code, available to the maintainer without fee. The
|
||||
maintainer reserves the right to include your changes in the
|
||||
official version of fugitive.vim. What the maintainer will do with
|
||||
your changes and under what license they will be distributed is
|
||||
negotiable. If there has been no negotiation then this license, or
|
||||
a later version, also applies to your changes. The current
|
||||
maintainer is Bram Moolenaar <Bram@vim.org>. If this changes it
|
||||
will be announced in appropriate places (most likely vim.sf.net,
|
||||
www.vim.org and/or comp.editors). When it is completely impossible
|
||||
to contact the maintainer, the obligation to send him your changes
|
||||
ceases. Once the maintainer has confirmed that he has received your
|
||||
changes they will not have to be sent again.
|
||||
b) If you have received a modified fugitive.vim that was distributed as
|
||||
mentioned under a) you are allowed to further distribute it
|
||||
unmodified, as mentioned at I). If you make additional changes the
|
||||
text under a) applies to those changes.
|
||||
c) Provide all the changes, including source code, with every copy of
|
||||
the modified fugitive.vim you distribute. This may be done in the
|
||||
form of a context diff. You can choose what license to use for new
|
||||
code you add. The changes and their license must not restrict
|
||||
others from making their own changes to the official version of
|
||||
fugitive.vim.
|
||||
d) When you have a modified fugitive.vim which includes changes as
|
||||
mentioned under c), you can distribute it without the source code
|
||||
for the changes if the following three conditions are met:
|
||||
- The license that applies to the changes permits you to distribute
|
||||
the changes to the Vim maintainer without fee or restriction, and
|
||||
permits the Vim maintainer to include the changes in the official
|
||||
version of fugitive.vim without fee or restriction.
|
||||
- You keep the changes for at least three years after last
|
||||
distributing the corresponding modified fugitive.vim. When the
|
||||
maintainer or someone who you distributed the modified
|
||||
fugitive.vim to asks you (in any way) for the changes within this
|
||||
period, you must make them available to him.
|
||||
- You clearly describe in the distribution how to contact you. This
|
||||
contact information must remain valid for at least three years
|
||||
after last distributing the corresponding modified fugitive.vim,
|
||||
or as long as possible.
|
||||
e) When the GNU General Public License (GPL) applies to the changes,
|
||||
you can distribute the modified fugitive.vim under the GNU GPL
|
||||
version 2 or any later version.
|
||||
3) A message must be added, at least in the output of the ":version"
|
||||
command and in the intro screen, such that the user of the modified
|
||||
fugitive.vim is able to see that it was modified. When distributing as
|
||||
mentioned under 2)e) adding the message is only required for as far as
|
||||
this does not conflict with the license used for the changes.
|
||||
4) The contact information as required under 2)a) and 2)d) must not be
|
||||
removed or changed, except that the person himself can make
|
||||
corrections.
|
||||
|
||||
III) If you distribute a modified version of fugitive.vim, you are encouraged
|
||||
to use the Vim license for your changes and make them available to the
|
||||
maintainer, including the source code. The preferred way to do this is
|
||||
by e-mail or by uploading the files to a server and e-mailing the URL. If
|
||||
the number of changes is small (e.g., a modified Makefile) e-mailing a
|
||||
context diff will do. The e-mail address to be used is
|
||||
<maintainer@vim.org>
|
||||
|
||||
IV) It is not allowed to remove this license from the distribution of the
|
||||
fugitive.vim sources, parts of it or from a modified version. You may
|
||||
use this license for previous fugitive.vim releases instead of the
|
||||
license that they came with, at your option.
|
||||
@@ -4,11 +4,6 @@
|
||||
" The functions contained within this file are for internal use only. For the
|
||||
" official API, see the commented functions in plugin/fugitive.vim.
|
||||
|
||||
if exists('g:autoloaded_fugitive')
|
||||
finish
|
||||
endif
|
||||
let g:autoloaded_fugitive = 1
|
||||
|
||||
" Section: Utility
|
||||
|
||||
function! s:function(name) abort
|
||||
@@ -2071,6 +2066,8 @@ function! s:Expand(rev, ...) abort
|
||||
endif
|
||||
elseif s:Slash(a:rev) =~# '^\a\a\+://'
|
||||
let file = substitute(a:rev, '\\\@<!\%(#\a\|%\x\x\)', '\\&', 'g')
|
||||
elseif a:rev =~# '^:[!#%$]'
|
||||
let file = ':0' . a:rev
|
||||
else
|
||||
let file = a:rev
|
||||
endif
|
||||
@@ -2697,7 +2694,7 @@ function! s:MapStatus() abort
|
||||
call s:MapMotion('gP', "exe <SID>StageJump(v:count, 'Unpulled')")
|
||||
call s:MapMotion('gr', "exe <SID>StageJump(v:count, 'Rebasing')")
|
||||
call s:Map('n', 'C', ":echoerr 'fugitive: C has been removed in favor of cc'<CR>", '<silent><unique>')
|
||||
call s:Map('n', 'a', ":<C-U>execute <SID>Do('Toggle',0)<CR>", '<silent>')
|
||||
call s:Map('n', 'a', ":echoerr 'fugitive: a has been removed in favor of s'<CR>", '<silent><unique>')
|
||||
call s:Map('n', 'i', ":<C-U>execute <SID>NextExpandedHunk(v:count1)<CR>", '<silent>')
|
||||
call s:Map('n', "=", ":<C-U>execute <SID>StageInline('toggle',line('.'),v:count)<CR>", '<silent>')
|
||||
call s:Map('n', "<", ":<C-U>execute <SID>StageInline('hide', line('.'),v:count)<CR>", '<silent>')
|
||||
@@ -2940,20 +2937,34 @@ function! s:StatusRender(stat) abort
|
||||
endif
|
||||
|
||||
let sequencing = []
|
||||
if filereadable(fugitive#Find('.git/sequencer/todo', dir))
|
||||
for line in reverse(readfile(fugitive#Find('.git/sequencer/todo', dir)))
|
||||
try
|
||||
let sequencer_todo = reverse(readfile(fugitive#Find('.git/sequencer/todo', dir)))
|
||||
catch
|
||||
endtry
|
||||
if exists('sequencer_todo')
|
||||
for line in sequencer_todo
|
||||
let match = matchlist(line, '^\(\l\+\)\s\+\(\x\{4,\}\)\s\+\(.*\)')
|
||||
if len(match) && match[1] !~# 'exec\|merge\|label'
|
||||
call add(sequencing, {'type': 'Rebase', 'status': get(s:rebase_abbrevs, match[1], match[1]), 'commit': match[2], 'subject': match[3]})
|
||||
endif
|
||||
endfor
|
||||
elseif filereadable(fugitive#Find('.git/MERGE_MSG', dir))
|
||||
else
|
||||
try
|
||||
let merge_msg = get(readfile(fugitive#Find('.git/MERGE_MSG', dir)), 0, '')
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
if exists('merge_msg')
|
||||
if filereadable(fugitive#Find('.git/CHERRY_PICK_HEAD', dir))
|
||||
let pick_head = fugitive#Execute(['rev-parse', '--short', 'CHERRY_PICK_HEAD', '--'], dir).stdout[0]
|
||||
call add(sequencing, {'type': 'Rebase', 'status': 'pick', 'commit': pick_head, 'subject': get(readfile(fugitive#Find('.git/MERGE_MSG', dir)), 0, '')})
|
||||
if !empty(pick_head)
|
||||
call add(sequencing, {'type': 'Rebase', 'status': 'pick', 'commit': pick_head, 'subject': merge_msg})
|
||||
endif
|
||||
elseif filereadable(fugitive#Find('.git/REVERT_HEAD', dir))
|
||||
let pick_head = fugitive#Execute(['rev-parse', '--short', 'REVERT_HEAD', '--'], dir).stdout[0]
|
||||
call add(sequencing, {'type': 'Rebase', 'status': 'revert', 'commit': pick_head, 'subject': get(readfile(fugitive#Find('.git/MERGE_MSG', dir)), 0, '')})
|
||||
if !empty(pick_head)
|
||||
call add(sequencing, {'type': 'Rebase', 'status': 'revert', 'commit': pick_head, 'subject': merge_msg})
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -2976,7 +2987,7 @@ function! s:StatusRender(stat) abort
|
||||
endif
|
||||
|
||||
call s:AddSection(to, 'Rebasing ' . rebasing_head, rebasing)
|
||||
call s:AddSection(to, get(get(sequencing, 0, {}), 'tous', '') ==# 'revert' ? 'Reverting' : 'Cherry Picking', sequencing)
|
||||
call s:AddSection(to, get(get(sequencing, 0, {}), 'status', '') ==# 'revert' ? 'Reverting' : 'Cherry Picking', sequencing)
|
||||
call s:AddSection(to, 'Untracked', untracked)
|
||||
call s:AddDiffSection(to, stat, 'Unstaged', unstaged)
|
||||
call s:AddDiffSection(to, stat, 'Staged', staged)
|
||||
@@ -7435,9 +7446,12 @@ function! s:BrowserOpen(url, mods, echo_copy) abort
|
||||
else
|
||||
if !exists('g:loaded_netrw')
|
||||
runtime! autoload/netrw.vim
|
||||
runtime! autoload/netrw/os.vim
|
||||
endif
|
||||
if exists('*netrw#Open')
|
||||
return 'echo '.string(url).'|' . mods . 'call netrw#Open('.string(url).')'
|
||||
elseif exists('*netrw#os#Open')
|
||||
return 'echo '.string(url).'|' . mods . 'call netrw#os#Open('.string(url).')'
|
||||
elseif exists('*netrw#BrowseX')
|
||||
return 'echo '.string(url).'|' . mods . 'call netrw#BrowseX('.string(url).', 0)'
|
||||
elseif exists('*netrw#NetrwBrowseX')
|
||||
|
||||
Reference in New Issue
Block a user