Skip to content

Commit b0aea0f

Browse files
committed
TEMP
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 56e1530 commit b0aea0f

File tree

4 files changed

+46
-7
lines changed

4 files changed

+46
-7
lines changed

.vscode/launch.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "ts-node",
9+
"type": "node",
10+
"request": "launch",
11+
"args": [
12+
"${relativeFile}" //
13+
],
14+
"runtimeArgs": [
15+
"-r", //
16+
"ts-node/register"
17+
],
18+
"cwd": "${workspaceRoot}",
19+
"protocol": "inspector",
20+
"internalConsoleOptions": "openOnSessionStart",
21+
"env": {
22+
"DEBUG": "gsr:*"
23+
}
24+
}
25+
]
26+
}

git-stacked-rebase.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ export const gitStackedRebase = async (
202202
autoApplyIfNeeded: configValues.autoApplyIfNeeded,
203203
config,
204204
});
205+
console.log({ neededToApply, userAllowedToApplyAndWeApplied });
205206

206207
if (neededToApply && !userAllowedToApplyAndWeApplied) {
207208
return;

parse-todo-of-stacked-rebase/parseNewGoodCommands.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ export function parseNewGoodCommands(
4545
const last = newCommits.length - 1;
4646

4747
if (newCommits.length && newSHA === newCommits[last].newSHA) {
48+
/**
49+
* accumulating - if multiple commits got molded into 1
50+
*/
4851
newCommits[last].oldSHAs.push(oldSHA);
4952
} else {
53+
/**
54+
* initializing a new commit
55+
*/
5056
newCommits.push({
5157
newSHA,
5258
oldSHAs: [oldSHA],

test/experiment.spec.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ export async function testCase() {
3131
} = await setupRepo();
3232

3333
const config: Git.Config = await repo.config();
34-
config.setBool(configKeys.autoApplyIfNeeded, Git.Config.MAP.FALSE);
34+
35+
await config.setBool(configKeys.autoApplyIfNeeded, Git.Config.MAP.FALSE);
36+
await config.setString("user.email", "tester@test.com");
37+
await config.setString("user.name", "tester");
3538

3639
const commitOidsInInitial: Git.Oid[] = [];
3740
const initialBranch: Git.Reference = await appendCommitsTo(commitOidsInInitial, 3, repo, sig);
@@ -46,7 +49,10 @@ export async function testCase() {
4649

4750
const execSyncInRepo = createExecSyncInRepo(repo);
4851

49-
execSyncInRepo("read");
52+
// const read = () => execSyncInRepo("read");
53+
const read = () => void 0;
54+
55+
read();
5056

5157
const commitOidsInLatestStacked: Git.Oid[] = [];
5258
await appendCommitsTo(commitOidsInLatestStacked, 12, repo, sig);
@@ -75,12 +81,12 @@ export async function testCase() {
7581

7682
log("finished editor");
7783

78-
execSyncInRepo("read");
84+
read();
7985
},
8086
});
8187

8288
log("looking up branches to make sure they were created successfully");
83-
execSyncInRepo("read");
89+
read();
8490
for (const [newPartial] of newPartialBranches) {
8591
/**
8692
* will throw if branch does not exist
@@ -93,7 +99,7 @@ export async function testCase() {
9399
*
94100
*/
95101
log("launching 2nd rebase to change command of nth commit");
96-
execSyncInRepo("read");
102+
read();
97103

98104
const nthCommit2ndRebase = 5;
99105

@@ -120,7 +126,7 @@ export async function testCase() {
120126
execSyncInRepo(`${defaultGitCmd} rebase --continue`);
121127

122128
execSyncInRepo(`${defaultGitCmd} status`);
123-
execSyncInRepo("read");
129+
read();
124130

125131
/**
126132
* now some partial branches will be "gone" from the POV of the latestBranch<->initialBranch.
@@ -136,7 +142,7 @@ export async function testCase() {
136142
*/
137143

138144
log("attempting early 3rd rebase to --apply");
139-
execSyncInRepo("read");
145+
read();
140146

141147
await gitStackedRebase(initialBranch.shorthand(), {
142148
gitDir: dir,

0 commit comments

Comments
 (0)