cherrypick-interactive 1.9.0 → 1.10.1
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 +6 -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
|
@@ -21,6 +21,7 @@ const pkg = JSON.parse(readFileSync(join(__dirname, 'package.json'), 'utf8'));
|
|
|
21
21
|
|
|
22
22
|
const notifier = updateNotifier({
|
|
23
23
|
pkg,
|
|
24
|
+
updateCheckInterval: 1000 * 60 * 60, // 1 hour
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
// Only print if a *real* newer version exists
|
|
@@ -283,16 +284,16 @@ async function getSubjects(branch) {
|
|
|
283
284
|
}
|
|
284
285
|
|
|
285
286
|
async function getDevCommits(branch, since) {
|
|
286
|
-
const
|
|
287
|
+
const SEP = '|||';
|
|
288
|
+
const out = await gitRaw(['log', '--no-merges', `--since=${since}`, `--pretty=%H${SEP}%ar${SEP}%s`, branch]);
|
|
287
289
|
|
|
288
290
|
if (!out) {
|
|
289
291
|
return [];
|
|
290
292
|
}
|
|
291
293
|
return out.split('\n').map((line) => {
|
|
292
|
-
const
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
return { hash, subject };
|
|
294
|
+
const [hash, date, ...rest] = line.split(SEP);
|
|
295
|
+
const subject = rest.join(SEP);
|
|
296
|
+
return { hash, subject, date: date || '' };
|
|
296
297
|
});
|
|
297
298
|
}
|
|
298
299
|
|
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
|
`;
|