Repository: VirtusLab/git-machete
Pull request #1271 (2024-06-26 20:54:17)

Release v3.26.1


Patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 10b9ec4..d0f962a 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -340,6 +340,7 @@ workflows:
           filters:
             branches:
               only:
+                - "/dependabot.pip.*/"
                 - "develop"
                 - "/.*dry-run.*/"
                 - "/hotfix.*/"
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index 6809bee..6f3d157 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,5 +1,10 @@
 # Release notes
 
+## New in git-machete 3.26.1
+
+- fixed: readability of autogenerated PR/MR descriptions
+- improved: `git machete github restack-pr` and `git machete gitlab restack-mr` fail on branches marked as `push=no`, instead of printing a warning and proceeding with retargeting anyway
+
 ## New in git-machete 3.26.0
 
 - added: better detection of squash merges and rebases, controlled by flag `--squash-merge-detection={none,simple,exact}` (`status` and `traverse`) and git config key `machete.squashMergeDetection` (contributed by @gjulianm)
diff --git a/docs/man/git-machete.1 b/docs/man/git-machete.1
index 73805f9..8600ccb 100644
--- a/docs/man/git-machete.1
+++ b/docs/man/git-machete.1
@@ -27,9 +27,9 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 ..
-.TH "GIT-MACHETE" "1" "May 24, 2024" "" "git-machete"
+.TH "GIT-MACHETE" "1" "Jun 10, 2024" "" "git-machete"
 .SH NAME
-git-machete \- git-machete 3.26.0
+git-machete \- git-machete 3.26.1
 .sp
 git machete is a robust tool that \fBsimplifies your git workflows\fP\&.
 .sp
diff --git a/git_machete/__init__.py b/git_machete/__init__.py
index c1292df..02d83ec 100644
--- a/git_machete/__init__.py
+++ b/git_machete/__init__.py
@@ -1,1 +1,1 @@
-__version__ = '3.26.0'
+__version__ = '3.26.1'
diff --git a/git_machete/client.py b/git_machete/client.py
index 742a326..abe6ebf 100644
--- a/git_machete/client.py
+++ b/git_machete/client.py
@@ -2290,56 +2290,55 @@ class MacheteClient:
         if s in statuses_to_push:
             if current_branch in self.annotations and not self.annotations[current_branch].qualifiers.push:
                 subcommand = "retarget-" + spec.pr_short_name.lower()
-                warn(f'Branch <b>{current_branch}</b> is marked as `push=no`; skipping the push.\n'
-                     f'Did you want to just use `git machete {spec.git_machete_command} {subcommand}`?\n')
+                raise MacheteException(
+                    f'Branch <b>{current_branch}</b> is marked as `push=no`; aborting the restack.\n'
+                    f'Did you want to just use `git machete {spec.git_machete_command} {subcommand}`?\n')
 
-                self.retarget_pr(spec, head, ignore_if_missing=False)
-            else:
-                converted_to_draft = code_hosting_client.set_draft_status_of_pull_request(pr.number, target_draft_status=True)
-                if converted_to_draft:
-                    print(f'{pr.display_text()} has been temporarily marked as draft')
+            converted_to_draft = code_hosting_client.set_draft_status_of_pull_request(pr.number, target_draft_status=True)
+            if converted_to_draft:
+                print(f'{pr.display_text()} has been temporarily marked as draft')
 
-                # Note that retarget should happen BEFORE push, see issue #1222
-                self.retarget_pr(spec, head, ignore_if_missing=False)
+            # Note that retarget should happen BEFORE push, see issue #1222
+            self.retarget_pr(spec, head, ignore_if_missing=False)
 
-                if s == SyncToRemoteStatuses.AHEAD_OF_REMOTE:
-                    assert remote is not None
-                    self.__handle_ahead_state(
-                        current_branch=current_branch,
-                        remote=remote,
-                        is_called_from_traverse=False,
-                        opt_push_tracked=True,
-                        opt_yes=True)
-                elif s == SyncToRemoteStatuses.UNTRACKED:
-                    self.__handle_untracked_state(
-                        branch=current_branch,
-                        is_called_from_traverse=False,
-                        is_called_from_code_hosting=True,
-                        opt_push_tracked=True,
-                        opt_push_untracked=True,
-                        opt_yes=True)
-                elif s == SyncToRemoteStatuses.DIVERGED_FROM_AND_NEWER_THAN_REMOTE:
-                    assert remote is not None
-                    self.__handle_diverged_and_newer_state(
-                        current_branch=current_branch,
-                        remote=remote,
-                        is_called_from_traverse=False,
-                        opt_push_tracked=True,
-                        opt_yes=True)
-                else:
-                    raise UnexpectedMacheteException(f"Invalid sync to remote status: {s}.")
+            if s == SyncToRemoteStatuses.AHEAD_OF_REMOTE:
+                assert remote is not None
+                self.__handle_ahead_state(
+                    current_branch=current_branch,
+                    remote=remote,
+                    is_called_from_traverse=False,
+                    opt_push_tracked=True,
+                    opt_yes=True)
+            elif s == SyncToRemoteStatuses.UNTRACKED:
+                self.__handle_untracked_state(
+                    branch=current_branch,
+                    is_called_from_traverse=False,
+                    is_called_from_code_hosting=True,
+                    opt_push_tracked=True,
+                    opt_push_untracked=True,
+                    opt_yes=True)
+            elif s == SyncToRemoteStatuses.DIVERGED_FROM_AND_NEWER_THAN_REMOTE:
+                assert remote is not None
+                self.__handle_diverged_and_newer_state(
+                    current_branch=current_branch,
+                    remote=remote,
+                    is_called_from_traverse=False,
+                    opt_push_tracked=True,
+                    opt_yes=True)
+            else:
+                raise UnexpectedMacheteException(f"Invalid sync to remote status: {s}.")
 
