Skip to content

Commit 56ebf80

Browse files
committed
Add changeset, remove long running integration test
1 parent 54c41a4 commit 56ebf80

File tree

3 files changed

+30
-48
lines changed

3 files changed

+30
-48
lines changed

.changeset/eight-apes-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'simple-git': minor
3+
---
4+
5+
Timeout plugin can now be configured to ignore data on either stdOut or stdErr in the git process when determining whether to kill the spawned process.

docs/PLUGIN-TIMEOUT.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ To handle the case where the underlying `git` processes appear to hang, configur
88
import { simpleGit, GitPluginError, SimpleGit, SimpleGitProgressEvent } from 'simple-git';
99

1010
const git: SimpleGit = simpleGit({
11-
baseDir: '/some/path',
1211
timeout: {
1312
block: 2000,
1413
},
@@ -39,10 +38,9 @@ Configure this with the optional `stdOut` and `stdErr` properties of the `timeou
3938
configuration:
4039

4140
```typescript
42-
import { simpleGit, GitPluginError, SimpleGit, SimpleGitProgressEvent } from "simple-git";
41+
import { simpleGit, SimpleGit } from "simple-git";
4342

4443
const git: SimpleGit = simpleGit({
45-
baseDir: "/some/path",
4644
progress({method, stage, progress}) {
4745
console.log(`git.${method} ${stage} stage ${progress}% complete`);
4846
},
@@ -54,3 +52,27 @@ const git: SimpleGit = simpleGit({
5452
});
5553

5654
```
55+
56+
## Absolute or Block Timeouts
57+
58+
The timeout plugin will reset its timers whenever data is received meaning the plugin will
59+
only kill processes that appear to be hanging and allow intentionally long-running processes
60+
to continue uninterrupted.
61+
62+
To change this default behaviour so that the plugin kills all processes after the supplied
63+
timeout, configure it so the plugin doesn't listen for data updates by supplying the optional
64+
`stdOut` and `stdErr` properties of the `timeout` plugin configuration:
65+
66+
```typescript
67+
import { simpleGit, SimpleGit } from "simple-git";
68+
69+
// create a simple-git instance that kills any process after 5s
70+
// whether it's still receiving data or not:
71+
const git: SimpleGit = simpleGit({
72+
timeout: {
73+
block: 5000,
74+
stdOut: false,
75+
stdErr: false
76+
}
77+
});
78+
```

simple-git/test/integration/timeout-progress-combo.spec.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)