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 CHANGED
@@ -283,16 +283,16 @@ async function getSubjects(branch) {
283
283
  }
284
284
 
285
285
  async function getDevCommits(branch, since) {
286
- const out = await gitRaw(['log', '--no-merges', `--since=${since}`, '--pretty=%H %s', branch]);
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 firstSpace = line.indexOf(' ');
293
- const hash = line.slice(0, firstSpace);
294
- const subject = line.slice(firstSpace + 1);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cherrypick-interactive",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Interactively cherry-pick commits that are in dev but not in main, using subject-based comparison.",
5
5
  "main": "cli.js",
6
6
  "bin": "cli.js",
@@ -15,6 +15,7 @@ export function CommitList({ commits, selected, cursorIndex }) {
15
15
  key=${c.hash}
16
16
  hash=${c.hash}
17
17
  subject=${c.subject}
18
+ date=${c.date || ''}
18
19
  isSelected=${selected.has(c.hash)}
19
20
  isCursor=${start + i === cursorIndex}
20
21
  />
@@ -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} borderStyle="single" borderColor="cyan" paddingX=${1}>
7
- <${Text} color="cyan">${devBranch} → ${mainBranch}</${Text}>
8
- <${Text}> </${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}> </${Text}>
10
+ <${Text} color="gray"> | </${Text}>
11
11
  <${Text} color="gray">Since: ${since}</${Text}>
12
12
  </${Box}>
13
13
  `;