Repository: VirtusLab/git-machete
Pull request #1446 (2025-06-02 18:45:21)

Release v3.36.0


Patch:
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index bc1abda..c9a0e66 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -1,5 +1,9 @@
 # Release notes
 
+## New in git-machete 3.36.0
+
+- deprecated: `git machete fork-point --override-to=...` and `--override-to-inferred` options; use `--override-to-parent`, or run `git machete update [--fork-point=...]` instead
+
 ## New in git-machete 3.35.1
 
 - fixed: `git machete git{hub,lab} update-{pr,mr}-descriptions --related` could not update the current PR/MR in default intro style
diff --git a/ci/aur/README.md b/ci/aur/README.md
new file mode 100644
index 0000000..3a5bc89
--- /dev/null
+++ b/ci/aur/README.md
@@ -0,0 +1,5 @@
+## Build of git-machete Arch Linux package from local machine
+
+```bash
+./ci/aur/local-run.sh
+```
diff --git a/ci/aur/build-context/entrypoint.sh b/ci/aur/build-context/entrypoint.sh
index 1eae184..b6606c9 100644
--- a/ci/aur/build-context/entrypoint.sh
+++ b/ci/aur/build-context/entrypoint.sh
@@ -9,7 +9,7 @@ sed -i "s/pkgver=.*/pkgver=$GIT_REVISION/" PKGBUILD
 url=https://github.com/VirtusLab/git-machete/archive/$GIT_REVISION.tar.gz
 sed -i "s!::[^\"]*!::$url!" PKGBUILD
 hash=$(curl -L -s $url | sha256sum | head -c 64)
-sed -i "s/sha256sums=.*/sha256sums=('$hash')/" PKGBUILD
+sed -i "s/sha256sums=('[^']*/sha256sums=('$hash/" PKGBUILD
 cat PKGBUILD
 
 makepkg --syncdeps --log --install --clean --noconfirm
diff --git a/ci/tox/build-context/requirements.txt b/ci/tox/build-context/requirements.txt
index f2d1b67..41b85f2 100644
--- a/ci/tox/build-context/requirements.txt
+++ b/ci/tox/build-context/requirements.txt
@@ -5,7 +5,7 @@ build==1.2.2.post1; python_version >= '3.8'
 setuptools==59.6.0; python_version <= '3.6'
 setuptools==68.0.0; python_version >= '3.7' and python_version < '3.8'
 setuptools==75.3.0; python_version >= '3.8' and python_version < '3.9'
-setuptools==80.7.1; python_version >= '3.9'
+setuptools==80.9.0; python_version >= '3.9'
 
 tox==3.28.0; python_version <= '3.6'
 tox==4.8.0; python_version >= '3.7' and python_version < '3.8'
diff --git a/docs/man/git-machete.1 b/docs/man/git-machete.1
index 578b7f1..4d7d64a 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 19, 2025" "" "git-machete"
+.TH "GIT-MACHETE" "1" "May 30, 2025" "" "git-machete"
 .SH NAME
-git-machete \- git-machete 3.35.1
+git-machete \- git-machete 3.36.0
 .sp
 git machete is a robust tool that \fBsimplifies your git workflows\fP\&.
 .sp
@@ -821,10 +821,10 @@ git machete fork\-point \-\-unset\-override [<branch>]
 Note: in all three forms, if no \fB<branch>\fP is specified, the currently checked out branch is assumed.
 The branch in question does not need to occur in the branch layout file.
 .sp
-Without any option, \fBgit machete fork\-point\fP displays full hash of the fork point commit for the \fB<branch>\fP\&.
-Fork point of the given \fB<branch>\fP is the commit at which the history of the \fB<branch>\fP diverges from history of any other branch.
+Without any option, \fBgit machete fork\-point\fP displays full hash of the fork point commit for \fB<branch>\fP\&.
+Fork point of the given \fB<branch>\fP is the commit at which the history of \fB<branch>\fP diverges from history of any other branch.
 .sp
