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

argv-parser-rewrite #21

Open
wants to merge 2 commits into
base: refactor1
Choose a base branch
from
Open

argv-parser-rewrite #21

wants to merge 2 commits into from

Conversation

kiprasmel
Copy link
Owner

@kiprasmel kiprasmel commented Apr 12, 2023

BREAKING CHANGE: completely overhaul arg parsing & allow invoking CLI w/o initialBranch

...as long as the initialBranch was already provided
in some previous invocation of stacked-rebase, thus cached.
sometime later, we could have a config for the default initial branch..

  • create generic utils for argv parsing (separate package soon?)

  • introduce multiple tests, which caught lots of (mostly new) bugs!

  • tidy up code at start of gitStackedRebase, which now makes great sense & looks nice

    • same in other places
  • clear up mental model of "parsing options" - it's "resolve" instead of "parse"

  • move initialBranch parsing into resolveOptions

    • don't want out of sync resolvedOptions.initialBranch vs nameOfInitialBranch
  • get rid of "intial branch is optional for some args" -- non issue

    • because e.g. for --continue to have any meaning, you'd have to have already
      started a stacked rebase & thus would have the initial branch cached.

…t process

previously, if some error occurred, would just continue running, unless:
a) a node arg `--unhandled-rejections=strict` was specified, or
b) node version was >= 15 (but would get stuck, instead of exiting properly)

for A, see:
https://nodejs.org/api/cli.html#--unhandled-rejectionsmode

now, always exits properly.
… w/o initialBranch if cached

...as long as the initialBranch was already provided
in some previous invocation of stacked-rebase, thus cached.
sometime later, we could have a config for the default initial branch..

- create generic utils for argv parsing (separate package soon?)
- introduce multiple tests, which caught lots of (mostly new) bugs!
- tidy up code at start of gitStackedRebase, which now makes great sense & looks nice
  - same in other places
- clear up mental model of "parsing options" - it's "resolve" instead of "parse"

- move initialBranch parsing into resolveOptions
  - don't want out of sync `resolvedOptions.initialBranch` vs `nameOfInitialBranch`

- get rid of "intial branch is optional for some args" -- non issue
  - because e.g. for --continue to have any meaning, you'd have to have already
    started a stacked rebase & thus would have the initial branch cached.
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

1 participant