From e8f52d50c543f9cdf6ff65fa160fa226837cb23e Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 20 Nov 2022 12:04:36 +0800 Subject: [PATCH] docs(git): add `:h git-functions` and `:h git-branch` --- bundle/git.vim/autoload/git/branch.vim | 14 +++++++++++-- bundle/git.vim/doc/git.txt | 29 +++++++++++++++++++++----- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/bundle/git.vim/autoload/git/branch.vim b/bundle/git.vim/autoload/git/branch.vim index 9ca811ef1..644ab2b83 100644 --- a/bundle/git.vim/autoload/git/branch.vim +++ b/bundle/git.vim/autoload/git/branch.vim @@ -6,6 +6,14 @@ " License: GPLv3 "============================================================================= +"" +" @section git-branch, branch +" @parentsection commands +" This commands is to open branch manager. +" > +" :Git branch +" < + let s:JOB = SpaceVim#api#import('job') let s:STR = SpaceVim#api#import('data#string') @@ -102,7 +110,8 @@ function! s:on_exit_show_branch(id, data, event) abort \ }) endif endfunction - +"" +" return the current branch info. this function can be used in statusline. function! git#branch#current(...) abort let pwd = getcwd() let branch = get(s:branch_info, pwd, {}) @@ -117,7 +126,8 @@ function! git#branch#current(...) abort return '' endif endfunction - +"" +" update the branch info manually. function! git#branch#detect() abort call s:update_branch_name(getcwd(), 1) endfunction diff --git a/bundle/git.vim/doc/git.txt b/bundle/git.vim/doc/git.txt index fb9aada32..c3c7fe311 100644 --- a/bundle/git.vim/doc/git.txt +++ b/bundle/git.vim/doc/git.txt @@ -6,11 +6,13 @@ CONTENTS *git-contents* 1. Introduction..................................................|git-intro| 2. Commands...................................................|git-commands| 1. git-add.....................................................|git-add| - 2. git-cherry-pick.....................................|git-cherry-pick| - 3. git-clean.................................................|git-clean| - 4. git-mv.......................................................|git-mv| - 5. git-rm.......................................................|git-rm| - 6. git-stash.................................................|git-stash| + 2. git-branch...............................................|git-branch| + 3. git-cherry-pick.....................................|git-cherry-pick| + 4. git-clean.................................................|git-clean| + 5. git-mv.......................................................|git-mv| + 6. git-rm.......................................................|git-rm| + 7. git-stash.................................................|git-stash| + 3. Functions.................................................|git-functions| ============================================================================== INTRODUCTION *git-intro* @@ -33,6 +35,14 @@ file to the index. :Git add % < +============================================================================== +GIT-BRANCH *git-branch* + +This commands is to open branch manager. +> + :Git branch +< + ============================================================================== GIT-CHERRY-PICK *git-cherry-pick* @@ -75,5 +85,14 @@ This commands is to manage git stash. :Git stash list < +============================================================================== +FUNCTIONS *git-functions* + +git#branch#current() *git#branch#current()* + return the current branch info. this function can be used in statusline. + +git#branch#detect() *git#branch#detect()* + update the branch info manually. + vim:tw=78:ts=8:ft=help:norl: