Skip to content

Commit e1788a8

Browse files
committed
* op-git.el: Fix checkdoc warnings
(op/git-all-files): (op/git-new-branch): (op/git-change-branch): (op/git-init-repo): (op/git-commit-changes): (op/git-files-changed): (op/git-last-change-date): (op/git-remote-name): (op/git-push-remote):
1 parent cfc1a95 commit e1788a8

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

op-git.el

+25-27
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@
3333
(require 'dash)
3434

3535
(defun op/git-all-files (repo-dir &optional branch)
36-
"This function will return a list contains all org files in git repository
37-
presented by REPO-DIR, if optional BRANCH is offered, will check that branch
38-
instead of pointer HEAD."
36+
"Return a list of all org files in git repository presented by REPO-DIR.
37+
When optional BRANCH is offered, check that branch instead of pointer HEAD."
3938
(let* ((org-file-ext ".org")
4039
(git-repo repo-dir)
4140
(output (git-run "ls-tree" "-r" "--name-only"
@@ -50,41 +49,40 @@ instead of pointer HEAD."
5049
(git-on-branch)))
5150

5251
(defun op/git-new-branch (repo-dir branch-name)
53-
"This function will create a new branch with BRANCH-NAME, and checkout it."
52+
"Create a new branch with BRANCH-NAME in REPO-DIR, and checkout the branch."
5453
(let ((git-repo repo-dir))
5554
(unless (git-branch? branch-name)
5655
(git-branch branch-name))
5756
(git-checkout branch-name)))
5857

5958
(defun op/git-change-branch (repo-dir branch-name)
60-
"This function will change branch to BRANCH-NAME of git repository presented
61-
by REPO-DIR. Do nothing if it is current branch."
59+
"Change branch to BRANCH-NAME in git repository REPO-DIR.
60+
Do nothing if it is the current branch."
6261
(let ((git-repo repo-dir))
6362
(unless (git-on-branch? branch-name)
6463
(git-checkout branch-name))))
6564

6665
(defun op/git-init-repo (repo-dir)
67-
"This function will initialize a new empty git repository. REPO-DIR is the
68-
directory where repository will be initialized."
66+
"Initialize a new empty git repository in REPO-DIR."
6967
(unless (file-directory-p repo-dir)
7068
(mkdir repo-dir t))
7169
(git-init repo-dir))
7270

7371
(defun op/git-commit-changes (repo-dir message)
74-
"This function will commit uncommitted changes to git repository presented by
75-
REPO-DIR, MESSAGE is the commit message."
72+
"Commit uncommitted changes to git repository in REPO-DIR.
73+
MESSAGE is the commit message."
7674
(let ((git-repo repo-dir))
7775
(git-add)
7876
(git-commit message)))
7977

8078
(defun op/git-files-changed (repo-dir base-commit)
81-
"This function can get modified/deleted org files from git repository
82-
presented by REPO-DIR, diff based on BASE-COMMIT. The return value is a
83-
property list, property :update maps a list of updated/added files, property
84-
:delete maps a list of deleted files.
85-
For git, there are three types: Added, Modified, Deleted, but for org-page,
86-
only two types will work well: need to publish or need to delete.
87-
<TODO>: robust enhance, branch check, etc."
79+
"Get modified/deleted org files from git repositoryin REPO-DIR.
80+
Diff based on BASE-COMMIT.
81+
The return value is a property list, property :update maps a list of
82+
updated/added files, property :delete maps a list of deleted files.
83+
For git, there are three types: Added, Modified, Deleted, but for
84+
org-page, only two types will work well: need to publish or need to
85+
delete. <TODO>: robust enhance, branch check, etc."
8886
(let* ((org-file-ext ".org")
8987
(git-repo (file-name-as-directory repo-dir))
9088
(output (git-run "diff" "--name-status" base-commit "HEAD"))
@@ -99,26 +97,26 @@ only two types will work well: need to publish or need to delete.
9997
(list :update upd-list :delete del-list)))
10098

10199
(defun op/git-last-change-date (repo-dir filepath)
102-
"This function will return the last commit date of a file in git repository
103-
presented by REPO-DIR, FILEPATH is the path of target file, can be absolute or
104-
relative."
100+
"Return the last commit date of a file in git repository REPO-DIR.
101+
FILEPATH is the path of target file, can be absolute or relative."
105102
(let* ((git-repo repo-dir)
106103
(output (git-run "log" "-1" "--format=\"%ci\"" "--" filepath)))
107104
(when (string-match "\\`\"\\([0-9]+-[0-9]+-[0-9]+\\) .*\"\n\\'" output)
108105
(match-string 1 output))))
109106

110107
(defun op/git-remote-name (repo-dir)
111-
"This function will return all remote repository names of git repository
112-
presented by REPO-DIR, return nil if there is no remote repository."
108+
"Return all remote repository names of git repository REPO-DIR.
109+
Return nil if there is no remote repository."
113110
(let ((git-repo repo-dir))
114111
(git-remotes)))
115112

116113
(defun op/git-push-remote (repo-dir remote-repo branch)
117-
"This function will push local branch to remote repository, REPO-DIR is the
118-
local git repository, REMOTE-REPO is the remote repository, BRANCH is the name
119-
of branch will be pushed (the branch name will be the same both in local and
120-
remote repository), and if there is no branch named BRANCH in remote repository,
121-
it will be created."
114+
"Push local branch to remote repository.
115+
REPO-DIR is the local git repository. REMOTE-REPO is the remote
116+
repository. BRANCH is the name of branch will be pushed (the branch
117+
name will be the same both in local and remote repository), and if
118+
there is no branch named BRANCH in remote repository, it will be
119+
created."
122120
(let ((git-repo repo-dir))
123121
(git-push remote-repo branch)))
124122

0 commit comments

Comments
 (0)