2.48.0 (2021-12-01)
StatusResult
returned bygit.status()
should includedetached
state of the working copy. (#695) (f464ebe)
- Add example for empty commit message in
git.commit()
(61089cb)
2.47.1 (2021-11-29)
2.47.0 (2021-10-19)
- git-grep (653065e)
2.46.0 (2021-09-29)
completion
plugin (#684) (ecb7bd6)completion
plugin to allow configuring whensimple-git
determines thegit
tasks to be complete. (ecb7bd6)
2.45.1 (2021-09-04)
- support progress events in locales other than western european character sets. (8cc42f8)
2.45.0 (2021-08-27)
- Use author email field that respects mailmap (589d624)
- getConfig always returns
null
despite values being present in configuration (9fd483a)
2.44.0 (2021-08-14)
- add support for getting the current value of a git configuration setting based on its name. (1d09204)
2.43.0 (2021-08-13)
- task callback types defined as single function type (b0a832c)
2.42.0 (2021-07-31)
- move
log
task to separate task builder (0712f86) - support
scope
argument inlistConfig
to return a specific scope's configuration (0685a8b)
2.41.2 (2021-07-29)
- use literal
true
andfalse
inDiffResultTextFile | DiffResultBinaryFile
to aid type assertions. (8059099)
2.41.1 (2021-07-11)
- Commit parsing should cater for file names with square brackets (ae81134)
2.41.0 (2021-07-11)
- allow setting the scope of
git config add
to work on thelocal
,global
orsystem
configuration. (c7164e7) - allow setting the scope of git config add to work on the
local
,global
orsystem
configuration. (00ada06)
2.40.0 (2021-06-12)
- create the
spawnOptions
plugin to allow settinguid
/gid
owner for the spawnedgit
child processes. (cc70220)
2.39.1 (2021-06-09)
- add types and tests for the documented .exec api (#631) (c9207da)
- add types and tests for the documented
.exec
api (c9207da) - updates the documentation for
mergeFromTo
to more closely represent its functionality (see #50 for the original requirement). (dd2244e)
2.39.0 (2021-05-13)
git.cwd
can now be configured to affect just the chain rather than root instance. (4110662)
2.38.1 (2021-05-09)
2.38.0 (2021-04-14)
2.37.0 (2021-03-15)
errorDetectionPlugin
to handle creating error messages when tasks fail. (c65a419)
2.36.2 (2021-03-11)
2.36.1 (2021-03-06)
- Documentation update for
outputHandler
(775d81e) - Support parsing
git.branch
where branches have carriage returns in the commit detail. (5b71012)
2.36.0 (2021-03-03)
- Timeout Plugin (59f3d98)
- Fix broken link in
no-response
auto-generated comment (16fe73f)
2.35.2 (2021-02-23)
- Progress plugin should request progress events for fetch as well as other common long running tasks. (ea68857)
- upgrade debug from 4.3.1 to 4.3.2 (4b6eda8)
- While use of the
ListLogSummary
type is deprecated in favour of the newLogResult
, the alias type should also support the default genericDefaultLogFields
to allow downstream consumers to upgrade to newer2.x
versions without the need to specify a generic. (508e602), closes #586
2.35.1 (2021-02-19)
- Update documentation for configuring
SimpleGit
-options
should be aPartial<SimpleGitOptions>
to allow for supplying just some of its properties. (30523df), closes #580
2.35.0 (2021-02-16)
- Progress Handler (5508bd4)
2.34.2 (2021-02-07)
- fix npm publish token definition (fb066c3)
2.34.1 (2021-02-07)
- auto-release with release-please (0ed2d96)
2.34.0 (2021-02-06)
- refactor
git push
to TypeScriptSimpleGitBase
interface (e77ef1b) - refactor
git push
to TypeScriptSimpleGitBase
interface (0691e85)
2.33.0 (2021-02-06)
- automate release/changelog with release-please (3848494)
- split the
git.add
into the tsSimpleGitApi
(14432f9)
- Supports passing configuration arguments to the
git
binary (via its-c
argument as a prefix to any other arguments). Eg: to supply some custom http proxy to agit pull
command, usesimpleGit('/some/path', { config: ['http.proxy=someproxy'] }).pull()
- Add deprecation notice to
git.silent
- Internal Updates:
- switch from
run
torunTask
ingit
core - finish converting all mocks to TypeScript
- switch from
- Adds a
root: boolean
property to theCommitResult
interface representing whether the commit was a 'root' commit (which is a commit that has no parent, most commonly the first commit in a repo).
- Reinstates native support for node.js v10 by removing use of ES6 constructs
- Update type definition for
git.mergeFromTo
to be theMergeResult
returned when using the more genericgit.merge
method. Thanks to @ofirelias for the pull request.
-
Adds support for
git.applyPatch
to apply patches generated in agit diff
to the working index, TypeScript consumers can make use of theApplyOptions
type definition to make use of strong types for the supported options. Thanks to @andreterron for the pull request. -
Integration tests converted to TypeScript to ensure type safety across all tests.
- Update the
git.status
parser to account for staged deleted/modified files and staged files with subsequent modifications meaning a status of:RM old -> new
will now appear inrenamed
andnew
will also appear inmodified
D file
will now appear in bothdeleted
andstaged
whereD file
would only appear indeleted
- Resolves an issue whereby using
git.log
with a callback (or awaiting the promise created from the now deprecatedsimple-git/promise
import) would fail to return the response to the caller.
- See Legacy Node Versions for details of how to use
simple-git
withnode.js
versions 11 and below. - To help keep the TypeScript definitions in line with functionality, unit tests are now written in TypeScript.
- When using
git.commit
, the first argument must be a string or array of strings. Passing another data type has long been considered an error, but now a deprecation warning will be shown in the log and will be switched to an error in version 3. - Fixes an issue in
git.commit
whereby a commit that included only deleted lines would be parsed as though the deletions were inclusions.
pull
,push
andpushTags
parameter types updated to match new functionality and tests switched to TypeScript to ensure they are kept in sync
- Upgrade
debug
dependency and remove use of now deprecateddebug().destroy()
- Renames the default source branch from
master
tomain
- Adds support for
git hash-object FILE
andgit hash-object -w FILE
with new interfacegit.hashObject(...)
, with thanks to @MiOnim
- Adds
string[]
to the set of types supported as options forgit.log
- Fix readme typos
LogOptions
should be intersection rather than union types
- move the command/task option processing function to TypeScript
git.clone
andgit.mirror
rewritten to fit the TypeScript tasks style.- resolves issue whereby
git.clone
didn't accept an object of options despite being documented as supporting.
git pull
(and by extensiongit merge
) adds remote message parsing to thePullResult
type- Remote message parsing adds property
remoteMessages.objects
of typeRemoteMessagesObjectEnumeration
to capture the objects transferred in fetch and push.
git.mv
rewritten to fit the TypeScript tasks style.- set up github actions for CI
- adds the
TaskParser
type to describe a task's parser function and creates theLineParser
utility to simplify line-by-line parsing of string responses. - renames some interfaces for consistency of naming, the original name remains as a type alias marked as
@deprecated
until version 3.x:- BranchDeletionSummary > BranchSingleDeleteResult
- BranchDeletionBatchSummary > BranchMultiDeleteResult
- MergeSummary > MergeResult
- resolves an issue whereby the
git.checkoutBranch
method would not pass the branch detail through to the underlying child process.
- Further to
2.13.0
includes all (non-empty)remote:
lines in thePushResult
, includingremote:
lines used for other parser results (ie:pullRequestUrl
etc).
- Further to
2.13.0
adding support for parsing the reponse togit.push
, adds support for the pull request message used by gitlab.
-
.push
and.pushTags
rewritten as v2 style tasks. The git response is now parsed and returned as a PushResult -
Pull and merge rewritten to fit the TypeScript tasks style.
-
Integration tests updated to run through jest directly without compiling from nodeunit
- resolves an issue whereby the
git.tags
method could not be chained or used as an async/promise.
-
until now,
simple-git
reject all pending tasks in the queue when a task has failed. From2.11.0
, only tasks chained from the failing one will be rejected, other tasks can continue to be processed as normal, giving the developer more control over which tasks should be treated as atomic chains, and which can be run in parallel.To support this, and to prevent the issues seen when
git
is run concurrently in too many child processes,simple-git
will limit the number of tasks running in parallel at any one time to be at most 1 from each chain (ie: chained tasks are still run in series) and at most 5 tasks across all chains ( configurable by passing{maxConcurrentProcesses: x}
in thesimpleGit
constructor). -
add support to
git.status()
for parsing the response of a repo that has no commits yet, previously it wouldn't determine the branch name correctly. -
resolved a flaw introduced in
2.9.0
wherebycheckoutLocalBranch
would silently fail and not check out the branch
git.checkout
now supports both object and array forms of supplying trailing options.
import simpleGit from 'simple-git';
await simpleGit().checkout('branch-name', ['--track', 'remote/branch']);
await simpleGit().checkout(['branch-name', '--track', 'remote/branch']);
await simpleGit().checkout({'branch-name': null});
git.init
now supports both object and array forms of supplying trailing options and now parses the response to return an InitResult;
import simpleGit, { InitResult } from 'simple-git';
const notSharedInit: InitResult = await simpleGit().init(false, ['--shared=false']);
const notSharedBareInit: InitResult = await simpleGit().init(['--bare', '--shared=false']);
const sharedInit: InitResult = await simpleGit().init(false, {'--shared': 'true'});
const sharedBareInit: InitResult = await simpleGit().init({'--bare': null, '--shared': 'false'});
git.status
now supports both object and array forms of supplying trailing options.
import simpleGit, { StatusResult } from 'simple-git';
const repoStatus: StatusResult = await simpleGit().status();
const subDirStatus: StatusResult = await simpleGit().status(['--', 'sub-dir']);
git.reset
upgraded to the new task style and exports an enumResetMode
with all supported merge modes and now supports both object and array forms of supplying trailing options.
import simpleGit, { ResetMode } from 'simple-git';
// git reset --hard
await simpleGit().reset(ResetMode.HARD);
// git reset --soft -- sub-dir
await simpleGit().reset(ResetMode.SOFT, ['--', 'sub-dir']);
- bug-fix: it should not be possible to await the
simpleGit()
task runner, only the tasks it returns.
expect(simpleGit().then).toBeUndefined();
expect(simpleGit().init().then).toBe(expect.any(Function));
-
.checkIsRepo()
updated to allow choosing the type of check to run, either by using the exportedCheckRepoActions
enum or the text equivalents ('bare', 'root' or 'tree'):checkIsRepo(CheckRepoActions.BARE): Promise<boolean>
determines whether the working directory represents a bare repo.checkIsRepo(CheckRepoActions.IS_REPO_ROOT): Promise<boolean>
determines whether the working directory is at the root of a repo.checkIsRepo(CheckRepoActions.IN_TREE): Promise<boolean>
determines whether the working directory is a descendent of a git root.
-
.revparse()
converted to a new style task
- Enables support for using the default export of
simple-git
as an es module, in TypeScript it is no longer necessary to enable theesModuleInterop
flag in thetsconfig.json
to consume the default export.
- Closes #471, whereby the source for the promise wrapped runner would be included in the published artifact
due to sharing the same name as the explicitly included
promise.js
in the project root.
- Fixes #464, whereby using
await
ongit.log
without having supplied a callback would ignore the leading options object or options array.
- Updated to the
outputHandler
type to add a trailing argument for the arguments passed into the child process. - All logging now uses the debug library. Enable logging by adding
simple-git
to theDEBUG
environment variable.git.silent(false)
can still be used to explicitly enable logging and is equivalent to callingrequire('debug').enable('simple-git')
.
- TL;DR -
.then
and.catch
can now be called on the standardsimpleGit
chain to handle the promise returned by the most recently added task... essentially, promises now just work the way you would expect them to. - The main export from
simple-git
no longer shows the deprecation notice for using the.then
function, it now exposes the promise chain generated from the most recently run task, allowing the combination of chain building and ad-hoc splitting off to a new promise chain.- See the unit and integration tests.
- See the typescript consumer test.
- Promise / async interface and TypeScript types all available from the
simple-git
import rather than needingsimple-git/promise
, see examples in the ReadMe or in the consumer tests.
-
Tasks that previously validated their usage and rejected with a
TypeError
will now reject with aTaskConfigurationError
. -
Tasks that previously rejected with a custom object (currently only
git.merge
when the auto-merge fails) will now reject with aGitResponseError
where previously it was a modifiedError
.
git.clean(...)
will now return aCleanSummary
instead of the raw string data
git.raw(...)
now accepts any number of leading string arguments as an alternative to the single array of strings.
- all
git.remote
related functions converted to TypeScript
- all
git.subModule
related functions converted to TypeScript
- add new
git.listConfig
to get current configuration git.addConfig
supports a newappend
flag to append the value into the config rather than overwrite existing
- all
git.branch
related functions converted to TypeScript - add new
git.deleteLocalBranches
to delete multiple branches in one call git.deleteLocalBranches
andgit.deleteLocalBranch
now support an optionalforceDelete
flag
.tags
,.addTag
and.addAnnotatedTag
converted to TypeScript, no backward compatibility changes
-
If your application depended on any functions with a name starting with an
_
, the upgrade may not be seamless, please only use the documented public API. -
git.log
date format is now strict ISO by default (ie: uses the placeholder%aI
) instead of the 1.x default of%ai
for an "ISO-like" date format. To restore the old behaviour, addstrictDate = false
to the options passed togit.log
.
Please see the historical changelog;