Skip to content

Tags: kiprasmel/git-stacked-rebase

Tags

re-arrange-commits--before

Verified

This commit was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas
in between, will have conflicts -- apply fixes to take in question

Signed-off-by: Kipras Melnikovas <[email protected]>

re-arrange-commits--after

Verified

This commit was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas
fix old bugs/wrong behavior in `applyIfNeedsToApply` & related logic

previously, in `gitStackedRebase`, there were 3 invocations of
`applyIfNeedsToApply`. there are still 3, but what differs is:

previously, the 3rd would be invoked if and only if the
`config.autoApplyIfNeeded` was true, i.e., it was NOT mandatory.

however, the 1st invocation, which also is NOT mandatory, did not have
such guardrail, and, if the `config.autoApplyIfNeeded` was false, would
prompt the user with the common message:
`need to --apply before continuing. proceed? [Y/n/(a)lways] `

this is wrong, because this (1st) invocation is not mandatory, meanwhile
the message makes it look like it is, thus confusing the user &
their longer term understanding of when an --apply is actually needed.

to further add to the confusion, the 1st invocation worked correctly
apart from the message - it (1st invoc) was not made mandatory, i.e.
would not stop the program execution if user did not allow.

---

now, there's a clear distinction of mandatory vs not,
and `applyIfNeedsToApply` works accordingly to it.
related parts were also cleaned up.

also, created a test for this -- yay!

Signed-off-by: Kipras Melnikovas <[email protected]>

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas

Verified

This tag was signed with the committer’s verified signature.
kiprasmel Kipras Melnikovas