Skip to content

Commit bab5204

Browse files
AtkinsSJKernelDeimos
authored andcommitted
feat(git): Color output for git status files
Matching canonical git, staged changes are green and unstaged/untracked are red.
1 parent 4ba8a32 commit bab5204

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/git/src/subcommands/status.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ export default {
123123
if (staged.length) {
124124
stdout('Changes to be committed:');
125125
for (const [file, change] of staged) {
126-
stdout(` ${change}: ${padding(10 - change.length)}${file}`);
126+
stdout(chalk.greenBright(` ${change}: ${padding(10 - change.length)}${file}`));
127127
}
128128
stdout('');
129129
}
130130

131131
if (unstaged.length) {
132132
stdout('Changes not staged for commit:');
133133
for (const [file, change] of unstaged) {
134-
stdout(` ${change}: ${padding(10 - change.length)}${file}`);
134+
stdout(chalk.redBright(` ${change}: ${padding(10 - change.length)}${file}`));
135135
}
136136
stdout('');
137137
}
@@ -140,7 +140,7 @@ export default {
140140
stdout('Untracked files:');
141141
// TODO: Native git is smart enough to only list a top-level directory if all its contents are untracked
142142
for (const file of untracked) {
143-
stdout(` ${file}`);
143+
stdout(chalk.redBright(` ${file}`));
144144
}
145145
}
146146

0 commit comments

Comments
 (0)