-                self.__print_new_line(False)
-                self.status(
-                    warn_when_branch_in_sync_but_fork_point_off=True,
-                    opt_list_commits=False,
-                    opt_list_commits_with_hashes=False,
-                    opt_squash_merge_detection=SquashMergeDetection.NONE)
-                self.__print_new_line(False)
+            self.__print_new_line(False)
+            self.status(
+                warn_when_branch_in_sync_but_fork_point_off=True,
+                opt_list_commits=False,
+                opt_list_commits_with_hashes=False,
+                opt_squash_merge_detection=SquashMergeDetection.NONE)
+            self.__print_new_line(False)
 
-                if converted_to_draft:
-                    code_hosting_client.set_draft_status_of_pull_request(prs[0].number, target_draft_status=False)
-                    print(f'{pr.display_text()} has been marked as ready for review again')
+            if converted_to_draft:
+                code_hosting_client.set_draft_status_of_pull_request(prs[0].number, target_draft_status=False)
+                print(f'{pr.display_text()} has been marked as ready for review again')
 
         else:
             if s == SyncToRemoteStatuses.BEHIND_REMOTE:
@@ -2538,7 +2537,8 @@ class MacheteClient:
         current_date = utils.get_current_date()
         prepend += f'## Full chain of {pr_short_name}s as of {current_date}\n\n'
         for ancestor_pr in pr_path:
-            prepend += f'* {ancestor_pr.display_text(fmt=False)}: `{ancestor_pr.head}` ➔ `{ancestor_pr.base}`\n'
+            prepend += f'* {ancestor_pr.display_text(fmt=False)}:\n'
+            prepend += f'  `{ancestor_pr.head}` ➔ `{ancestor_pr.base}`\n'
         prepend += '\n'
         prepend += f'{self.END_GIT_MACHETE_GENERATED_COMMENT}\n'
         return prepend
@@ -2572,7 +2572,7 @@ class MacheteClient:
         remote_branch = RemoteBranchShortName(f"{org_repo_remote.remote}/{base}")
         remote_base_branch_exists_locally = remote_branch in self.__git.get_remote_branches()
         print(f"Checking if {spec.base_branch_name} branch {bold(base)} "
-              f"exists on {bold(org_repo_remote.remote)} remote... ", end='', flush=True)
+              f"exists in {bold(org_repo_remote.remote)} remote... ", end='', flush=True)
         base_branch_found_on_remote = self.__git.does_remote_branch_exist(org_repo_remote.remote, base)
         print(fmt('<green><b>YES</b></green>' if base_branch_found_on_remote else '<red><b>NO</b></red>'))
         if not base_branch_found_on_remote and remote_base_branch_exists_locally:
diff --git a/git_machete/exceptions.py b/git_machete/exceptions.py
index 1f551d9..8b5e335 100644
--- a/git_machete/exceptions.py
+++ b/git_machete/exceptions.py
@@ -2,6 +2,8 @@ from enum import IntEnum
 
 from git_machete import utils
 
+NEW_ISSUE_LINK = "https://github.com/VirtusLab/git-machete/issues/new"
+
 
 class InteractionStopped(Exception):
     def __init__(self) -> None:
@@ -25,8 +27,8 @@ class MacheteException(Exception):
 
 
 class UnexpectedMacheteException(MacheteException):
-    def __init__(self, msg: str, apply_fmt: bool = False) -> None:
-        super().__init__(f"{msg}\n\nConsider posting an issue at https://github.com/VirtusLab/git-machete/issues/new", apply_fmt=apply_fmt)
+    def __init__(self, msg: str, apply_fmt: bool = True) -> None:
+        super().__init__(f"{msg}\n\nConsider posting an issue at `{NEW_ISSUE_LINK}`", apply_fmt=apply_fmt)
 
 
 class ExitCode(IntEnum):
