@osdlc/typed-git 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @osdlc/typed-git
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cb8eafc: `rebase` takes an `upstream` option: `git.rebase(onto, { upstream })` runs `git rebase --onto <onto> <upstream>`, replaying only the commits after `upstream`. Restacking a branch whose base was rewritten needs it, so the base's old commits are left behind instead of replayed onto its new ones.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [e1a5941]
12
+ - @osdlc/command-seam@0.15.0
13
+
3
14
  ## 0.13.0
4
15
 
5
16
  ### Minor Changes
package/README.md CHANGED
@@ -763,7 +763,7 @@ other non-zero exit throws.
763
763
  | Method | git | Returns |
764
764
  | --- | --- | --- |
765
765
  | `merge(ref, { noFf, noCommit, ffOnly, message })` | `merge --no-edit` | `MergeOutcome` — with `ffOnly`, a merge that cannot fast-forward throws |
766
- | `rebase(onto, { autostash })` | `rebase` | `RebaseOutcome` |
766
+ | `rebase(onto, { autostash, upstream })` | `rebase` (`--onto <onto> <upstream>` with `upstream`) | `RebaseOutcome` |
767
767
  | `rebaseContinue()` | `-c core.editor=true rebase --continue` | `RebaseOutcome` |
768
768
  | `mergeTree(ours, theirs, { mergeBase })` | `merge-tree --write-tree --name-only -z` | `MergeTreeOutcome` |
769
769
  | `lsFilesUnmerged()` | `ls-files -u -z` | `UnmergedEntry[]` — mode, sha, stage, path |
package/dist/verbs.d.ts CHANGED
@@ -1413,9 +1413,17 @@ export declare function mergeAbort(): GitVerb<void>;
1413
1413
  export interface RebaseOptions {
1414
1414
  /** `--autostash` — shelve and restore a dirty tree around the replay. */
1415
1415
  autostash?: boolean | undefined;
1416
+ /**
1417
+ * `--onto <onto> <upstream>`: replay only the commits after `upstream`
1418
+ * (`upstream..HEAD`), not every commit `onto` lacks. Restacking a branch
1419
+ * whose base was rewritten needs it: pass the base's old head, so the old
1420
+ * base commits are left behind instead of replayed onto the new ones.
1421
+ */
1422
+ upstream?: string | undefined;
1416
1423
  }
1417
1424
  /**
1418
- * Replay the current branch onto `onto` (`git rebase`).
1425
+ * Replay the current branch onto `onto` (`git rebase`, or
1426
+ * `git rebase --onto <onto> <upstream>` with `upstream`).
1419
1427
  *
1420
1428
  * `absent: [1]` for the same reason as {@link merge}. An unknown ref exits
1421
1429
  * 128 here rather than 1, so this verb is the less ambiguous of the two —
package/dist/verbs.js CHANGED
@@ -1891,7 +1891,8 @@ export function mergeAbort() {
1891
1891
  return { argv: ['merge', '--abort'], absent: NONE, parse: nothing };
1892
1892
  }
1893
1893
  /**
1894
- * Replay the current branch onto `onto` (`git rebase`).
1894
+ * Replay the current branch onto `onto` (`git rebase`, or
1895
+ * `git rebase --onto <onto> <upstream>` with `upstream`).
1895
1896
  *
1896
1897
  * `absent: [1]` for the same reason as {@link merge}. An unknown ref exits
1897
1898
  * 128 here rather than 1, so this verb is the less ambiguous of the two —
@@ -1901,7 +1902,11 @@ export function rebase(onto, opts = {}) {
1901
1902
  const argv = ['rebase'];
1902
1903
  if (opts.autostash)
1903
1904
  argv.push('--autostash');
1904
- argv.push(positional('rebase', 'onto', onto));
1905
+ if (opts.upstream === undefined)
1906
+ argv.push(positional('rebase', 'onto', onto));
1907
+ else {
1908
+ argv.push('--onto', positional('rebase', 'onto', onto), positional('rebase', 'upstream', opts.upstream));
1909
+ }
1905
1910
  const verb = {
1906
1911
  argv,
1907
1912
  env: C_LOCALE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osdlc/typed-git",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "A typed git client for TypeScript, sync and awaitable. Each verb declares what absence means for it; every other failure throws. git.try.* inspects, raw() bypasses — over an injectable backend that drives the git CLI or any other implementation.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "author": "sksizer",
@@ -52,7 +52,7 @@
52
52
  ],
53
53
  "dependencies": {
54
54
  "hosted-git-info": "^10.1.1",
55
- "@osdlc/command-seam": "^0.14.0",
55
+ "@osdlc/command-seam": "^0.15.0",
56
56
  "@osdlc/result": "^0.1.0"
57
57
  },
58
58
  "devDependencies": {