cherrypick-interactive 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +5 -5
- package/package.json +1 -1
- package/src/tui/CommitList.js +1 -0
- package/src/tui/CommitRow.js +5 -3
- package/src/tui/Header.js +4 -4
package/cli.js
CHANGED
|
@@ -283,16 +283,16 @@ async function getSubjects(branch) {
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
async function getDevCommits(branch, since) {
|
|
286
|
-
const
|
|
286
|
+
const SEP = '|||';
|
|
287
|
+
const out = await gitRaw(['log', '--no-merges', `--since=${since}`, `--pretty=%H${SEP}%ar${SEP}%s`, branch]);
|
|
287
288
|
|
|
288
289
|
if (!out) {
|
|
289
290
|
return [];
|
|
290
291
|
}
|
|
291
292
|
return out.split('\n').map((line) => {
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
return { hash, subject };
|
|
293
|
+
const [hash, date, ...rest] = line.split(SEP);
|
|
294
|
+
const subject = rest.join(SEP);
|
|
295
|
+
return { hash, subject, date: date || '' };
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
|
package/package.json
CHANGED
package/src/tui/CommitList.js
CHANGED
package/src/tui/CommitRow.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Text, Box } from 'ink';
|
|
1
|
+
import { Text, Box, Spacer } from 'ink';
|
|
2
2
|
import { html } from './html.js';
|
|
3
3
|
|
|
4
|
-
export function CommitRow({ hash, subject, isSelected, isCursor }) {
|
|
4
|
+
export function CommitRow({ hash, subject, date, isSelected, isCursor }) {
|
|
5
5
|
const checkbox = isSelected ? '☑' : '☐';
|
|
6
6
|
const checkColor = isSelected ? 'green' : 'gray';
|
|
7
7
|
const cursor = isCursor ? '>' : ' ';
|
|
@@ -13,7 +13,9 @@ export function CommitRow({ hash, subject, isSelected, isCursor }) {
|
|
|
13
13
|
<${Text} color=${cursorColor}>${cursor} </${Text}>
|
|
14
14
|
<${Text} color=${checkColor}>${checkbox} </${Text}>
|
|
15
15
|
<${Text} color="dim">${hash.slice(0, 7)} </${Text}>
|
|
16
|
-
<${Text} color=${subjectColor}>${subject}</${Text}>
|
|
16
|
+
<${Text} color=${subjectColor} wrap="truncate">${subject}</${Text}>
|
|
17
|
+
<${Spacer} />
|
|
18
|
+
<${Text} color="dim">${date}</${Text}>
|
|
17
19
|
</${Box}>
|
|
18
20
|
`;
|
|
19
21
|
}
|
package/src/tui/Header.js
CHANGED
|
@@ -3,11 +3,11 @@ import { html } from './html.js';
|
|
|
3
3
|
|
|
4
4
|
export function Header({ devBranch, mainBranch, commitCount, since }) {
|
|
5
5
|
return html`
|
|
6
|
-
<${Box}
|
|
7
|
-
<${Text} color="cyan">${devBranch} → ${mainBranch}</${Text}>
|
|
8
|
-
<${Text}>
|
|
6
|
+
<${Box} paddingX=${1}>
|
|
7
|
+
<${Text} color="cyan" bold>${devBranch} → ${mainBranch}</${Text}>
|
|
8
|
+
<${Text} color="gray"> | </${Text}>
|
|
9
9
|
<${Text} color="yellow">${commitCount} missing</${Text}>
|
|
10
|
-
<${Text}>
|
|
10
|
+
<${Text} color="gray"> | </${Text}>
|
|
11
11
|
<${Text} color="gray">Since: ${since}</${Text}>
|
|
12
12
|
</${Box}>
|
|
13
13
|
`;
|