diff --git a/git_machete/git_config_keys.py b/git_machete/git_config_keys.py
index 63d290c..88dc170 100644
--- a/git_machete/git_config_keys.py
+++ b/git_machete/git_config_keys.py
@@ -1,7 +1,7 @@
+SQUASH_MERGE_DETECTION = 'machete.squashMergeDetection'
 STATUS_EXTRA_SPACE_BEFORE_BRANCH_NAME = 'machete.status.extraSpaceBeforeBranchName'
 TRAVERSE_PUSH = 'machete.traverse.push'
 WORKTREE_USE_TOP_LEVEL_MACHETE_FILE = 'machete.worktree.useTopLevelMacheteFile'
-SQUASH_MERGE_DETECTION = 'machete.squashMergeDetection'
 
 
 def override_fork_point_to(branch: str) -> str:
diff --git a/git_machete/github.py b/git_machete/github.py
index 3bd049d..aa1ccb3 100644
--- a/git_machete/github.py
+++ b/git_machete/github.py
@@ -295,6 +295,9 @@ class GitHubClient(CodeHostingClient):
                      f'New organization is {bold(new_org)} and new repository is {bold(new_repo)}.\n'
                      'You can update your remote repository via: `git remote set-url <remote_name> <new_repository_url>`.')
                 return result
+            elif err.code >= 500:
+                raise MacheteException(f'GitHub API returned `{err.code}` '
+                                       f'HTTP status with error message: `{err.reason}`.')  # pragma: no cover
             else:
                 raise UnexpectedMacheteException(f'GitHub API returned `{err.code}` HTTP status with error message: `{err.reason}`.')
         except OSError as e:  # pragma: no cover
diff --git a/git_machete/gitlab.py b/git_machete/gitlab.py
index afb97ee..bc59d6f 100644
--- a/git_machete/gitlab.py
+++ b/git_machete/gitlab.py
@@ -217,6 +217,9 @@ class GitLabClient(CodeHostingClient):
                 else:
                     UnexpectedMacheteException(
                         f'GitLab API returned 405 (Method Not Allowed) HTTP status with error message: `{err.reason}`.')
+            elif err.code >= 500:
+                raise MacheteException(f'GitLab API returned `{err.code}` '
+                                       f'HTTP status with error message: `{err.reason}`.')  # pragma: no cover
             else:
                 raise UnexpectedMacheteException(f'GitLab API returned `{err.code}` HTTP status with error message: `{err.reason}`.')
         except OSError as e:  # pragma: no cover
diff --git a/git_machete/options.py b/git_machete/options.py
index 2d4d593..68a0996 100644
--- a/git_machete/options.py
+++ b/git_machete/options.py
@@ -21,8 +21,6 @@ class CommandLineOptions:
         self.opt_list_commits_with_hashes: bool = False
         self.opt_merge: bool = False
         self.opt_n: bool = False
-        self.opt_squash_merge_detection_string: str = "simple"
-        self.opt_squash_merge_detection_origin: Optional[str] = None
         self.opt_no_edit_merge: bool = False
         self.opt_no_interactive_rebase: bool = False
         self.opt_onto: Optional[LocalBranchShortName] = None
@@ -34,6 +32,8 @@ class CommandLineOptions:
         self.opt_removed_from_remote: bool = False
         self.opt_return_to: str = "stay"
         self.opt_roots: List[LocalBranchShortName] = list()
+        self.opt_squash_merge_detection_origin: Optional[str] = None
+        self.opt_squash_merge_detection_string: str = "simple"
         self.opt_start_from: str = "here"
         self.opt_stat: bool = False
         self.opt_sync_github_prs: bool = False
diff --git a/requirements/coverage.txt b/requirements/coverage.txt
index f403209..a1ebe97 100644
--- a/requirements/coverage.txt
+++ b/requirements/coverage.txt
@@ -1,6 +1,6 @@
 coverage==6.2; python_version <= '3.6'
 coverage==7.2.7; python_version >= '3.7' and python_version < '3.8'
-coverage==7.5.1; python_version >= '3.8'
+coverage==7.5.4; python_version >= '3.8'
 
 pytest-cov==4.0.0; python_version <= '3.6'
 pytest-cov==4.1.0; python_version >= '3.7' and python_version < '3.8'
diff --git a/requirements/pep8-check.txt b/requirements/pep8-check.txt
index c4d0379..ca57f58 100644
--- a/requirements/pep8-check.txt
+++ b/requirements/pep8-check.txt
@@ -1,3 +1,3 @@
-flake8==7.0.0
+flake8==7.1.0
 flake8-unused-arguments==0.0.13
 flake8-use-fstring==1.4
diff --git a/requirements/pep8.txt b/requirements/pep8.txt
index c6ed422..75fe235 100644
--- a/requirements/pep8.txt
+++ b/requirements/pep8.txt
@@ -1,1 +1,1 @@
-autopep8==2.1.0
+autopep8==2.3.1
diff --git a/requirements/pypi-deploy.txt b/requirements/pypi-deploy.txt
index 115345d..52786eb 100644
--- a/requirements/pypi-deploy.txt
+++ b/requirements/pypi-deploy.txt
@@ -1,3 +1,3 @@
-setuptools==69.5.1
-twine==5.1.0
+setuptools==70.1.0
+twine==5.1.1
 wheel==0.43.0
