Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat:stash] add stash API for push, apply, pop, drop, list and clean #228 #980 #1878

Closed
wants to merge 1,108 commits into from

Conversation

modesty
Copy link

@modesty modesty commented Mar 8, 2024

I'm adding a new command: stash

  • [✅ ] add as a new file in src/api (and src/commands if necessary)
  • [✅ ] add command to src/index.js
  • [ ✅] update __tests__/test-exports.js
  • [ ✅] create a test in src/__tests__ - test-stash covers 22 test cases
  • [ ✅] document the command with a JSDoc comment
  • [ ✅] add page to the Docs Sidebar website/sidebars.json
  • [ ✅]] add page to the v1 Docs Sidebar website/versioned_sidebars/version-1.x-sidebars.json
  • [ ✅]] if this is your first time contributing, run npm run add-contributor and follow the prompts to add yourself to the README
  • squash merge the PR with commit message "feat: Added 'X' command"

billiegoose and others added 30 commits February 9, 2020 19:47
isomorphic-git#1045)

BREAKING CHANGE: The `newSubmoduleBehavior` parameter has been removed and is now the default and only behavior, because it is good. And the `noSubmodules` 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 using `statusMatrix` to traverse submodules for some reason.)
BREAKING CHANGE: The `verify` function has been removed, and the `signature` property of TagObject renamed to `gpgsig` to match CommitObject. Since `log`, `readCommit`, and `readTag` all include the `gpgsig` and signing `payload` in their return values now, it is simpler and more efficient to do the verification outside of `isomorphic-git`. See the documentation for the `onSign` parameter for complete code examples.
…ic-git#1050)

BREAKING CHANGE: 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, the `noGitSuffix` parameter has been removed since it's the default behavior. Furthermore, the `User-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.
…en`, and `oauth2format` (isomorphic-git#1051)

BREAKING CHANGE: The `username`, `password`, `token`, and `oauth2format` params were removed and replaced with the `onAuth` callback. Since `onAuth` also replaced the `credentialManager` plugin, this means now there is a single way to do authentication instead of two.
…t#1052)

BREAKING CHANGE: The `author.date`, `committer.date`, `tagger.date` parameters were removed in favor of `author.timestamp`, `comitter.timestamp`, `tagger.timestamp` in order to be clear about what is actually written and better reflect the return types in `readCommit`, `log`, and `readTag`.
…s retry, canceling (isomorphic-git#1054)

BREAKING CHANGE: The `token` and `oauth2format` 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.
BREAKING CHANGE: `E` has been removed and replaced by `Errors`. The errors are typed so if you use an `instanceof` comparison in the `catch` 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 between `Fail` and `Error` has been removed since it was subjective.

Here's the complete breakdown of which `Errors` classes replaced which `E` codes:

- `AlreadyExistsError` replaces `AddingRemoteWouldOverwrite`, `NoteAlreadyExistsError`, `RefExistsError`
- `AmbiguousError` replaces `AmbiguousShortOid`
- `CheckoutConflictError` replaces `CheckoutConflictError`
- `CommitNotFetchedError` replaces `CommitNotFetchedError`
- `EmptyServerResponseError` replaces `EmptyServerResponseFail`
- `FastForwardError` replaces `FastForwardFail`
- `GitPushError` replaces `GitPushError`
- `HttpError` replaces `HTTPError`
- `InternalError` replaces `InternalFail`
- `InvalidFilepathError` replaces `DirectorySeparatorsError`
- `InvalidOidError` replaces `CorruptShallowOidFail`, `NotAnOidFail`
- `InvalidRefNameError` replaces `InvalidRefNameError`
- `MaxDepthError` replaces `MaxSearchDepthExceeded`
- `MergeNotSupportedError` replaces `MergeNotSupportedFail`
- `MissingNameError` replaces `MissingAuthorError`, `MissingCommitterError`, `MissingTaggerError`
- `MissingParameterError` replaces `MissingRequiredParameterError`
- `NoRefspecError` replaces `NoRefspecConfiguredError`
- `NotFoundError` replaces `ExpandRefError`, `FileReadError`, `GitRootNotFoundError`, `ReadObjectFail`, `RefNotExistsError`, `ResolveRefError`, `ShortOidNotFound`, `TreeOrBlobNotFoundError`
- `ObjectTypeError` replaces `DirectoryIsAFileError`, `ObjectTypeAssertionFail`, `ObjectTypeAssertionInPathFail`, `ObjectTypeAssertionInTreeFail`, `ObjectTypeUnknownFail`, `ResolveCommitError`, `ResolveTreeError`
- `ParseError` replaces `AssertServerResponseFail`, `UnparseableServerResponseFail`
- `PushRejectedError` replaces `PushRejectedNonFastForward`, `PushRejectedTagExists`
- `RemoteCapabilityError` replaces `RemoteDoesNotSupportDeepenNotFail`, `RemoteDoesNotSupportDeepenRelativeFail`, `RemoteDoesNotSupportDeepenSinceFail`, `RemoteDoesNotSupportShallowFail`
- `SmartHttpError` replaces `RemoteDoesNotSupportSmartHTTP`
- `UnknownTransportError` replaces `UnknownTransportError`
- `UrlParseError` replaces `RemoteUrlParseError`
- `UserCanceledError` replaces `UserCancelledError`

The following error codes are no longer used / have no equivalent: `AcquireLockFileFail`, `BranchDeleteError`, `CoreNotFound`, `DoubleReleaseLockFileFail`, `InvalidDepthParameterError`, `InvalidParameterCombinationError`, `MismatchRefValueError`, `NoHeadCommitError`, `NotImplementedFail`, `ObjectTypeAssertionInRefFail`, `PluginSchemaViolation`, `PluginUndefined`, `PluginUnrecognized`
@jcubic
Copy link
Contributor

jcubic commented Mar 16, 2024

Please rebase, the filing test got disabled.

* docs: add @alexvy86 as a contributor

* Add locking to fix race condition reading/writing refs

* Make prettier happy

* Encapsulate locking logic

* Use withLock helper

* Indicate private functions

* Remove obsolete variable declaration

* Await all uses of RefLock.withLock

* Unit test

* Unit test

* Use async-lock package

* Fix tree-shaking
@modestysn
Copy link

rebase pushed

@jcubic
Copy link
Contributor

jcubic commented Mar 17, 2024

Thanks, I will need to test the feature locally before merging. This is a big feature I want to make sure it works correctly. Will do this probably tomorrow and will take a closer look at the code.

I'm not sure if the tests pass now. I'm using a mobile GitHub app.

@jcubic
Copy link
Contributor

jcubic commented Mar 21, 2024

tmpmachine and others added 12 commits March 22, 2024 00:12
)

Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.17.1...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…somorphic-git#980, also add more test cases for changes and deletion under a folder
@jcubic
Copy link
Contributor

jcubic commented Apr 7, 2024

There are some failing tests, you need to figure that out before this will be merged.

https://dev.azure.com/isomorphic-git/isomorphic-git/_build/results?buildId=3381&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=5b4cc83a-7bb0-5664-5bb1-588f7e4dc05b

I'm not sure what is the issue, but failing tests are for git stash.

@modesty
Copy link
Author

modesty commented Apr 7, 2024

tests with Jest are all good, only Karma fails. It's caused by makeFixture: it returns different dir when invoked from different test cases with Jest, but when run with karma, it returns the same dir, which causes stashed/applied files interfere each other. I'll try to correct it when get a chance.

@modesty
Copy link
Author

modesty commented Apr 9, 2024

#1898 replaces this one for a cleaner history, build and test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet