v1.0.0
I recommend you read the NICE RELEASE NOTES first.
These are the auto-generated release notes, which are exhaustive if not pretty.
1.0.0 (2020-02-26)
Bug Fixes
- checkout: don't treat modified files as conflicted unless the file would actually change (#1018) (321618f)
- fetch, push: recognize more git config settings (#1033) (a4e5aee)
- types: tweak onAuth typings + add http.d.ts (#1053) (7b05b3d)
- fetch without a 'ref' param should still work if HEAD points to a non-existing branch (#1055) (429fde1)
- isogit CLI had wrong import path to ./http/node (ec1dce0)
- Merge branch 'master' into beta (#872) (b9e5db4)
- pathological graph traversal in findMergeBase (#1057) (8e53088)
- tweak error types (#1061) (424255b)
- update Web Worker example (32b64ca)
- use .js extension for http/web UMD build (4a6a1c2)
chore
- 'message' events are no longer trimmed, and 'rawmessage' event removed (#1010) (92fd6ea)
- cleanup 'dist' directory (#1012) (a1ae219)
- improve
readObject
andwriteObject
typings (#1023) (9f905d9) - improved errors (#1059) (df3b16b)
- make 'http' param required (#1030) (47abb7a)
- make
onAuth
the replacement forusername
,password
,token
, andoauth2format
(#1051) (e344578) - make newSubmoduleBehavior and noSubmodules the default behavior (#1045) (9cd7f3d)
- no plugin system (#1027) (8aaa232)
- remove 'verify' function (#1047) (59e5b12)
- remove automatic URL mangling and User-Agent setting (#1050) (e7d0842)
- remove date option from author/committer/tagger (#1052) (ccb526c)
- remove deprecated 'fs' and 'emitter' params (#1016) (8bb09e5)
- remove the 'autoTranslateSSH' feature (#1006) (7b04575)
- remove the
sign
command (#1007) (a549b2b) - rename fastCheckout to checkout (#1002) (ef595b9)
- replace statusMatrix's
pattern
param withfilter
param (#1004) (fe6d98a) - push: improve schema design of PushResult (#1036) (08ce40e)
- return Uint8Arrays instead of Buffers (#1009) (2c1e26f)
- simplify
log
command (#1005) (2ae9b78) - switch to autogenerated TypeScript definitions (#1019) (e2e7d40)
Features
- fetch: Added 'pruneTags' parameter (#840) (#847) (fefdf0a)
- add a default export and support for importing the ES module build in Node 12+ (#1043) (064e624)
- bump supported browser versions (#932) (db611be)
- publish beta release (#848) (71413c7)
- publish beta release (#848) (37fecc6)
- rename walkBeta2 to walk (#1001) (1d9c097)
- onAuth: remove OAuth2 variant, support raw HTTP headers, endless retry, canceling (#1054) (f51e489)
BREAKING CHANGES
E
has been removed and replaced byErrors
. The errors are typed so if you use aninstanceof
comparison in thecatch
statement, auto-completion on their.data
property works. There are fewer errors total, they have shorter names, and thus the resulting gzip bundle is smaller despite the addition of 28 new classes. Lastly, the distinction betweenFail
andError
has been removed since it was subjective.
Here's the complete breakdown of which Errors
classes replaced which E
codes:
AlreadyExistsError
replacesAddingRemoteWouldOverwrite
,NoteAlreadyExistsError
,RefExistsError
AmbiguousError
replacesAmbiguousShortOid
CheckoutConflictError
replacesCheckoutConflictError
CommitNotFetchedError
replacesCommitNotFetchedError
EmptyServerResponseError
replacesEmptyServerResponseFail
FastForwardError
replacesFastForwardFail
GitPushError
replacesGitPushError
HttpError
replacesHTTPError
InternalError
replacesInternalFail
InvalidFilepathError
replacesDirectorySeparatorsError
InvalidOidError
replacesCorruptShallowOidFail
,NotAnOidFail
InvalidRefNameError
replacesInvalidRefNameError
MaxDepthError
replacesMaxSearchDepthExceeded
MergeNotSupportedError
replacesMergeNotSupportedFail
MissingNameError
replacesMissingAuthorError
,MissingCommitterError
,MissingTaggerError
MissingParameterError
replacesMissingRequiredParameterError
NoRefspecError
replacesNoRefspecConfiguredError
NotFoundError
replacesExpandRefError
,FileReadError
,GitRootNotFoundError
,ReadObjectFail
,RefNotExistsError
,ResolveRefError
,ShortOidNotFound
,TreeOrBlobNotFoundError
ObjectTypeError
replacesDirectoryIsAFileError
,ObjectTypeAssertionFail
,ObjectTypeAssertionInPathFail
,ObjectTypeAssertionInTreeFail
,ObjectTypeUnknownFail
,ResolveCommitError
,ResolveTreeError
ParseError
replacesAssertServerResponseFail
,UnparseableServerResponseFail
PushRejectedError
replacesPushRejectedNonFastForward
,PushRejectedTagExists
RemoteCapabilityError
replacesRemoteDoesNotSupportDeepenNotFail
,RemoteDoesNotSupportDeepenRelativeFail
,RemoteDoesNotSupportDeepenSinceFail
,RemoteDoesNotSupportShallowFail
SmartHttpError
replacesRemoteDoesNotSupportSmartHTTP
UnknownTransportError
replacesUnknownTransportError
UrlParseError
replacesRemoteUrlParseError
UserCanceledError
replacesUserCancelledError
The following error codes are no longer used / have no equivalent: AcquireLockFileFail
, BranchDeleteError
, CoreNotFound
, DoubleReleaseLockFileFail
, InvalidDepthParameterError
, InvalidParameterCombinationError
, MismatchRefValueError
, NoHeadCommitError
, NotImplementedFail
, ObjectTypeAssertionInRefFail
, PluginSchemaViolation
, PluginUndefined
, PluginUnrecognized
- Drop official support for Safari 11
- The
author.date
,committer.date
,tagger.date
parameters were removed in favor ofauthor.timestamp
,comitter.timestamp
,tagger.timestamp
in order to be clear about what is actually written and better reflect the return types inreadCommit
,log
, andreadTag
. - The
username
,password
,token
, andoauth2format
params were removed and replaced with theonAuth
callback. SinceonAuth
also replaced thecredentialManager
plugin, this means now there is a single way to do authentication instead of two. - The URL that's provided is now the URL that's used; no longer will they be "fixed" to end with
.git
since sometimes that actually makes things worse, and subverts user expectations. Accordingly, thenoGitSuffix
parameter has been removed since it's the default behavior. Furthermore, theUser-Agent
is now totally in the user's hands, because it is just a minefield, and I'm done trying to make sense of it. I added a Headers page to the docs documenting what I know about User-Agent + GitHub + CORS + Chrome bugs. - The
verify
function has been removed, and thesignature
property of TagObject renamed togpgsig
to match CommitObject. Sincelog
,readCommit
, andreadTag
all include thegpgsig
and signingpayload
in their return values now, it is simpler and more efficient to do the verification outside ofisomorphic-git
. See the documentation for theonSign
parameter for complete code examples. - The
newSubmoduleBehavior
parameter has been removed and is now the default and only behavior, because it is good. And thenoSubmodules
parameter has been removed and is also the default and only behavior. (This only affects you if you a) liked seeing the console warnings or b) were usingstatusMatrix
to traverse submodules for some reason.) - push: the
push
function now throws if any of the refs on the remote were not updated successfully. It also returns a nicely typed result object organized by ref, rather than a loose collection of strings organized by outcome. - fetch, push: the
fetch
andpush
functions now respect previously ignored git config settings like:branch.${ref}.pushRemote
,remote.pushDefault
,remote.${remote}.pushurl
, andbranch.${ref}.merge
. (Note thepull
command already respectedbranch.${ref}.merge
butfetch
did not.) - isomorphic-git no longer has a node HTTP client hard-coded into the
main
file and a browser HTTP client hard-coded into themodule
file. The HTTP clients are now in their own files; users pick one, import it, and provide it to functions that make requests. - the plugin system has been removed and we're returning to simply passing in arguments and callbacks, because it is simpler, has better locality, and avoids global state.
readObject
andwriteObject
have been updated to use the same object schemas used inreadCommit
,readTree
, andreadTag
. And they are actually documented now in the docs. (The main change is trees are simply arrays now, rather than objects with a.entries
property.) The types returned byreadObject
also form a proper discriminated union so TypeScript will infer the type of.object
given.format
and.type
.- The undocumented param aliases
authUsername
andauthPassword
are removed in favor ofusername
andpassword
. plugins.set
has been replaced byplugins.fs
,plugins.emitter
,plugins.credentialManager
,plugins.pgp
, andplugins.http
.- onAuth: The
token
andoauth2format
properties have been removed from the GitAuth interface, which makes it much simpler and and eliminates a dozen GitErrors handling specific edge cases.
A headers
property has been added to the GitAuth interface. This makes onAuth
much more powerful because you can inject whatever HTTP headers you want.
The onAuthFailed
callback now lets you return a GitAuth object. This means you can keep retrying to authenticate as many times as you like.
A cancel
property has been added to the GitAuth interface. This means you gracefully give up authenticating and the function will throw an E.UserCancelledError instead of an E.HTTPError.
- The deprecated
fs
andemitter
params have been removed. They've been superseded by thefs
andemitter
plugins. - The
internal-apis
are no longer included in the npm package. I never really intended that; they were just for running unit tests. Also, I renameddist/for-future/isomorphic-git/index.js
todist/index.js
anddist/for-node/isomorphic-git/index.js
todist/index.cjs
.
And I removed the jasmine
fallback. I'm sorry jest
uses native modules, but it's just too good not to use and maintaining a fallback test runner is an added complication.
- As a historical accident,
message
events were trimmed. This was lossy and removed valuable information, such as an'\r'
by itself, which is a signal to update the existing line instead of appending a new one. Therawmessage
event was added as a temporary workaround to expose the untrimmed data. Therawmessage
event has been removed and from now on,message
events emit the full untrimmed data. - Any functions that returned
Buffer
objects now instead returnUint8Array
objects. This is so we can eventually drop the bloatedBuffer
browser polyfill. - Ths
sign
command was deprecated a while ago (back whencommit
got asigningKey
param) and has now been removed. - The
autoTranslateSSH
feature has been removed since it's kind of hacky, and it's trivial to implement your own version using thedata.suggestion
property of theUnknownTransportError
when something fails. - The
signing
argument oflog
has been removed, andlog
now returns an array of objects with the same interface as those returned fromreadCommit
. Also, thelog
function will throw now instead of returning errors as objects inside the result array. This greatly simplifies the TS definition (which previously consisted of 3 different overloaded variations) so that we can generate the TS definitions directly from the JSDoc in the future. - the
pattern
param added two dependencies to the project (globrex and globalyzer) for very little benefit since we haven't ended up using globbing anywhere else in the library. The same result can be achieved via the new function parameterfilter
which lets you provide the pattern-matching logic yourself. - the
fastCheckout
function has been renamedcheckout
and the oldcheckout
function has been removed entirely. - the
walkBeta2
function has been renamedwalk
and thewalkBeta1
function has been removed entirely. - the browser (and node) versions tested in CI have been bumped. Future releases are not guaranteed to work on the older versions anymore.
- Drop official support for Safari 11
core
has been replaced byplugins.createCore
andplugins.deleteCore
.