diff --git a/requirements/sphinx-docs.txt b/requirements/sphinx-docs.txt
index ced35ba..420fd9b 100644
--- a/requirements/sphinx-docs.txt
+++ b/requirements/sphinx-docs.txt
@@ -1,7 +1,7 @@
 # Dependency of `sphinx-book-theme`.
 # Added explicitly after https://github.com/pydata/pydata-sphinx-theme/pull/1503
 # broke the build despite no explicit update to deps.
-pydata-sphinx-theme==0.15.2
+pydata-sphinx-theme==0.15.3
 
 sphinx==6.2.1
-sphinx-book-theme==1.1.2
+sphinx-book-theme==1.1.3
diff --git a/requirements/typos.txt b/requirements/typos.txt
index 48b8b3a..0d8c671 100644
--- a/requirements/typos.txt
+++ b/requirements/typos.txt
@@ -1,1 +1,1 @@
-typos==1.21.0
+typos==1.22.9


Test patch:
diff --git a/requirements/testenv.txt b/requirements/testenv.txt
index f3b1662..375ad03 100644
--- a/requirements/testenv.txt
+++ b/requirements/testenv.txt
@@ -1,6 +1,6 @@
 pytest==7.0.1; python_version <= '3.6'
 pytest==7.4.4; python_version >= '3.7' and python_version < '3.8'
-pytest==8.2.1; python_version >= '3.8'
+pytest==8.2.2; python_version >= '3.8'
 
 pytest-mock==3.6.1; python_version <= '3.6'
 pytest-mock==3.11.1; python_version >= '3.7' and python_version < '3.8'
diff --git a/tests/test_github_create_pr.py b/tests/test_github_create_pr.py
index dd24c0c..858c2c7 100644
--- a/tests/test_github_create_pr.py
+++ b/tests/test_github_create_pr.py
@@ -142,7 +142,7 @@ class TestGitHubCreatePR(BaseTest):
                 |
                 x-drop-constraint (untracked)
 
-            Checking if base branch ignore-trailing exists on origin remote... YES
+            Checking if base branch ignore-trailing exists in origin remote... YES
             Creating a draft PR from chore/fields to ignore-trailing... OK, see www.github.com
             Checking for open GitHub PRs (to determine PR chain)... OK
             Updating description of PR #5 to include the chain of PRs... OK
@@ -161,8 +161,10 @@ class TestGitHubCreatePR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #5: `chore/fields` ➔ `ignore-trailing`
-            * PR #3: `ignore-trailing` ➔ `hotfix/add-trigger`
+            * PR #5:
+              `chore/fields` ➔ `ignore-trailing`
+            * PR #3:
+              `ignore-trailing` ➔ `hotfix/add-trigger`
 
             <!-- end git-machete generated -->
 
@@ -289,7 +291,7 @@ class TestGitHubCreatePR(BaseTest):
               |
               o-testing/endpoints
 
-            Checking if base branch develop exists on origin remote... YES
+            Checking if base branch develop exists in origin remote... YES
             Creating a PR from allow-ownership-link to develop... OK, see www.github.com
             Setting milestone of PR #7 to 42... OK
             Adding github_user as assignee to PR #7... OK
