Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vnotepad
Exa
提交
80b0d9dd
E
Exa
项目概览
vnotepad
/
Exa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Exa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
80b0d9dd
编写于
11月 20, 2018
作者:
A
ariasuni
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Display if a file is ignored by git
上级
485611e7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
3 deletion
+12
-3
README.md
README.md
+1
-1
src/fs/feature/git.rs
src/fs/feature/git.rs
+1
-0
src/fs/fields.rs
src/fs/fields.rs
+3
-0
src/options/help.rs
src/options/help.rs
+1
-1
src/output/render/git.rs
src/output/render/git.rs
+3
-0
src/style/colours.rs
src/style/colours.rs
+3
-1
未找到文件。
README.md
浏览文件 @
80b0d9dd
...
...
@@ -52,7 +52,7 @@ These options are available when running with --long (`-l`):
-
**-u**
,
**--accessed**
: use the accessed timestamp field
-
**-U**
,
**--created**
: use the created timestamp field
-
**-@**
,
**--extended**
: list each file's extended attributes and sizes
-
**--git**
: list each file's Git status, if tracked
-
**--git**
: list each file's Git status, if tracked
or ignored
-
**--time-style**
: how to format timestamps
-
Valid
**--color**
options are
**always**
,
**automatic**
, and
**never**
.
...
...
src/fs/feature/git.rs
浏览文件 @
80b0d9dd
...
...
@@ -279,6 +279,7 @@ fn working_tree_status(status: git2::Status) -> f::GitStatus {
s
if
s
.contains
(
git2
::
Status
::
WT_DELETED
)
=>
f
::
GitStatus
::
Deleted
,
s
if
s
.contains
(
git2
::
Status
::
WT_RENAMED
)
=>
f
::
GitStatus
::
Renamed
,
s
if
s
.contains
(
git2
::
Status
::
WT_TYPECHANGE
)
=>
f
::
GitStatus
::
TypeChange
,
s
if
s
.contains
(
git2
::
Status
::
IGNORED
)
=>
f
::
GitStatus
::
Ignored
,
_
=>
f
::
GitStatus
::
NotModified
,
}
}
...
...
src/fs/fields.rs
浏览文件 @
80b0d9dd
...
...
@@ -197,6 +197,9 @@ pub enum GitStatus {
/// A file that’s had its type (such as the file permissions) changed.
TypeChange
,
/// A file that’s ignored (that matches a line in .gitignore)
Ignored
,
}
/// A file’s complete Git status. It’s possible to make changes to a file, add
...
...
src/options/help.rs
浏览文件 @
80b0d9dd
...
...
@@ -50,7 +50,7 @@ LONG VIEW OPTIONS
-U, --created use the created timestamp field
--time-style how to format timestamps (default, iso, long-iso, full-iso)"##
;
static
GIT_HELP
:
&
str
=
r##" --git list each file's Git status, if tracked"##
;
static
GIT_HELP
:
&
str
=
r##" --git list each file's Git status, if tracked
or ignored
"##
;
static
EXTENDED_HELP
:
&
str
=
r##" -@, --extended list each file's extended attributes and sizes"##
;
...
...
src/output/render/git.rs
浏览文件 @
80b0d9dd
...
...
@@ -26,6 +26,7 @@ impl f::GitStatus {
f
::
GitStatus
::
Deleted
=>
colours
.deleted
()
.paint
(
"D"
),
f
::
GitStatus
::
Renamed
=>
colours
.renamed
()
.paint
(
"R"
),
f
::
GitStatus
::
TypeChange
=>
colours
.type_change
()
.paint
(
"T"
),
f
::
GitStatus
::
Ignored
=>
colours
.ignored
()
.paint
(
"I"
),
}
}
}
...
...
@@ -38,6 +39,7 @@ pub trait Colours {
fn
deleted
(
&
self
)
->
Style
;
fn
renamed
(
&
self
)
->
Style
;
fn
type_change
(
&
self
)
->
Style
;
fn
ignored
(
&
self
)
->
Style
;
}
...
...
@@ -60,6 +62,7 @@ pub mod test {
fn
deleted
(
&
self
)
->
Style
{
Fixed
(
93
)
.normal
()
}
fn
renamed
(
&
self
)
->
Style
{
Fixed
(
94
)
.normal
()
}
fn
type_change
(
&
self
)
->
Style
{
Fixed
(
95
)
.normal
()
}
fn
ignored
(
&
self
)
->
Style
{
Fixed
(
96
)
.normal
()
}
}
...
...
src/style/colours.rs
浏览文件 @
80b0d9dd
...
...
@@ -101,6 +101,7 @@ pub struct Git {
pub
deleted
:
Style
,
pub
renamed
:
Style
,
pub
typechange
:
Style
,
pub
ignored
:
Style
,
}
impl
Colours
{
...
...
@@ -177,6 +178,7 @@ impl Colours {
deleted
:
Red
.normal
(),
renamed
:
Yellow
.normal
(),
typechange
:
Purple
.normal
(),
ignored
:
Style
::
default
()
.dimmed
(),
},
punctuation
:
Fixed
(
244
)
.normal
(),
...
...
@@ -326,6 +328,7 @@ impl render::GitColours for Colours {
fn
deleted
(
&
self
)
->
Style
{
self
.git.deleted
}
fn
renamed
(
&
self
)
->
Style
{
self
.git.renamed
}
fn
type_change
(
&
self
)
->
Style
{
self
.git.typechange
}
fn
ignored
(
&
self
)
->
Style
{
self
.git.ignored
}
}
impl
render
::
GroupColours
for
Colours
{
...
...
@@ -400,4 +403,3 @@ impl FileNameColours for Colours {
fn
symlink_path
(
&
self
)
->
Style
{
self
.symlink_path
}
fn
executable_file
(
&
self
)
->
Style
{
self
.filekinds.executable
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录