finch-git-branch 0.2.10 → 0.2.11
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/dist/index.js +12 -6
- package/i18n/en-US.json +2 -0
- package/i18n/zh-CN.json +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -146,7 +146,7 @@ export function activate(ctx) {
|
|
|
146
146
|
return await ctx.storage.get(CURRENT_BRANCH_KEY);
|
|
147
147
|
},
|
|
148
148
|
async getReminder({ cwd, surface }) {
|
|
149
|
-
if (surface === 'home' || !cwd || !isGitRepo(cwd) || (await ctx.storage.get(CO_AUTHOR_ENABLED_KEY))
|
|
149
|
+
if (surface === 'home' || !cwd || !isGitRepo(cwd) || (await ctx.storage.get(CO_AUTHOR_ENABLED_KEY)) !== true) {
|
|
150
150
|
return undefined;
|
|
151
151
|
}
|
|
152
152
|
return `When creating any Git commit, append a blank line followed by the exact trailer: ${await getCoAuthorTrailer(ctx)}`;
|
|
@@ -177,7 +177,7 @@ export function activate(ctx) {
|
|
|
177
177
|
if (desc)
|
|
178
178
|
pinnedDiffs.set(b, desc);
|
|
179
179
|
}));
|
|
180
|
-
const coAuthorEnabled = await ctx.storage.get(CO_AUTHOR_ENABLED_KEY)
|
|
180
|
+
const coAuthorEnabled = await ctx.storage.get(CO_AUTHOR_ENABLED_KEY) === true;
|
|
181
181
|
const { assistantName } = await ctx.app.getInfo();
|
|
182
182
|
const items = [{
|
|
183
183
|
id: '__toggle_co_author__',
|
|
@@ -248,8 +248,14 @@ export function activate(ctx) {
|
|
|
248
248
|
if (!cwd || !itemId)
|
|
249
249
|
return;
|
|
250
250
|
if (itemId === '__toggle_co_author__') {
|
|
251
|
-
const enabled = await ctx.storage.get(CO_AUTHOR_ENABLED_KEY)
|
|
252
|
-
|
|
251
|
+
const enabled = await ctx.storage.get(CO_AUTHOR_ENABLED_KEY) === true;
|
|
252
|
+
const next = !enabled;
|
|
253
|
+
await ctx.storage.set(CO_AUTHOR_ENABLED_KEY, next);
|
|
254
|
+
await ctx.ui.showToast({
|
|
255
|
+
title: ctx.i18n.t(next ? 'git.branch.coauthor.tip.on' : 'git.branch.coauthor.tip.off'),
|
|
256
|
+
variant: next ? 'success' : 'info',
|
|
257
|
+
position: 'TC',
|
|
258
|
+
});
|
|
253
259
|
composerAction.notifyUpdate();
|
|
254
260
|
return;
|
|
255
261
|
}
|
|
@@ -283,7 +289,7 @@ export function activate(ctx) {
|
|
|
283
289
|
await git(cwd, [
|
|
284
290
|
'commit', '-m',
|
|
285
291
|
ctx.i18n.t('git.branch.switch.commit.msg', { branch: itemId }),
|
|
286
|
-
...(await ctx.storage.get(CO_AUTHOR_ENABLED_KEY)
|
|
292
|
+
...(await ctx.storage.get(CO_AUTHOR_ENABLED_KEY) === true
|
|
287
293
|
? ['-m', await getCoAuthorTrailer(ctx)]
|
|
288
294
|
: []),
|
|
289
295
|
]);
|
|
@@ -372,7 +378,7 @@ export function activate(ctx) {
|
|
|
372
378
|
await git(cwd, [
|
|
373
379
|
'commit', '-m',
|
|
374
380
|
`checkpoint: before creating branch ${branchName}`,
|
|
375
|
-
...(await ctx.storage.get(CO_AUTHOR_ENABLED_KEY)
|
|
381
|
+
...(await ctx.storage.get(CO_AUTHOR_ENABLED_KEY) === true
|
|
376
382
|
? ['-m', await getCoAuthorTrailer(ctx)]
|
|
377
383
|
: []),
|
|
378
384
|
]);
|
package/i18n/en-US.json
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"git.branch.coauthor.label": "Include {finchName} as code co-author",
|
|
15
15
|
"git.branch.coauthor.on": "On",
|
|
16
16
|
"git.branch.coauthor.off": "Off",
|
|
17
|
+
"git.branch.coauthor.tip.on": "Code Co-authored enabled, takes effect in a new session",
|
|
18
|
+
"git.branch.coauthor.tip.off": "Code Co-authored disabled, takes effect in a new session",
|
|
17
19
|
"git.branch.changes": "{count} changes",
|
|
18
20
|
"git.branch.more": "More branches",
|
|
19
21
|
"git.branch.more.group": "Branches",
|
package/i18n/zh-CN.json
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"git.branch.coauthor.label": "包含 {finchName} 作为代码协作者",
|
|
15
15
|
"git.branch.coauthor.on": "已开启",
|
|
16
16
|
"git.branch.coauthor.off": "已关闭",
|
|
17
|
+
"git.branch.coauthor.tip.on": "Code Co-authored 已开启,开启新会话生效",
|
|
18
|
+
"git.branch.coauthor.tip.off": "Code Co-authored 已关闭,开启新会话生效",
|
|
17
19
|
"git.branch.changes": "{count} 个改动",
|
|
18
20
|
"git.branch.more": "更多分支",
|
|
19
21
|
"git.branch.more.group": "分支",
|