@@ -364,9 +366,12 @@ class TestGitHubCreatePR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #3: `call-ws` ➔ `build-chain`
-            * PR #2: `build-chain` ➔ `allow-ownership-link`
-            * PR #1: `allow-ownership-link` ➔ `develop`
+            * PR #3:
+              `call-ws` ➔ `build-chain`
+            * PR #2:
+              `build-chain` ➔ `allow-ownership-link`
+            * PR #1:
+              `allow-ownership-link` ➔ `develop`
 
             <!-- end git-machete generated -->
         ''')[1:]
@@ -383,10 +388,14 @@ class TestGitHubCreatePR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #4: `drop-constraint` ➔ `call-ws`
-            * PR #3: `call-ws` ➔ `build-chain`
-            * PR #2: `build-chain` ➔ `allow-ownership-link`
-            * PR #1: `allow-ownership-link` ➔ `develop`
+            * PR #4:
+              `drop-constraint` ➔ `call-ws`
+            * PR #3:
+              `call-ws` ➔ `build-chain`
+            * PR #2:
+              `build-chain` ➔ `allow-ownership-link`
+            * PR #1:
+              `allow-ownership-link` ➔ `develop`
 
             <!-- end git-machete generated -->
 
@@ -428,7 +437,7 @@ class TestGitHubCreatePR(BaseTest):
             """
         rewrite_branch_layout_file(body)
 
-        expected_msg = ("Checking if base branch feature/api_handling exists on origin remote... NO\n"
+        expected_msg = ("Checking if base branch feature/api_handling exists in origin remote... NO\n"
                         "Pushing untracked branch feature/api_handling to origin...\n"
                         "Creating a PR from feature/api_exception_handling to feature/api_handling... OK, see www.github.com\n")
 
@@ -561,7 +570,7 @@ class TestGitHubCreatePR(BaseTest):
             |
             o-feature *
 
-        Checking if base branch branch-1 exists on origin_1 remote... YES
+        Checking if base branch branch-1 exists in origin_1 remote... YES
         Creating a PR from feature to branch-1... OK, see www.github.com
         Checking for open GitHub PRs (to determine PR chain)... OK
         Updating description of PR #16 to include the chain of PRs... OK
@@ -582,8 +591,10 @@ class TestGitHubCreatePR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #16: `feature` ➔ `branch-1`
-            * PR #15: `branch-1` ➔ `root`
+            * PR #16:
+              `feature` ➔ `branch-1`
+            * PR #15:
+              `branch-1` ➔ `root`
 
             <!-- end git-machete generated -->
 
@@ -612,7 +623,7 @@ class TestGitHubCreatePR(BaseTest):
         expected_result = """
         Add feature_1 onto the inferred upstream (parent) branch feature? (y, N)
         Added branch feature_1 onto feature
-        Checking if base branch feature exists on origin_2 remote... YES
+        Checking if base branch feature exists in origin_2 remote... YES
         Creating a PR from feature_1 to feature... OK, see www.github.com
         Checking for open GitHub PRs (to determine PR chain)... OK
         Updating description of PR #17 to include the chain of PRs... OK
@@ -650,7 +661,7 @@ class TestGitHubCreatePR(BaseTest):
               |
               o-feature_2 *
 
-        Checking if base branch feature exists on origin_1 remote... YES
+        Checking if base branch feature exists in origin_1 remote... YES
         Creating a PR from feature_2 to feature... OK, see www.github.com
         Checking for open GitHub PRs (to determine PR chain)... OK
         Updating description of PR #18 to include the chain of PRs... OK
@@ -672,7 +683,7 @@ class TestGitHubCreatePR(BaseTest):
         expected_result = """
         Add feature_3 onto the inferred upstream (parent) branch feature_2? (y, N)
         Added branch feature_3 onto feature_2
-        Checking if base branch feature_2 exists on origin_1 remote... YES
+        Checking if base branch feature_2 exists in origin_1 remote... YES
         Creating a PR from feature_3 to feature_2... OK, see www.github.com
         Checking for open GitHub PRs (to determine PR chain)... OK
         Updating description of PR #19 to include the chain of PRs... OK
@@ -694,7 +705,7 @@ class TestGitHubCreatePR(BaseTest):
         expected_result = """
         Add feature_4 onto the inferred upstream (parent) branch feature_3? (y, N)
         Added branch feature_4 onto feature_3
-        Checking if base branch feature_3 exists on origin_2 remote... NO
+        Checking if base branch feature_3 exists in origin_2 remote... NO
         Push untracked branch feature_3 to origin_2? (y, Q)
         Creating a PR from feature_4 to feature_3... OK, see www.github.com
         """
@@ -716,7 +727,7 @@ class TestGitHubCreatePR(BaseTest):
         expected_result = """
         Add feature_5 onto the inferred upstream (parent) branch feature_3? (y, N)
         Added branch feature_5 onto feature_3
-        Checking if base branch feature_3 exists on origin remote... NO
+        Checking if base branch feature_3 exists in origin remote... NO
         Push untracked branch feature_3 to origin? (y, Q)
         Creating a PR from feature_5 to feature_3... OK, see www.github.com
         """
@@ -741,7 +752,7 @@ class TestGitHubCreatePR(BaseTest):
         assert_success(
             ['github', 'create-pr'],
             """
-            Checking if base branch master exists on origin remote... YES
+            Checking if base branch master exists in origin remote... YES
             Creating a PR from develop to master... OK, see www.github.com
             """
         )
@@ -786,7 +797,7 @@ class TestGitHubCreatePR(BaseTest):
             """
             Warn: Branch develop is behind its remote counterpart. Consider using git pull.
             Proceed with creating pull request? (y, Q)
-            Checking if base branch master exists on origin remote... YES
+            Checking if base branch master exists in origin remote... YES
             Creating a PR from develop to master... OK, see www.github.com
             """
         )
@@ -846,7 +857,7 @@ class TestGitHubCreatePR(BaseTest):
             """
             Warn: Branch develop is diverged from and older than its remote counterpart. Consider using git reset --keep.
             Proceed with creating pull request? (y, Q)
-            Checking if base branch master exists on origin remote... YES
+            Checking if base branch master exists in origin remote... YES
             Creating a PR from develop to master... OK, see www.github.com
             """
         )
@@ -873,7 +884,7 @@ class TestGitHubCreatePR(BaseTest):
         assert_success(
             ['github', 'create-pr'],
             """
-            Checking if base branch develop exists on origin remote... NO
+            Checking if base branch develop exists in origin remote... NO
             Push untracked branch develop to origin? (y, Q)
             Creating a PR from feature to develop... OK, see www.github.com
             """
@@ -895,7 +906,7 @@ class TestGitHubCreatePR(BaseTest):
         assert_success(
             ['github', 'create-pr'],
             """
-            Checking if base branch develop exists on origin remote... YES
+            Checking if base branch develop exists in origin remote... YES
             Creating a PR from feature to develop... OK, see www.github.com
             """
         )
diff --git a/tests/test_github_restack_pr.py b/tests/test_github_restack_pr.py
index a3da57b..8f40f25 100644
--- a/tests/test_github_restack_pr.py
+++ b/tests/test_github_restack_pr.py
@@ -222,21 +222,40 @@ class TestGitHubRestackPR(BaseTest):
             .push()
             .commit()
         )
+
         body: str = \
             """
             master
                 feature push=no
             """
         rewrite_branch_layout_file(body)
-
-        assert_success(
+        assert_failure(
             ['github', 'restack-pr'],
             """
-            Warn: Branch feature is marked as push=no; skipping the push.
+            Branch feature is marked as push=no; aborting the restack.
             Did you want to just use git machete github retarget-pr?
+            """
+        )
 
+        body = \
+            """
+            master
+                feature
+            """
+        rewrite_branch_layout_file(body)
+        assert_success(
+            ['github', 'restack-pr'],
+            """
+            PR #15 has been temporarily marked as draft
             Base branch of PR #15 has been switched to master
             Description of PR #15 has been updated
+            Pushing feature to origin...
+
+              master (untracked)
+              |
+              o-feature *  PR #15 (some_other_user)
+
+            PR #15 has been marked as ready for review again
             """
         )
         pr = github_api_state.get_pull_by_number(15)
diff --git a/tests/test_github_retarget_pr.py b/tests/test_github_retarget_pr.py
index 3fdfe84..099122a 100644
--- a/tests/test_github_retarget_pr.py
+++ b/tests/test_github_retarget_pr.py
@@ -267,8 +267,10 @@ class TestGitHubRetargetPR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #20: `feature_1` ➔ `feature`
-            * PR #15: `feature` ➔ `master`
+            * PR #20:
+              `feature_1` ➔ `feature`
+            * PR #15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->
             # Summary''')[1:]