-Fork point is assumed by many \fBgit machete\fP commands as the place where the unique history of the \fB<branch>\fP starts.
+Fork point is assumed by many \fBgit machete\fP commands as the place where the unique history of \fB<branch>\fP starts.
 The range of commits between the fork point and the tip of the given branch is, for instance:
 .INDENT 0.0
 .IP \(bu 2
@@ -848,25 +848,26 @@ since the latter takes into account only the reflog of the one provided upstream
 while the former scans reflogs of all local branches and their remote tracking branches.
 This makes git machete\(aqs \fBfork\-point\fP more resilient to modifications of \fB\&.git/machete\fP \fI\%file\fP when certain branches are re\-attached under new parents (upstreams).
 .sp
-With \fB\-\-override\-to=<revision>\fP, sets up a fork point override for \fB<branch>\fP\&.
-Fork point for \fB<branch>\fP will be overridden to the provided <revision> (commit) as long as the \fB<branch>\fP still points to (or is descendant of) that commit.
+With \fB\-\-override\-to\-parent\fP, overrides fork point of \fB<branch>\fP to the commit pointed by \fB<branch>\fP\(aqs parent in branch layout.
 The override data is stored under \fBmachete.overrideForkPoint.<branch>.to\fP git config key.
-Note: the provided fork point \fB<revision>\fP must be an ancestor of the current \fB<branch>\fP commit.
+Note: the override only works as long as parent of \fB<branch>\fP is an ancestor of current \fB<branch>\fP commit.
 .sp
-With \fB\-\-override\-to\-parent\fP, overrides fork point of the \fB<branch>\fP to the commit currently pointed by \fB<branch>\fP\(aqs parent in the branch dependency tree.
-Note: this will only work if \fB<branch>\fP has a parent at all (is not a root branch) and parent of \fB<branch>\fP is an ancestor of current \fB<branch>\fP commit.
+With \fB\-\-override\-to=<revision>\fP, overrides fork point of \fB<branch>\fP to the selected commit.
+Note: this option is \fBdeprecated\fP since it may lead to confusing user experience (due to the \(dqhidden\(dq commits between fork point and parent branch in green\-edge case).
+Use \fB\-\-override\-to\-parent\fP, or rebase the branch onto its parent with \fBgit machete update \-\-fork\-point=<revision>\fP\&.
 .sp
-With \fB\-\-inferred\fP, displays the commit that \fBgit machete fork\-point\fP infers to be the fork point of \fB<branch>\fP\&.
+With \fB\-\-inferred\fP, displays the commit that \fBgit machete fork\-point\fP infers to be fork point of \fB<branch>\fP\&.
 If there is NO fork point override for \fB<branch>\fP, this is identical to the output of \fBgit machete fork\-point\fP\&.
 If there is a fork point override for \fB<branch>\fP, this is identical to the what the output of \fBgit machete fork\-point\fP would be if the override was NOT present.
-.sp
-With \fB\-\-override\-to\-inferred\fP option, overrides fork point of the \fB<branch>\fP to the commit that \fBgit machete fork\-point\fP infers to be the fork point of \fB<branch>\fP\&.
 Note: this piece of information is also displayed by \fBgit machete status \-\-list\-commits\fP in case a yellow edge occurs.
 .sp
+With \fB\-\-override\-to\-inferred\fP option, overrides fork point of \fB<branch>\fP to the result of \fBgit machete fork\-point \-\-inferred\fP for \fB<branch>\fP\&.
+Note: similarly to \fB\-\-override\-to=<revision>\fP, this option is \fBdeprecated\fP\&.
+.sp
 With \fB\-\-unset\-override\fP, the fork point override for \fB<branch>\fP is unset.
-This is simply done by removing the corresponding \fBmachete.overrideForkPoint.<branch>.to\fP config entry.
+This is simply done by removing the corresponding \fBmachete.overrideForkPoint.<branch>.to\fP git config entry.
 .sp
-Note: if an overridden fork point applies to a branch \fBB\fP, then it\(aqs considered to be connected with a green edge to its upstream (parent) \fBU\fP,
+Note: if branch \fBB\fP has an overridden fork point, then \fBB\fP is considered to be connected with a green edge to its upstream (parent) \fBU\fP,
 even if the overridden fork point of \fBB\fP is NOT equal to the commit pointed by \fBU\fP\&.
 .SH FORMAT
 .sp
diff --git a/docs/source/cli/fork-point.rst b/docs/source/cli/fork-point.rst
index 19b0fa4..40ff7ae 100644
--- a/docs/source/cli/fork-point.rst
+++ b/docs/source/cli/fork-point.rst
@@ -23,10 +23,10 @@ Note: in all three forms, if no ``<branch>`` is specified, the currently checked
 The branch in question does not need to occur in the branch layout file.
 
 
-Without any option, ``git machete fork-point`` displays full hash of the fork point commit for the ``<branch>``.
-Fork point of the given ``<branch>`` is the commit at which the history of the ``<branch>`` diverges from history of any other branch.
+Without any option, ``git machete fork-point`` displays full hash of the fork point commit for ``<branch>``.
+Fork point of the given ``<branch>`` is the commit at which the history of ``<branch>`` diverges from history of any other branch.
 
-Fork point is assumed by many ``git machete`` commands as the place where the unique history of the ``<branch>`` starts.
+Fork point is assumed by many ``git machete`` commands as the place where the unique history of ``<branch>`` starts.
 The range of commits between the fork point and the tip of the given branch is, for instance:
 
 * listed for each branch by ``git machete status --list-commits``
@@ -46,25 +46,25 @@ since the latter takes into account only the reflog of the one provided upstream
 while the former scans reflogs of all local branches and their remote tracking branches.
 This makes git machete's ``fork-point`` more resilient to modifications of ``.git/machete`` :ref:`file` when certain branches are re-attached under new parents (upstreams).
 
-
-With ``--override-to=<revision>``, sets up a fork point override for ``<branch>``.
-Fork point for ``<branch>`` will be overridden to the provided <revision> (commit) as long as the ``<branch>`` still points to (or is descendant of) that commit.
+With ``--override-to-parent``, overrides fork point of ``<branch>`` to the commit pointed by ``<branch>``'s parent in branch layout.
 The override data is stored under ``machete.overrideForkPoint.<branch>.to`` git config key.
-Note: the provided fork point ``<revision>`` must be an ancestor of the current ``<branch>`` commit.
+Note: the override only works as long as parent of ``<branch>`` is an ancestor of current ``<branch>`` commit.
 
-With ``--override-to-parent``, overrides fork point of the ``<branch>`` to the commit currently pointed by ``<branch>``'s parent in the branch dependency tree.
-Note: this will only work if ``<branch>`` has a parent at all (is not a root branch) and parent of ``<branch>`` is an ancestor of current ``<branch>`` commit.
+With ``--override-to=<revision>``, overrides fork point of ``<branch>`` to the selected commit.
+Note: this option is **deprecated** since it may lead to confusing user experience (due to the "hidden" commits between fork point and parent branch in green-edge case).
+Use ``--override-to-parent``, or rebase the branch onto its parent with ``git machete update --fork-point=<revision>``.
 
-With ``--inferred``, displays the commit that ``git machete fork-point`` infers to be the fork point of ``<branch>``.
+With ``--inferred``, displays the commit that ``git machete fork-point`` infers to be fork point of ``<branch>``.
 If there is NO fork point override for ``<branch>``, this is identical to the output of ``git machete fork-point``.
 If there is a fork point override for ``<branch>``, this is identical to the what the output of ``git machete fork-point`` would be if the override was NOT present.
-
-With ``--override-to-inferred`` option, overrides fork point of the ``<branch>`` to the commit that ``git machete fork-point`` infers to be the fork point of ``<branch>``.
 Note: this piece of information is also displayed by ``git machete status --list-commits`` in case a :yellow:`yellow` edge occurs.
 
+With ``--override-to-inferred`` option, overrides fork point of ``<branch>`` to the result of ``git machete fork-point --inferred`` for ``<branch>``.
+Note: similarly to ``--override-to=<revision>``, this option is **deprecated**.
+
 With ``--unset-override``, the fork point override for ``<branch>`` is unset.
-This is simply done by removing the corresponding ``machete.overrideForkPoint.<branch>.to`` config entry.
+This is simply done by removing the corresponding ``machete.overrideForkPoint.<branch>.to`` git config entry.
 
 
-Note: if an overridden fork point applies to a branch ``B``, then it's considered to be connected with a :green:`green` edge to its upstream (parent) ``U``,
+Note: if branch ``B`` has an overridden fork point, then ``B`` is considered to be connected with a :green:`green` edge to its upstream (parent) ``U``,
 even if the overridden fork point of ``B`` is NOT equal to the commit pointed by ``U``.
diff --git a/git_machete/__init__.py b/git_machete/__init__.py
index b0ddbd1..094089c 100644
--- a/git_machete/__init__.py
+++ b/git_machete/__init__.py
@@ -1,1 +1,1 @@
-__version__ = '3.35.1'
+__version__ = '3.36.0'
diff --git a/git_machete/cli.py b/git_machete/cli.py
index 8f49e00..57e976f 100644
--- a/git_machete/cli.py
+++ b/git_machete/cli.py
@@ -720,16 +720,43 @@ def launch(orig_args: List[str]) -> None:
             fork_point_client = ForkPointMacheteClient(git)
             fork_point_client.read_branch_layout_file()
             branch = cli_opts.opt_branch or git.get_current_branch()
+            upstream = fork_point_client.up_branch_for(branch)
             fork_point_client.expect_in_local_branches(branch)
+
+            def warn_on_deprecation(*, flag: str, revision: AnyRevision, revision_str: str) -> None:
+                if upstream:
+                    print()
+                    warn(
+                        f"`git machete fork-point {flag}` may lead to a confusing user experience and is deprecated.\n\n"
+                        f"If the commits between <b>{upstream}</b> (parent of <b>{branch}</b>) "
+                        f"and {revision_str} <b>{git.get_short_commit_hash_by_revision_or_none(revision) or ''}</b> "
+                        f"do NOT belong to <b>{branch}</b>, consider using:\n"
+                        f"    `git machete update --fork-point=\"{revision}\" {branch}`\n\n"
+                        "Otherwise, if you're okay with treating these commits "
+                        f"as a part of <b>{branch}</b>'s unique history, use instead:\n"
+                        f"    `git machete fork-point --override-to-parent {branch}`"
+                    )
+                # It's unlikely that anyone overrides fork point for a branch that doesn't have a parent,
+                # also it's unclear what the suggested action should even be - let's skip this case.
+
             if cli_opts.opt_inferred:
                 print(fork_point_client.fork_point(branch=branch, use_overrides=False))
             elif cli_opts.opt_override_to:
-                fork_point_client.set_fork_point_override(branch, AnyRevision.of(cli_opts.opt_override_to))
+                override_to = AnyRevision.of(cli_opts.opt_override_to)
+                fork_point_client.set_fork_point_override(branch, override_to)
+                # Let's issue the warning only if there are no errors from set_fork_point_override.
+                warn_on_deprecation(
+                    flag="--override-to=...",
+                    revision=override_to,
+                    revision_str="selected commit")
             elif cli_opts.opt_override_to_inferred:
                 fork_point = fork_point_client.fork_point(branch=branch, use_overrides=False)
                 fork_point_client.set_fork_point_override(branch, fork_point)
+                warn_on_deprecation(
+                    flag="--override-to-inferred",
+                    revision=fork_point,
+                    revision_str="inferred commit")
             elif cli_opts.opt_override_to_parent:
-                upstream = fork_point_client.up_branch_for(branch)
                 if upstream:
                     fork_point_client.set_fork_point_override(branch, upstream)
                 else:
diff --git a/git_machete/client/fork_point.py b/git_machete/client/fork_point.py
index c49dfa2..606cc73 100644
--- a/git_machete/client/fork_point.py
+++ b/git_machete/client/fork_point.py
@@ -17,7 +17,7 @@ class ForkPointMacheteClient(MacheteClient):
             raise MacheteException(f"Cannot find revision {bold(to_revision)}")
         if not self._git.is_ancestor_or_equal(to_hash.full_name(), branch.full_name()):
             raise MacheteException(
-                f"Cannot override fork point: {bold(self._git.get_revision_repr(to_revision))} is not an ancestor of {bold(branch)}")
+                f"Cannot override fork point: {bold(self._get_revision_repr(to_revision))} is not an ancestor of {bold(branch)}")
 
         to_key = git_config_keys.override_fork_point_to(branch)
         self._git.set_config_attr(to_key, to_hash)
@@ -27,7 +27,14 @@ class ForkPointMacheteClient(MacheteClient):
         while_descendant_of_key = git_config_keys.override_fork_point_while_descendant_of(branch)
         self._git.set_config_attr(while_descendant_of_key, to_hash)
 
-        print(fmt(f"Fork point for <b>{branch}</b> is overridden to {self._git.get_revision_repr(to_revision)}.\n",
-                  f"This applies as long as <b>{branch}</b> is a descendant of commit <b>{to_hash}</b>.\n\n"
-                  f"This information is stored under `{to_key}` git config key.\n\n"
-                  f"To unset this override, use:\n  `git machete fork-point --unset-override {branch}`"))
+        short_hash = self._git.get_short_commit_hash_by_revision(to_hash)
+        print(fmt(f"Fork point for <b>{branch}</b> is overridden to {self._get_revision_repr(to_revision)}.\n",
+                  f"This applies as long as <b>{branch}</b> points to a descendant of commit <b>{short_hash}</b>."))
+
+    def _get_revision_repr(self, revision: AnyRevision) -> str:
+        short_hash = self._git.get_short_commit_hash_by_revision_or_none(revision)
+        if not short_hash or revision == short_hash:
+            return f"commit <b>{revision}</b>"
+        if self._git.is_full_hash(revision.full_name()):
+            return f"commit <b>{short_hash}</b>"
+        return f"<b>{revision}</b> (commit <b>{short_hash}</b>)"
diff --git a/git_machete/generated_docs.py b/git_machete/generated_docs.py
index e86f501..74319de 100644
--- a/git_machete/generated_docs.py
+++ b/git_machete/generated_docs.py
@@ -503,10 +503,10 @@ long_docs: Dict[str, str] = {
         Note: in all three forms, if no `<branch>` is specified, the currently checked out branch is assumed.
         The branch in question does not need to occur in the branch layout file.
 
-        Without any option, `git machete fork-point` displays full hash of the fork point commit for the `<branch>`.
-        Fork point of the given `<branch>` is the commit at which the history of the `<branch>` diverges from history of any other branch.
+        Without any option, `git machete fork-point` displays full hash of the fork point commit for `<branch>`.
+        Fork point of the given `<branch>` is the commit at which the history of `<branch>` diverges from history of any other branch.
 
-        Fork point is assumed by many `git machete` commands as the place where the unique history of the `<branch>` starts.
+        Fork point is assumed by many `git machete` commands as the place where the unique history of `<branch>` starts.
         The range of commits between the fork point and the tip of the given branch is, for instance:
            * listed for each branch by `git machete status --list-commits`
            * passed to `git rebase` by `git machete` `reapply`/`slide-out`/`traverse`/`update`
@@ -525,25 +525,26 @@ long_docs: Dict[str, str] = {
         while the former scans reflogs of all local branches and their remote tracking branches.
         This makes git machete's `fork-point` more resilient to modifications of `.git/machete` `file` when certain branches are re-attached under new parents (upstreams).
 
-        With `--override-to=<revision>`, sets up a fork point override for `<branch>`.
-        Fork point for `<branch>` will be overridden to the provided <revision> (commit) as long as the `<branch>` still points to (or is descendant of) that commit.
+        With `--override-to-parent`, overrides fork point of `<branch>` to the commit pointed by `<branch>`'s parent in branch layout.
         The override data is stored under `machete.overrideForkPoint.<branch>.to` git config key.
-        Note: the provided fork point `<revision>` must be an ancestor of the current `<branch>` commit.
+        Note: the override only works as long as parent of `<branch>` is an ancestor of current `<branch>` commit.
 
-        With `--override-to-parent`, overrides fork point of the `<branch>` to the commit currently pointed by `<branch>`'s parent in the branch dependency tree.
-        Note: this will only work if `<branch>` has a parent at all (is not a root branch) and parent of `<branch>` is an ancestor of current `<branch>` commit.
+        With `--override-to=<revision>`, overrides fork point of `<branch>` to the selected commit.
+        Note: this option is <b>deprecated</b> since it may lead to confusing user experience (due to the "hidden" commits between fork point and parent branch in green-edge case).
+        Use `--override-to-parent`, or rebase the branch onto its parent with `git machete update --fork-point=<revision>`.
 
-        With `--inferred`, displays the commit that `git machete fork-point` infers to be the fork point of `<branch>`.
+        With `--inferred`, displays the commit that `git machete fork-point` infers to be fork point of `<branch>`.
         If there is NO fork point override for `<branch>`, this is identical to the output of `git machete fork-point`.
         If there is a fork point override for `<branch>`, this is identical to the what the output of `git machete fork-point` would be if the override was NOT present.
-
-        With `--override-to-inferred` option, overrides fork point of the `<branch>` to the commit that `git machete fork-point` infers to be the fork point of `<branch>`.
         Note: this piece of information is also displayed by `git machete status --list-commits` in case a <yellow>yellow</yellow> edge occurs.
 
+        With `--override-to-inferred` option, overrides fork point of `<branch>` to the result of `git machete fork-point --inferred` for `<branch>`.
+        Note: similarly to `--override-to=<revision>`, this option is <b>deprecated</b>.
+
         With `--unset-override`, the fork point override for `<branch>` is unset.
-        This is simply done by removing the corresponding `machete.overrideForkPoint.<branch>.to` config entry.
+        This is simply done by removing the corresponding `machete.overrideForkPoint.<branch>.to` git config entry.
 
-        Note: if an overridden fork point applies to a branch `B`, then it's considered to be connected with a <green>green</green> edge to its upstream (parent) `U`,
+        Note: if branch `B` has an overridden fork point, then `B` is considered to be connected with a <green>green</green> edge to its upstream (parent) `U`,
         even if the overridden fork point of `B` is NOT equal to the commit pointed by `U`.
    """,
     "format": """
diff --git a/git_machete/git_operations.py b/git_machete/git_operations.py
index 829851f..ab22d66 100644
--- a/git_machete/git_operations.py
+++ b/git_machete/git_operations.py
@@ -439,6 +439,9 @@ class GitContext:
         return ShortCommitHash.of(self._popen_git("rev-parse", "--short", revision + "^{commit}").stdout.rstrip())  # noqa: FS003
 
     def get_short_commit_hash_by_revision_or_none(self, revision: AnyRevision) -> Optional[ShortCommitHash]:
+        # Btw, it looks that modern git returns the same prefix length for each commit in the given repo
+        # (even if for some hashes, a shorter prefix could be enough).
+        # Easy to check with `git log -100 --format=%H | xargs -L1 git rev-parse --short`.
         if revision not in self.__short_commit_hash_by_revision_cached:
             try:
                 self.__short_commit_hash_by_revision_cached[revision] = self.__find_short_commit_hash_by_revision(revision)
@@ -446,6 +449,10 @@ class GitContext:
                 self.__short_commit_hash_by_revision_cached[revision] = None
         return self.__short_commit_hash_by_revision_cached[revision]
 
+    def get_short_commit_hash_by_revision(self, hash: FullCommitHash) -> ShortCommitHash:
+        # For a full commit hash, a short hash should always be available
+        return self.get_short_commit_hash_by_revision_or_none(hash)  # type: ignore[return-value]
+
     def __find_commit_hash_by_revision(self, revision: AnyRevision) -> Optional[FullCommitHash]:
         # Without ^{commit}, 'git rev-parse --verify' will not only accept references to other kinds of objects (like trees and blobs),
         # but just echo the argument (and exit successfully) even if the argument doesn't match anything in the object store.
@@ -711,13 +718,6 @@ class GitContext:
         if switch_head:
             self._run_git("checkout", branch, flush_caches=True)
 
-    def get_revision_repr(self, revision: AnyRevision) -> str:
-        short_hash = self.get_short_commit_hash_by_revision_or_none(revision)
-        if not short_hash or self.is_full_hash(revision.full_name()) or revision == short_hash:
-            return f"commit <b>{revision}</b>"
-        else:
-            return f"<b>{revision}</b> (commit <b>{short_hash}</b>)"
-
     # Note: while rebase is ongoing, the repository is always in a detached HEAD state,
     # so we need to extract the name of the currently rebased branch from the rebase-specific internals
     # rather than rely on 'git symbolic-ref HEAD' (i.e. the contents of .git/HEAD).
diff --git a/requirements/coverage.txt b/requirements/coverage.txt
index e1479f3..74a6be2 100644
--- a/requirements/coverage.txt
+++ b/requirements/coverage.txt
@@ -1,7 +1,7 @@
 coverage==6.2; python_version <= '3.6'
 coverage==7.2.7; python_version >= '3.7' and python_version < '3.8'
 coverage==7.6.1; python_version >= '3.8' and python_version < '3.9'
-coverage==7.8.0; python_version >= '3.9'
+coverage==7.8.2; python_version >= '3.9'
 
 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/mypy.txt b/requirements/mypy.txt
index cb27acf..7d16316 100644
--- a/requirements/mypy.txt
+++ b/requirements/mypy.txt
@@ -1,4 +1,4 @@
 mypy==0.971; python_version <= '3.6'
 mypy==1.4.1; python_version >= '3.7' and python_version < '3.8'
 mypy==1.14.1; python_version >= '3.8' and python_version < '3.9'
-mypy==1.15.0; python_version >= '3.9'
+mypy==1.16.0; python_version >= '3.9'
diff --git a/requirements/pypi-publish.txt b/requirements/pypi-publish.txt
index 03f4e3b..ff2562f 100644
--- a/requirements/pypi-publish.txt
+++ b/requirements/pypi-publish.txt
@@ -1,4 +1,4 @@
 build==1.2.2.post1
-setuptools==80.7.1
+setuptools==80.9.0
 twine==6.1.0
 wheel==0.45.1


Test patch:
diff --git a/requirements/testenv.txt b/requirements/testenv.txt
index d83dcc8..f9479fb 100644
--- a/requirements/testenv.txt
+++ b/requirements/testenv.txt
@@ -6,8 +6,10 @@ pytest-clarity==1.0.1
 
 pytest-mock==3.6.1; python_version <= '3.6'
 pytest-mock==3.11.1; python_version >= '3.7' and python_version < '3.8'
-pytest-mock==3.14.0; python_version >= '3.8'
+pytest-mock==3.14.0; python_version >= '3.8' and python_version < '3.9'
+pytest-mock==3.14.1; python_version >= '3.9'
 
 pytest-xdist==2.4.0; python_version <= '3.6'
 pytest-xdist==3.5.0; python_version >= '3.7' and python_version < '3.8'
-pytest-xdist==3.6.1; python_version >= '3.8'
+pytest-xdist==3.6.1; python_version >= '3.8' and python_version < '3.9'
+pytest-xdist==3.7.0; python_version >= '3.9'
diff --git a/tests/mockers_git_repository.py b/tests/mockers_git_repository.py
index 4b12ebb..1a97866 100644
--- a/tests/mockers_git_repository.py
+++ b/tests/mockers_git_repository.py
@@ -1,7 +1,5 @@
 import os
-import random
 import re
-import string
 import subprocess
 from os import mkdir
 from tempfile import mkdtemp
@@ -44,9 +42,16 @@ def check_out(branch: str) -> None:
     execute(f"git checkout {branch}")
 
 
+counter = 0
+def next_integer() -> int:  # noqa: E302
+    global counter
+    counter += 1
+    return counter
+
+
 def commit(message: Optional[str] = None) -> None:
     if message is None:
-        message = f"Some commit message-{random_letters()}"
+        message = f"Some commit message-{next_integer()}"
     f = message.splitlines()[0].replace(' ', '').replace('.', '')
     f += '.txt'
     execute(f"touch {f}")
@@ -146,7 +151,3 @@ def set_git_config_key(key: str, value: str) -> None:
 
 def unset_git_config_key(key: str) -> None:
     execute(f'git config --unset {key}')
-
-
-def random_letters() -> str:
-    return ''.join(random.choices(string.ascii_uppercase, k=5))
diff --git a/tests/test_fork_point.py b/tests/test_fork_point.py
index c5728ea..82d1dab 100644
--- a/tests/test_fork_point.py
+++ b/tests/test_fork_point.py
@@ -170,7 +170,21 @@ class TestForkPoint(BaseTest):
 
         assert_failure(["fork-point", "--override-to-parent", "master"], "Branch master does not have upstream (parent) branch")
 
-        launch_command("fork-point", "--override-to-inferred")
+        assert_success(
+            ["fork-point", "--override-to-inferred"],
+            """
+            Fork point for develop is overridden to commit ad97c34.
+            This applies as long as develop points to a descendant of commit ad97c34.
+
+            Warn: git machete fork-point --override-to-inferred may lead to a confusing user experience and is deprecated.
+
+            If the commits between master (parent of develop) and inferred commit ad97c34 do NOT belong to develop, consider using:
+                git machete update --fork-point="ad97c343b69296e96858058d8d668cca0132402a" develop
+
+            Otherwise, if you're okay with treating these commits as a part of develop's unique history, use instead:
+                git machete fork-point --override-to-parent develop
+            """
+        )
         assert launch_command("fork-point").strip() == "ad97c343b69296e96858058d8d668cca0132402a"
         assert launch_command("fork-point", "--inferred").strip() == "ad97c343b69296e96858058d8d668cca0132402a"
         assert_success(
@@ -187,11 +201,11 @@ class TestForkPoint(BaseTest):
         create_repo()
         with fixed_author_and_committer_date_in_past():
             new_branch("branch-0")
-            commit()
+            commit("0")
             new_branch("branch-1")
-            commit()
+            commit("1")
             new_branch("branch-2")
-            commit()
+            commit("2")
 
         body: str = \
             """
@@ -199,7 +213,21 @@ class TestForkPoint(BaseTest):
                 branch-2
             """
         rewrite_branch_layout_file(body)
-        launch_command('fork-point', '--override-to=branch-0')
+        assert_success(
+            ['fork-point', '--override-to=5e35f5b'],
+            """
+            Fork point for branch-2 is overridden to commit 5e35f5b.
+            This applies as long as branch-2 points to a descendant of commit 5e35f5b.
+
+            Warn: git machete fork-point --override-to=... may lead to a confusing user experience and is deprecated.
+
+            If the commits between branch-1 (parent of branch-2) and selected commit 5e35f5b do NOT belong to branch-2, consider using:
+                git machete update --fork-point="5e35f5b" branch-2
+
+            Otherwise, if you're okay with treating these commits as a part of branch-2's unique history, use instead:
+                git machete fork-point --override-to-parent branch-2
+            """
+        )
 
         assert launch_command("fork-point").strip() == get_commit_hash("branch-1")