1 |
|
2 | # Change History & Release Notes
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | ## 2.10.0 - trailing options in checkout, init, status, reset & bug-fix awaiting a non-task
|
8 |
|
9 | - `git.checkout` now supports both object and array forms of supplying trailing options.
|
10 |
|
11 | ```typescript
|
12 | import simpleGit from 'simple-git';
|
13 | await simpleGit().checkout('branch-name', ['--track', 'remote/branch']);
|
14 | await simpleGit().checkout(['branch-name', '--track', 'remote/branch']);
|
15 | await simpleGit().checkout({'branch-name': null});
|
16 | ```
|
17 |
|
18 | - `git.init` now supports both object and array forms of supplying trailing options and now
|
19 | parses the response to return an [InitResult](./typings/response.d.ts);
|
20 |
|
21 | ```typescript
|
22 | import simpleGit, { InitResult } from 'simple-git';
|
23 | const notSharedInit: InitResult = await simpleGit().init(false, ['--shared=false']);
|
24 | const notSharedBareInit: InitResult = await simpleGit().init(['--bare', '--shared=false']);
|
25 | const sharedInit: InitResult = await simpleGit().init(false, {'--shared': 'true'});
|
26 | const sharedBareInit: InitResult = await simpleGit().init({'--bare': null, '--shared': 'false'});
|
27 | ```
|
28 |
|
29 | - `git.status` now supports both object and array forms of supplying trailing options.
|
30 |
|
31 | ```typescript
|
32 | import simpleGit, { StatusResult } from 'simple-git';
|
33 | const repoStatus: StatusResult = await simpleGit().status();
|
34 | const subDirStatus: StatusResult = await simpleGit().status(['--', 'sub-dir']);
|
35 | ```
|
36 |
|
37 | - `git.reset` upgraded to the new task style and exports an enum `ResetMode` with all supported
|
38 | merge modes and now supports both object and array forms of supplying trailing options.
|
39 |
|
40 | ```typescript
|
41 | import simpleGit, { ResetMode } from 'simple-git';
|
42 |
|
43 | // git reset --hard
|
44 | await simpleGit().reset(ResetMode.HARD);
|
45 |
|
46 | // git reset --soft -- sub-dir
|
47 | await simpleGit().reset(ResetMode.SOFT, ['--', 'sub-dir']);
|
48 | ```
|
49 |
|
50 | - bug-fix: it should not be possible to await the `simpleGit()` task runner, only the tasks it returns.
|
51 |
|
52 | ```typescript
|
53 | expect(simpleGit().then).toBeUndefined();
|
54 | expect(simpleGit().init().then).toBe(expect.any(Function));
|
55 | ```
|
56 |
|
57 | ## 2.9.0 - checkIsRepo, rev-parse
|
58 |
|
59 | - `.checkIsRepo()` updated to allow choosing the type of check to run, either by using the exported `CheckRepoActions` enum
|
60 | or the text equivalents ('bare', 'root' or 'tree'):
|
61 | - `checkIsRepo(CheckRepoActions.BARE): Promise<boolean>` determines whether the working directory represents a bare repo.
|
62 | - `checkIsRepo(CheckRepoActions.IS_REPO_ROOT): Promise<boolean>` determines whether the working directory is at the root of a repo.
|
63 | - `checkIsRepo(CheckRepoActions.IN_TREE): Promise<boolean>` determines whether the working directory is a descendent of a git root.
|
64 |
|
65 | - `.revparse()` converted to a new style task
|
66 |
|
67 | ## 2.8.0 - Support for `default` import in TS without use of `esModuleInterop`
|
68 |
|
69 | - Enables support for using the default export of `simple-git` as an es module, in TypeScript it is no
|
70 | longer necessary to enable the `esModuleInterop` flag in the `tsconfig.json` to consume the default
|
71 | export.
|
72 |
|
73 | ### 2.7.2 - Bug Fix: Remove `promise.ts` source from `simple-git` published artifact
|
74 |
|
75 | - Closes #471, whereby the source for the promise wrapped runner would be included in the published artifact
|
76 | due to sharing the same name as the explicitly included `promise.js` in the project root.
|
77 |
|
78 | ### 2.7.1 - Bug Fix: `await git.log` having imported from root `simple-git`
|
79 |
|
80 | - Fixes #464, whereby using `await` on `git.log` without having supplied a callback would ignore the leading options
|
81 | object or options array.
|
82 |
|
83 | ## 2.7.0 - Output Handler and logging
|
84 |
|
85 | - Updated to the `outputHandler` type to add a trailing argument for the arguments passed into the child process.
|
86 | - All logging now uses the [debug](https://www.npmjs.com/package/debug) library. Enable logging by adding `simple-git`
|
87 | to the `DEBUG` environment variable. `git.silent(false)` can still be used to explicitly enable logging and is
|
88 | equivalent to calling `require('debug').enable('simple-git')`.
|
89 |
|
90 | ## 2.6.0 - Native Promises, Typed Errors, TypeScript Importing, Git.clean and Git.raw
|
91 |
|
92 | ### Native Promises
|
93 |
|
94 | - _TL;DR - `.then` and `.catch` can now be called on the standard `simpleGit` chain to handle the promise
|
95 | returned by the most recently added task... essentially, promises now just work the way you would expect
|
96 | them to._
|
97 | - The main export from `simple-git` no longer shows the deprecation notice for using the
|
98 | `.then` function, it now exposes the promise chain generated from the most recently run
|
99 | task, allowing the combination of chain building and ad-hoc splitting off to a new promise chain.
|
100 | - See the [unit](./test/unit/promises.spec.js) and [integration](./test/integration/promise-from-root.spec.js) tests.
|
101 | - See the [typescript consumer](./test/consumer/ts-default-from-root.spec.ts) test.
|
102 |
|
103 | ### TypeScript Importing
|
104 |
|
105 | - Promise / async interface and TypeScript types all available from the `simple-git` import rather than needing
|
106 | `simple-git/promise`, see examples in the [ReadMe](./readme.md) or in the [consumer tests](./test/consumer).
|
107 |
|
108 | ### Typed Errors
|
109 |
|
110 | - Tasks that previously validated their usage and rejected with a `TypeError` will now reject with a
|
111 | [`TaskConfigurationError`](./src/lib/errors/task-configuration-error.ts).
|
112 |
|
113 | - Tasks that previously rejected with a custom object (currently only `git.merge` when the auto-merge fails)
|
114 | will now reject with a [`GitResponseError`](./src/lib/errors/git-response-error.ts) where previously it
|
115 | was a modified `Error`.
|
116 |
|
117 | ### Git Clean
|
118 |
|
119 | - `git.clean(...)` will now return a `CleanSummary` instead of the raw string data
|
120 |
|
121 | ### Git Raw
|
122 |
|
123 | - `git.raw(...)` now accepts any number of leading string arguments as an alternative to the
|
124 | single array of strings.
|
125 |
|
126 | ## 2.5.0 - Git.remote
|
127 |
|
128 | - all `git.remote` related functions converted to TypeScript
|
129 |
|
130 | ## 2.4.0 - Git.subModule
|
131 |
|
132 | - all `git.subModule` related functions converted to TypeScript
|
133 |
|
134 | ## 2.3.0 - Git.config
|
135 |
|
136 | - add new `git.listConfig` to get current configuration
|
137 | - `git.addConfig` supports a new `append` flag to append the value into the config rather than overwrite existing
|
138 |
|
139 | ## 2.2.0 - Git.branch
|
140 |
|
141 | - all `git.branch` related functions converted to TypeScript
|
142 | - add new `git.deleteLocalBranches` to delete multiple branches in one call
|
143 | - `git.deleteLocalBranches` and `git.deleteLocalBranch` now support an optional `forceDelete` flag
|
144 |
|
145 | ## 2.1.0 - Git.tag
|
146 |
|
147 | - `.tags`, `.addTag` and `.addAnnotatedTag` converted to TypeScript, no backward compatibility changes
|
148 |
|
149 | ## 2.0.0 - Incremental switch to TypeScript and rewritten task execution
|
150 |
|
151 | - If your application depended on any functions with a name starting with an `_`, the upgrade may not be seamless,
|
152 | please only use the documented public API.
|
153 |
|
154 | - `git.log` date format is now strict ISO by default (ie: uses the placeholder `%aI`) instead of the 1.x default of
|
155 | `%ai` for an "ISO-like" date format. To restore the old behaviour, add `strictDate = false` to the options passed to
|
156 | `git.log`.
|
157 |
|
158 |
|
159 | ## 1.110.0 - ListLogLine
|
160 |
|
161 | - The default format expression used in `.log` splits ref data out of the `message` into a property of its own: `{ message: 'Some commit message (some-branch-name)' }` becomes `{ message: 'Some commit message', refs: 'some-branch-name' }` |
|
162 | - The commit body content is now included in the default format expression and can be used to identify the content of merge conflicts eg: `{ body: '# Conflicts:\n# some-file.txt' }` |
|
163 |
|
164 |
|
165 | ## 1.0.0
|
166 |
|
167 | Bumped to a new major revision in the 1.x branch, now uses `ChildProcess.spawn` in place of `ChildProcess.exec` to
|
168 | add escaping to the arguments passed to each of the tasks.
|
169 |
|