@@ -314,8 +316,10 @@ class TestGitHubRetargetPR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #25: `feature_2` ➔ `feature`
-            * PR #15: `feature` ➔ `master`
+            * PR #25:
+              `feature_2` ➔ `feature`
+            * PR #15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->''')[1:]
 
@@ -354,9 +358,12 @@ class TestGitHubRetargetPR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #30: `feature_3` ➔ `feature_2`
-            * PR #25: `feature_2` ➔ `feature`
-            * PR #15: `feature` ➔ `master`
+            * PR #30:
+              `feature_3` ➔ `feature_2`
+            * PR #25:
+              `feature_2` ➔ `feature`
+            * PR #15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->
             # Summary''')[1:]
@@ -388,8 +395,10 @@ class TestGitHubRetargetPR(BaseTest):
 
             ## Full chain of PRs as of 2023-12-31
 
-            * PR #30: `feature_3` ➔ `feature`
-            * PR #15: `feature` ➔ `master`
+            * PR #30:
+              `feature_3` ➔ `feature`
+            * PR #15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->
             # Summary''')[1:]
diff --git a/tests/test_gitlab_create_mr.py b/tests/test_gitlab_create_mr.py
index c690587..f46b38e 100644
--- a/tests/test_gitlab_create_mr.py
+++ b/tests/test_gitlab_create_mr.py
@@ -141,7 +141,7 @@ class TestGitLabCreateMR(BaseTest):
                 |
                 x-drop-constraint (untracked)
 
-            Checking if target branch ignore-trailing exists on origin remote... YES
+            Checking if target branch ignore-trailing exists in origin remote... YES
             Creating a draft MR from chore/fields to ignore-trailing... OK, see www.gitlab.com
             Checking for open GitLab MRs (to determine MR chain)... OK
             Updating description of MR !5 to include the chain of MRs... OK
@@ -160,8 +160,10 @@ class TestGitLabCreateMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !5: `chore/fields` ➔ `ignore-trailing`
-            * MR !3: `ignore-trailing` ➔ `hotfix/add-trigger`
+            * MR !5:
+              `chore/fields` ➔ `ignore-trailing`
+            * MR !3:
+              `ignore-trailing` ➔ `hotfix/add-trigger`
 
             <!-- end git-machete generated -->
 
@@ -287,7 +289,7 @@ class TestGitLabCreateMR(BaseTest):
               |
               o-testing/endpoints
 
-            Checking if target branch develop exists on origin remote... YES
+            Checking if target branch develop exists in origin remote... YES
             Creating a MR from allow-ownership-link to develop... OK, see www.gitlab.com
             Setting milestone of MR !7 to 42... OK
             Adding gitlab_user as assignee to MR !7... OK
