FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gitlogdiff.nvim/lua/gitlogdiff/log.lua at main · Salanoid/gitlogdiff.nvim · GitHub
Salanoid
/
gitlogdiff.nvim
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
24
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
gitlogdiff.nvim
/
lua
/
gitlogdiff
/
log.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (31 loc) · 813 Bytes
Breadcrumbs
gitlogdiff.nvim
/
lua
/
gitlogdiff
/
log.lua
Copy path
File metadata and controls
36 lines (31 loc) · 813 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local
M
=
{}
function
M
.
get_commits
(
cb
)
local
cfg
=
require
(
"
gitlogdiff
"
).
config
or
{}
local
max_count
=
tonumber
(
cfg
.
max_count
)
local
args
=
{
"
git
"
,
"
log
"
,
string.format
(
"
--max-count=%d
"
,
max_count
),
"
--pretty=format:%h %ad %s
"
,
"
--date=short
"
,
"
--color=never
"
,
}
vim
.
system
(
args
, {
text
=
true
},
function
(
res
)
if
res
.
code
~=
0
then
local
err
=
(
res
.
stderr
or
"
"
):
gsub
(
"
\n
$
"
,
"
"
)
vim
.
schedule
(
function
()
vim
.
notify
(
(
#
err
>
0
)
and
(
"
git log failed:
"
..
err
)
or
"
git log failed (are you in a git repo?)
"
,
vim
.
log
.
levels
.
WARN
)
cb
({})
end
)
return
end
local
commits
=
vim
.
split
(
res
.
stdout
,
"
\n
"
, {
trimempty
=
true
})
vim
.
schedule
(
function
()
cb
(
commits
)
end
)
end
)
end
return
M
Back
|
FazBrowse Home
|
New Git URL