@@ -359,9 +361,12 @@ class TestGitLabCreateMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !3: `call-ws` ➔ `build-chain`
-            * MR !2: `build-chain` ➔ `allow-ownership-link`
-            * MR !1: `allow-ownership-link` ➔ `develop`
+            * MR !3:
+              `call-ws` ➔ `build-chain`
+            * MR !2:
+              `build-chain` ➔ `allow-ownership-link`
+            * MR !1:
+              `allow-ownership-link` ➔ `develop`
 
             <!-- end git-machete generated -->
         ''')[1:]
@@ -378,10 +383,14 @@ class TestGitLabCreateMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !4: `drop-constraint` ➔ `call-ws`
-            * MR !3: `call-ws` ➔ `build-chain`
-            * MR !2: `build-chain` ➔ `allow-ownership-link`
-            * MR !1: `allow-ownership-link` ➔ `develop`
+            * MR !4:
+              `drop-constraint` ➔ `call-ws`
+            * MR !3:
+              `call-ws` ➔ `build-chain`
+            * MR !2:
+              `build-chain` ➔ `allow-ownership-link`
+            * MR !1:
+              `allow-ownership-link` ➔ `develop`
 
             <!-- end git-machete generated -->
 
@@ -423,7 +432,7 @@ class TestGitLabCreateMR(BaseTest):
             """
         rewrite_branch_layout_file(body)
 
-        expected_msg = ("Checking if target branch feature/api_handling exists on origin remote... NO\n"
+        expected_msg = ("Checking if target branch feature/api_handling exists in origin remote... NO\n"
                         "Pushing untracked branch feature/api_handling to origin...\n"
                         "Creating a MR from feature/api_exception_handling to feature/api_handling... OK, see www.gitlab.com\n")
 
@@ -556,7 +565,7 @@ class TestGitLabCreateMR(BaseTest):
             |
             o-feature *
 
-        Checking if target branch branch-1 exists on origin_1 remote... YES
+        Checking if target branch branch-1 exists in origin_1 remote... YES
         Creating a MR from feature to branch-1... OK, see www.gitlab.com
         Checking for open GitLab MRs (to determine MR chain)... OK
         Updating description of MR !16 to include the chain of MRs... OK
@@ -577,8 +586,10 @@ class TestGitLabCreateMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !16: `feature` ➔ `branch-1`
-            * MR !15: `branch-1` ➔ `root`
+            * MR !16:
+              `feature` ➔ `branch-1`
+            * MR !15:
+              `branch-1` ➔ `root`
 
             <!-- end git-machete generated -->
 
@@ -607,7 +618,7 @@ class TestGitLabCreateMR(BaseTest):
         expected_result = """
         Add feature_1 onto the inferred upstream (parent) branch feature? (y, N)
         Added branch feature_1 onto feature
-        Checking if target branch feature exists on origin_2 remote... YES
+        Checking if target branch feature exists in origin_2 remote... YES
         Creating a MR from feature_1 to feature... OK, see www.gitlab.com
         Checking for open GitLab MRs (to determine MR chain)... OK
         Updating description of MR !17 to include the chain of MRs... OK
@@ -645,7 +656,7 @@ class TestGitLabCreateMR(BaseTest):
               |
               o-feature_2 *
 
-        Checking if target branch feature exists on origin_1 remote... YES
+        Checking if target branch feature exists in origin_1 remote... YES
         Creating a MR from feature_2 to feature... OK, see www.gitlab.com
         Checking for open GitLab MRs (to determine MR chain)... OK
         Updating description of MR !18 to include the chain of MRs... OK
@@ -667,7 +678,7 @@ class TestGitLabCreateMR(BaseTest):
         expected_result = """
         Add feature_3 onto the inferred upstream (parent) branch feature_2? (y, N)
         Added branch feature_3 onto feature_2
-        Checking if target branch feature_2 exists on origin_1 remote... YES
+        Checking if target branch feature_2 exists in origin_1 remote... YES
         Creating a MR from feature_3 to feature_2... OK, see www.gitlab.com
         Checking for open GitLab MRs (to determine MR chain)... OK
         Updating description of MR !19 to include the chain of MRs... OK
@@ -689,7 +700,7 @@ class TestGitLabCreateMR(BaseTest):
         expected_result = """
         Add feature_4 onto the inferred upstream (parent) branch feature_3? (y, N)
         Added branch feature_4 onto feature_3
-        Checking if target branch feature_3 exists on origin_2 remote... NO
+        Checking if target branch feature_3 exists in origin_2 remote... NO
         Push untracked branch feature_3 to origin_2? (y, Q)
         Creating a MR from feature_4 to feature_3... OK, see www.gitlab.com
         """
@@ -711,7 +722,7 @@ class TestGitLabCreateMR(BaseTest):
         expected_result = """
         Add feature_5 onto the inferred upstream (parent) branch feature_3? (y, N)
         Added branch feature_5 onto feature_3
-        Checking if target branch feature_3 exists on origin remote... NO
+        Checking if target branch feature_3 exists in origin remote... NO
         Push untracked branch feature_3 to origin? (y, Q)
         Creating a MR from feature_5 to feature_3... OK, see www.gitlab.com
         """
@@ -736,7 +747,7 @@ class TestGitLabCreateMR(BaseTest):
         assert_success(
             ['gitlab', 'create-mr'],
             """
-            Checking if target branch master exists on origin remote... YES
+            Checking if target branch master exists in origin remote... YES
             Creating a MR from develop to master... OK, see www.gitlab.com
             """
         )
@@ -781,7 +792,7 @@ class TestGitLabCreateMR(BaseTest):
             """
             Warn: Branch develop is behind its remote counterpart. Consider using git pull.
             Proceed with creating merge request? (y, Q)
-            Checking if target branch master exists on origin remote... YES
+            Checking if target branch master exists in origin remote... YES
             Creating a MR from develop to master... OK, see www.gitlab.com
             """
         )
@@ -841,7 +852,7 @@ class TestGitLabCreateMR(BaseTest):
             """
             Warn: Branch develop is diverged from and older than its remote counterpart. Consider using git reset --keep.
             Proceed with creating merge request? (y, Q)
-            Checking if target branch master exists on origin remote... YES
+            Checking if target branch master exists in origin remote... YES
             Creating a MR from develop to master... OK, see www.gitlab.com
             """
         )
@@ -868,7 +879,7 @@ class TestGitLabCreateMR(BaseTest):
         assert_success(
             ['gitlab', 'create-mr'],
             """
-            Checking if target branch develop exists on origin remote... NO
+            Checking if target branch develop exists in origin remote... NO
             Push untracked branch develop to origin? (y, Q)
             Creating a MR from feature to develop... OK, see www.gitlab.com
             """
@@ -890,7 +901,7 @@ class TestGitLabCreateMR(BaseTest):
         assert_success(
             ['gitlab', 'create-mr'],
             """
-            Checking if target branch develop exists on origin remote... YES
+            Checking if target branch develop exists in origin remote... YES
             Creating a MR from feature to develop... OK, see www.gitlab.com
             """
         )
diff --git a/tests/test_gitlab_restack_mr.py b/tests/test_gitlab_restack_mr.py
index f9229c7..210cf84 100644
--- a/tests/test_gitlab_restack_mr.py
+++ b/tests/test_gitlab_restack_mr.py
@@ -226,23 +226,43 @@ class TestGitLabRestackMR(BaseTest):
             .push()
             .commit()
         )
+
         body: str = \
             """
             master
                 feature push=no
             """
         rewrite_branch_layout_file(body)
-
-        assert_success(
+        assert_failure(
             ['gitlab', 'restack-mr'],
             """
-            Warn: Branch feature is marked as push=no; skipping the push.
+            Branch feature is marked as push=no; aborting the restack.
             Did you want to just use git machete gitlab retarget-mr?
+            """
+        )
 
+        body = \
+            """
+            master
+                feature
+            """
+        rewrite_branch_layout_file(body)
+        assert_success(
+            ['gitlab', 'restack-mr'],
+            """
+            MR !15 has been temporarily marked as draft
             Target branch of MR !15 has been switched to master
             Description of MR !15 has been updated
+            Pushing feature to origin...
+
+              master (untracked)
+              |
+              o-feature *  MR !15 (some_other_user)
+
+            MR !15 has been marked as ready for review again
             """
         )
+
         mr = gitlab_api_state.get_mr_by_number(15)
         assert mr is not None
         assert mr['draft'] is False
diff --git a/tests/test_gitlab_retarget_mr.py b/tests/test_gitlab_retarget_mr.py
index c2f7a13..a8bb248 100644
--- a/tests/test_gitlab_retarget_mr.py
+++ b/tests/test_gitlab_retarget_mr.py
@@ -273,8 +273,10 @@ class TestGitLabRetargetMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !20: `feature_1` ➔ `feature`
-            * MR !15: `feature` ➔ `master`
+            * MR !20:
+              `feature_1` ➔ `feature`
+            * MR !15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->
             # Summary''')[1:]
@@ -320,8 +322,10 @@ class TestGitLabRetargetMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !25: `feature_2` ➔ `feature`
-            * MR !15: `feature` ➔ `master`
+            * MR !25:
+              `feature_2` ➔ `feature`
+            * MR !15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->''')[1:]
 
@@ -360,9 +364,12 @@ class TestGitLabRetargetMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !30: `feature_3` ➔ `feature_2`
-            * MR !25: `feature_2` ➔ `feature`
-            * MR !15: `feature` ➔ `master`
+            * MR !30:
+              `feature_3` ➔ `feature_2`
+            * MR !25:
+              `feature_2` ➔ `feature`
+            * MR !15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->
             # Summary''')[1:]
@@ -394,8 +401,10 @@ class TestGitLabRetargetMR(BaseTest):
 
             ## Full chain of MRs as of 2023-12-31
 
-            * MR !30: `feature_3` ➔ `feature`
-            * MR !15: `feature` ➔ `master`
+            * MR !30:
+              `feature_3` ➔ `feature`
+            * MR !15:
+              `feature` ➔ `master`
 
             <!-- end git-machete generated -->
             # Summary''')[1:]