Repository: VirtusLab/git-machete
Pull request #1096 (2023-11-19 19:59:20)

Add the github URL to PR annotations
Follow-up to #1091


codecov-commenter: ## [Codecov](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab) Report
Attention: `6 lines` in your changes are missing coverage. Please review.
> Comparison is base [(`b071a63`)](https://app.codecov.io/gh/VirtusLab/git-machete/commit/b071a63d57f2ae896909087705c5644b63cdce30?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab) 98.64% compared to head [(`a412369`)](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab) 98.46%.

| [Files](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab) | Patch % | Lines |
|---|---|---|
| [git\_machete/cli.py](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab#diff-Z2l0X21hY2hldGUvY2xpLnB5) | 42.85% | [2 Missing and 2 partials :warning: ](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab) |
| [git\_machete/client.py](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab#diff-Z2l0X21hY2hldGUvY2xpZW50LnB5) | 87.50% | [1 Missing and 1 partial :warning: ](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab) |

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff             @@
##           develop    #1096      +/-   ##
===========================================
- Coverage    98.64%   98.46%   -0.18%     
===========================================
  Files           12       12              
  Lines         3315     3328      +13     
  Branches       751      754       +3     
===========================================
+ Hits          3270     3277       +7     
- Misses          28       31       +3     
- Partials        17       20       +3     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/VirtusLab/git-machete/pull/1096?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=VirtusLab).


Patch:
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index b215f3c..6f12a4c 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -3,6 +3,8 @@
 ## New in git-machete 3.21.0
 
 - added: `--removed-from-remote` flag to `git machete slide-out` (contributed by @raylu)
+- added: `--with-urls` flag to `git machete github anno-prs` and `machete.github.annotateWithUrls` config key that allow for adding the URL of the PR to the annotations (contributed by @guyboltonking)
+- fixed: PR author is now always added to annotation if different from current user (contributed by @guyboltonking)
 - fixed: `git machete clean` and `git machete github sync` not only delete untracked branches, but also actually slide them out of branch layout
 
 ## New in git-machete 3.20.0
diff --git a/completion/git-machete.completion.bash b/completion/git-machete.completion.bash
index fc691d0..7b43947 100644
--- a/completion/git-machete.completion.bash
+++ b/completion/git-machete.completion.bash
@@ -22,6 +22,7 @@ _git_machete() {
   local diff_opts="-s --stat"
   local discover_opts="-C --checked-out-since= -l --list-commits -r --roots= -y --yes"
   local fork_point_opts="--inferred --override-to= --override-to-inferred --override-to-parent --unset-override"
+  local github_anno_prs_opts="--with-urls"
   local github_create_pr_opts="--draft"
   local github_checkout_prs_opts="--all --by= --mine"
   local github_retarget_pr_opts="-b --branch= --ignore-if-missing"
@@ -52,7 +53,9 @@ _git_machete() {
         discover) __gitcomp "$common_opts $discover_opts" ;;
         fork-point) __gitcomp "$common_opts $fork_point_opts" ;;
         github)
-          if [[ ${COMP_WORDS[3]} == "create-pr" ]]; then
+          if [[ ${COMP_WORDS[3]} == "anno-prs" ]]; then
+            __gitcomp "$common_opts $github_anno_prs_opts"
+          elif [[ ${COMP_WORDS[3]} == "create-pr" ]]; then
             __gitcomp "$common_opts $github_create_pr_opts"
           elif [[ ${COMP_WORDS[3]} == "checkout-prs" ]]; then
             __gitcomp "$common_opts $github_checkout_prs_opts"
@@ -114,6 +117,8 @@ _git_machete() {
               github)
                 if [[ $COMP_CWORD -eq 3 ]]; then
                   __gitcomp "$github_subcommands"
+                elif [[ ${COMP_WORDS[3]} == "anno-prs" ]]; then
+                  __gitcomp "$common_opts $github_anno_prs_opts"
                 elif [[ ${COMP_WORDS[3]} == "create-pr" ]]; then
                   __gitcomp "$common_opts $github_create_pr_opts"
                 elif [[ ${COMP_WORDS[3]} == "checkout-prs" ]]; then
diff --git a/completion/git-machete.completion.zsh b/completion/git-machete.completion.zsh
index 75b9f2f..5058e6f 100644
--- a/completion/git-machete.completion.zsh
+++ b/completion/git-machete.completion.zsh
@@ -263,6 +263,12 @@ __git_machete_github_subcommands() {
     (options)
       case $line[1] in
 
+        (anno-prs) \
+          _arguments \
+            '(--with-urls)'--with-urls'[Include PR URLs in the annotations.]' \
+            "${common_flags[@]}"
+        ;;
+
         (checkout-prs)
           _arguments \
             '(--all)'--all'[Checkout all open PRs.]' \
diff --git a/completion/git-machete.fish b/completion/git-machete.fish
index 548a83b..e285384 100644
--- a/completion/git-machete.fish
+++ b/completion/git-machete.fish
@@ -103,12 +103,13 @@ complete -c git-machete -n "__fish_seen_subcommand_from github; and not __fish_s
 complete -c git-machete -n "__fish_seen_subcommand_from github; and not __fish_seen_subcommand_from anno-prs checkout-prs create-pr restack-pr retarget-pr sync"          -f -a restack-pr                                           -d '(Force-)pushes and retargets the PR, without adding code owners as reviewers in the process'
 complete -c git-machete -n "__fish_seen_subcommand_from github; and not __fish_seen_subcommand_from anno-prs checkout-prs create-pr restack-pr retarget-pr sync"          -f -a retarget-pr                                          -d 'Sets the base of PR for the current branch to upstream (parent) branch, as seen by git machete (see git machete show up)'
 complete -c git-machete -n "__fish_seen_subcommand_from github; and not __fish_seen_subcommand_from anno-prs checkout-prs create-pr restack-pr retarget-pr sync"          -f -a sync                                                 -d 'Synchronize with the remote repository: checkout open PRs for the current user associated with the GitHub token, delete unmanaged branches and also delete untracked managed branches with no downstream branch'
+complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from anno-prs;     and not __fish_seen_subcommand_from --with-urls"            -f -l with-urls                                            -d 'Include PR URLs in the annotations'
 complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from checkout-prs; and not __fish_seen_subcommand_from --all"                  -f -l all                                                  -d 'Checkout all open PRs'
 complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from checkout-prs; and not __fish_seen_subcommand_from --by"                   -x -l by                                                   -d "Checkout someone's open PRs"
 complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from checkout-prs; and not __fish_seen_subcommand_from --mine"                 -x -l mine                                                 -d 'Checkout open PRs for the current user associated with the GitHub token'
 complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from create-pr;    and not __fish_seen_subcommand_from --draft"                -f -l draft                                                -d 'Creates the new PR as a draft'
-complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from retarget-pr; and not __fish_seen_subcommand_from --branch"                -x -l branch -s b       -a '(__machete_managed_branches)'  -d 'Specify the branch for which the associated PR base will be set to its upstream (parent) branch'
-complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from retarget-pr; and not __fish_seen_subcommand_from --ignore-if-missing"     -f -l ignore-if-missing                                    -d 'Ignore errors and quietly terminate execution if there is no PR opened for current (or specified) branch'
+complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from retarget-pr;  and not __fish_seen_subcommand_from --branch"               -x -l branch -s b       -a '(__machete_managed_branches)'  -d 'Specify the branch for which the associated PR base will be set to its upstream (parent) branch'
+complete -c git-machete -n "__fish_seen_subcommand_from github; and __fish_seen_subcommand_from retarget-pr;  and not __fish_seen_subcommand_from --ignore-if-missing"    -f -l ignore-if-missing                                    -d 'Ignore errors and quietly terminate execution if there is no PR opened for current (or specified) branch'
 
 # git machete go
 complete -c git-machete -n "not __fish_seen_subcommand_from $__machete_commands"                                                                   -f -a go    -d 'Check out the branch relative to the position of the current branch, accepts down/first/last/next/root/prev/up argument'
diff --git a/docs/generate_py_docs.py b/docs/generate_py_docs.py
index 9f60a50..e13ccde 100644
--- a/docs/generate_py_docs.py
+++ b/docs/generate_py_docs.py
@@ -146,12 +146,12 @@ def skip_or_replace_unparseable_directives(rst_: str) -> str:
 def resolve_includes(rst_: str, docs_source_path_: str) -> str:
     matches = re.findall(r'(.*)\.\. include:: (.*)\n(.* :(.*): ([0-9]*)\n)?(.* :(.*): ([0-9]*)\n)?', rst_)
     # example matches:
-    #     .. include:: status_config_key.rst
+    #     .. include:: status_extraSpaceBeforeBranchName_config_key.rst
     #
-    #     .. include:: status_config_key.rst
+    #     .. include:: status_extraSpaceBeforeBranchName_config_key.rst
     #         :start-line: 2
     #
-    #     .. include:: status_config_key.rst
+    #     .. include:: status_extraSpaceBeforeBranchName_config_key.rst
     #         :start-line: 2
     #         :end-line: 6
     for indent_, match, option_1_str, option_1, option_1_value, option_2_str, option_2, option_2_value in matches:
diff --git a/docs/man/git-machete.1 b/docs/man/git-machete.1
index 6ecd00e..6f23bcc 100644
--- a/docs/man/git-machete.1
+++ b/docs/man/git-machete.1
@@ -27,7 +27,7 @@ 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" "Nov 25, 2023" "" "git-machete"
+.TH "GIT-MACHETE" "1" "Nov 27, 2023" "" "git-machete"
 .SH NAME
 git-machete \- git-machete 3.21.0
 .sp
@@ -389,11 +389,16 @@ Note: \fBconfig\fP is not a command as such, just a help topic (there is no \fBg
 \fBGit config keys:\fP
 .INDENT 0.0
 .TP
+.B \fBmachete.github.annotateWithUrls\fP:
+Setting this config key to \fBtrue\fP will cause all commands that write GitHub PR numbers into annotations
+to not only include PR number and author (if different from the current user), but also the full URL of the PR.
+.sp
+The affected (sub)commands clearly include \fBanno \-\-sync\-github\-prs\fP and \fBgithub anno\-prs\fP,
+but also \fBgithub checkout\-prs\fP, \fBgithub create\-pr\fP, \fBgithub retarget\-pr\fP and \fBgithub restack\-pr\fP\&.
+.TP
 .B \fBmachete.github.{domain,remote,organization,repository}\fP:
-When executing \fBgit machete github <subcommand>\fP command, the following will happen:
 .INDENT 7.0
 .INDENT 3.5
-GitHub API server URL will be inferred from \fBgit remote\fP\&.
 You can alter the default behavior by setting the following git config keys:
 .INDENT 0.0
 .INDENT 3.5
@@ -426,14 +431,12 @@ There should be \fBno\fP need for the user to interact with this key directly,
 \fBgit machete fork\-point\fP with flags should be used instead.
 .TP
 .B \fBmachete.status.extraSpaceBeforeBranchName\fP:
-.INDENT 7.0
-.INDENT 3.5
 To make it easier to select branch name from the \fBstatus\fP output on certain terminals
 (like \fI\%Alacritty\fP), you can add an extra space between └─ and \fBbranch name\fP
 by setting \fBgit config machete.status.extraSpaceBeforeBranchName true\fP\&.
 .sp
 For example, by default the status is displayed as:
-.INDENT 0.0
+.INDENT 7.0
 .INDENT 3.5
 .sp
 .nf
@@ -449,7 +452,7 @@ develop
 .UNINDENT
 .sp
 With \fBmachete.status.extraSpaceBeforeBranchName\fP config set to \fBtrue\fP:
-.INDENT 0.0
+.INDENT 7.0
 .INDENT 3.5
 .sp
 .nf
@@ -463,17 +466,12 @@ develop
 .fi
 .UNINDENT
 .UNINDENT
-.UNINDENT
-.UNINDENT
 .TP
 .B \fBmachete.traverse.push\fP:
-.INDENT 7.0
-.INDENT 3.5
 To change the behavior of \fBgit machete traverse\fP command so that it doesn\(aqt push branches by default,
 you need to set config key \fBgit config machete.traverse.push false\fP\&.
+.sp
 Configuration key value can be overridden by the presence of the \fB\-\-push\fP or \fB\-\-push\-untracked\fP flags.
-.UNINDENT
-.UNINDENT
 .TP
 .B \fBmachete.worktree.useTopLevelMacheteFile\fP:
 The default value of this key is \fBtrue\fP, which means that the path to branch layout file will be \fB\&.git/machete\fP
@@ -491,11 +489,11 @@ Name of the editor used by \fBgit machete e[dit]\fP, example: \fBvim\fP or \fBna
 .TP
 .B \fBGIT_MACHETE_REBASE_OPTS\fP
 Used to pass extra options to the underlying \fBgit rebase\fP invocation (called by the executed command,
-such as: \fBreapply\fP, \fBslide\-out\fP, \fBtraverse\fP, \fBupdate\fP)
+such as: \fBreapply\fP, \fBslide\-out\fP, \fBtraverse\fP, \fBupdate\fP).
 Example: \fBGIT_MACHETE_REBASE_OPTS=\(dq\-\-keep\-empty \-\-rebase\-merges\(dq git machete update\fP\&.
 .TP
 .B \fBGITHUB_TOKEN\fP
-Used to store GitHub API token. Used by commands such as: \fBanno\fP, \fBclean\fP, \fBgithub\fP\&.
+Used to store GitHub API token. Used by commands such as: \fBanno \-\-sync\-github\-prs\fP, \fBclean\fP, \fBgithub\fP\&.
 .UNINDENT
 .SH CLEAN
 .sp
@@ -1043,45 +1041,34 @@ ghp_yetanothertoken_for_git_example_com git.example.com
 \fBNOTE:\fP
 .INDENT 0.0
 .INDENT 3.5
-GitHub API server URL will be inferred from \fBgit remote\fP\&.
-You can alter the default behavior by setting the following git config keys:
-.INDENT 0.0
-.INDENT 3.5
-.INDENT 0.0
-.TP
-.B GitHub Enterprise domain
-E.g. \fBgit config machete.github.domain git.example.org\fP
-.TP
-.B Remote name (as in \fBgit remote\fP)
-E.g. \fBgit config machete.github.remote origin\fP
-.TP
-.B Organization and repository name
-E.g. \fBgit config machete.github.organization VirtusLab; git config machete.github.repository git\-machete\fP
-.UNINDENT
-.UNINDENT
-.UNINDENT
-.sp
-Note that you do NOT need to set all four keys at once.
-For example, in a typical usage of GitHub Enterprise, it should be enough to just set \fBmachete.github.domain\fP\&.
-Only \fBmachete.github.organization\fP and \fBmachete.github.repository\fP must be specified together.
+See \fBGit config keys\fP below in case the target repository cannot be detected automatically (for example, in case of GitHub Enterprise).
 .UNINDENT
 .UNINDENT
 .sp
 \fBSubcommands:\fP
 .INDENT 0.0
 .TP
-.B \fBanno\-prs\fP:
+.B \fBanno\-prs [\-\-with\-urls]\fP:
 Annotates the branches based on their corresponding GitHub PR numbers and authors.
 Any existing annotations are overwritten for the branches that have an opened PR; annotations for the other branches remain untouched.
 Equivalent to \fBgit machete anno \-\-sync\-github\-prs\fP\&.
+.sp
 When the current user is NOT the owner of the PR associated with that branch, adds \fBrebase=no push=no\fP branch qualifiers used by \fBgit machete traverse\fP,
 so that you don\(aqt rebase or push someone else\(aqs PR by accident (see help for \fI\%traverse\fP).
+.sp
+\fBOptions:\fP
+.INDENT 7.0
+.TP
+.B  \-\-with\-urls
+Also include full PR URLs in the annotations (rather than just PR number).
+.UNINDENT
 .TP
 .B \fBcheckout\-prs [\-\-all | \-\-by=<github\-login> | \-\-mine | <PR\-number\-1> ... <PR\-number\-N>]\fP:
 Check out the head branch of the given pull requests (specified by numbers or by a flag),
 also traverse chain of pull requests upwards, adding branches one by one to git\-machete and check them out locally.
 Once the specified pull requests are checked out locally, annotate local branches with corresponding pull request numbers.
 If only one PR has been checked out, then switch the local repository\(aqs HEAD to its head branch.
+.sp
 When the current user is NOT the owner of the PR associated with that branch, adds \fBrebase=no push=no\fP branch qualifiers used by \fBgit machete traverse\fP,
 so that you don\(aqt rebase or push someone else\(aqs PR by accident (see help for \fI\%traverse\fP).
 .sp
@@ -1169,6 +1156,44 @@ deletes untracked managed branches that have no downstream branch.
 Equivalent of \fBgit machete clean \-\-checkout\-my\-github\-prs\fP\&.
 .UNINDENT
 .sp
+\fBGit config keys (all subcommands):\fP
+.INDENT 0.0
+.TP
+.B \fBmachete.github.annotateWithUrls\fP:
+Setting this config key to \fBtrue\fP will cause all commands that write GitHub PR numbers into annotations
+to not only include PR number and author (if different from the current user), but also the full URL of the PR.
+.sp
+The affected (sub)commands clearly include \fBanno \-\-sync\-github\-prs\fP and \fBgithub anno\-prs\fP,
+but also \fBgithub checkout\-prs\fP, \fBgithub create\-pr\fP, \fBgithub retarget\-pr\fP and \fBgithub restack\-pr\fP\&.
+.TP
+.B \fBmachete.github.{domain,remote,organization,repository}\fP:
+.INDENT 7.0
+.INDENT 3.5
+GitHub API server URL will be inferred from \fBgit remote\fP\&.
+You can alter the default behavior by setting the following git config keys:
+.INDENT 0.0
+.INDENT 3.5
+.INDENT 0.0
+.TP
+.B GitHub Enterprise domain
+E.g. \fBgit config machete.github.domain git.example.org\fP
+.TP
+.B Remote name (as in \fBgit remote\fP)
+E.g. \fBgit config machete.github.remote origin\fP
+.TP
+.B Organization and repository name
+E.g. \fBgit config machete.github.organization VirtusLab; git config machete.github.repository git\-machete\fP
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.sp
+Note that you do NOT need to set all four keys at once.
+For example, in a typical usage of GitHub Enterprise, it should be enough to just set \fBmachete.github.domain\fP\&.
+Only \fBmachete.github.organization\fP and \fBmachete.github.repository\fP must be specified together.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.sp
 \fBEnvironment variables (all subcommands):\fP
 .INDENT 0.0
 .TP
@@ -1734,9 +1759,6 @@ m\-<branch4>     # grey (merged to parent)
 .UNINDENT
 .UNINDENT
 .sp
-\fBNOTE:\fP
-.INDENT 0.0
-.INDENT 3.5
 To make it easier to select branch name from the \fBstatus\fP output on certain terminals
 (like \fI\%Alacritty\fP), you can add an extra space between └─ and \fBbranch name\fP
 by setting \fBgit config machete.status.extraSpaceBeforeBranchName true\fP\&.
@@ -1772,8 +1794,6 @@ develop
 .fi
 .UNINDENT
 .UNINDENT
-.UNINDENT
-.UNINDENT
 .sp
 \fBOptions:\fP
 .INDENT 0.0
@@ -1792,18 +1812,16 @@ Only consider \fIstrict\fP (fast\-forward or 2\-parent) merges, rather than reba
 when detecting if a branch is merged into its upstream (parent).
 .UNINDENT
 .sp
-\fBConfig keys:\fP
+\fBGit config keys:\fP
+.sp
+\fBmachete.status.extraSpaceBeforeBranchName\fP
 .INDENT 0.0
-.TP
-.B \fBmachete.status.extraSpaceBeforeBranchName\fP
-.INDENT 7.0
 .INDENT 3.5
 To make it easier to select branch name from the \fBstatus\fP output on certain terminals
 (like \fI\%Alacritty\fP), you can add an extra space between └─ and \fBbranch name\fP
 by setting \fBgit config machete.status.extraSpaceBeforeBranchName true\fP\&.
 .UNINDENT
 .UNINDENT
-.UNINDENT
 .SH TRAVERSE
 .sp
 \fBUsage:\fP
@@ -1970,19 +1988,6 @@ Equivalent to \fB\-\-fetch \-\-whole\fP; useful for even more automated traversa
 Don\(aqt ask for any interactive input, including confirmation of rebase/push/pull. Implies \fB\-n\fP\&.
 .UNINDENT
 .sp
-\fBConfig keys:\fP
-.INDENT 0.0
-.TP
-.B \fBmachete.traverse.push\fP
-.INDENT 7.0
-.INDENT 3.5
-To change the behavior of \fBgit machete traverse\fP command so that it doesn\(aqt push branches by default,
-you need to set config key \fBgit config machete.traverse.push false\fP\&.
-Configuration key value can be overridden by the presence of the \fB\-\-push\fP or \fB\-\-push\-untracked\fP flags.
-.UNINDENT
-.UNINDENT
-.UNINDENT
-.sp
 \fBEnvironment variables:\fP
 .INDENT 0.0
 .TP
@@ -1990,6 +1995,16 @@ Configuration key value can be overridden by the presence of the \fB\-\-push\fP
 Extra options to pass to the underlying \fBgit rebase\fP invocations, space\-separated.
 Example: \fBGIT_MACHETE_REBASE_OPTS=\(dq\-\-keep\-empty \-\-rebase\-merges\(dq git machete traverse\fP\&.
 .UNINDENT
+.sp
+\fBGit config keys:\fP
+.INDENT 0.0
+.TP
+.B \fBmachete.traverse.push\fP
+To change the behavior of \fBgit machete traverse\fP command so that it doesn\(aqt push branches by default,
+you need to set config key \fBgit config machete.traverse.push false\fP\&.
+.sp
+Configuration key value can be overridden by the presence of the \fB\-\-push\fP or \fB\-\-push\-untracked\fP flags.
+.UNINDENT
 .SH UPDATE
 .sp
 \fBUsage:\fP
diff --git a/docs/source/cli/anno.rst b/docs/source/cli/anno.rst
index 5fdd882..4d76902 100644
--- a/docs/source/cli/anno.rst
+++ b/docs/source/cli/anno.rst
@@ -26,7 +26,7 @@ so that you don't rebase or push someone else's PR by accident (see help for :re
 Any existing annotations (except branch qualifiers) are overwritten for the branches that have an opened PR; annotations for the other branches remain untouched.
 
 .. include:: github_api_access.rst
-.. include:: github_config_keys.rst
+.. include:: github_access_config_keys.rst
 
 In any other case, sets the annotation for the given/current branch to the given <annotation text>.
 If multiple <annotation text>'s are passed to the command, they are concatenated with a single space.
diff --git a/docs/source/cli/clean.rst b/docs/source/cli/clean.rst
index 8e8a816..f55a448 100644
--- a/docs/source/cli/clean.rst
+++ b/docs/source/cli/clean.rst
@@ -19,7 +19,7 @@ No branch will be deleted unless explicitly confirmed by the user (or unless ``-
 Equivalent of ``git machete github sync`` if invoked with ``-H`` or ``--checkout-my-github-prs``.
 
 .. include:: github_api_access.rst
-.. include:: github_config_keys.rst
+.. include:: github_access_config_keys.rst
 
 **Options:**
 
diff --git a/docs/source/cli/config.rst b/docs/source/cli/config.rst
index dcf6f72..e406085 100644
--- a/docs/source/cli/config.rst
+++ b/docs/source/cli/config.rst
@@ -8,11 +8,12 @@ Note: ``config`` is not a command as such, just a help topic (there is no ``git
 
 **Git config keys:**
 
-``machete.github.{domain,remote,organization,repository}``:
-    When executing ``git machete github <subcommand>`` command, the following will happen:
+``machete.github.annotateWithUrls``:
+  .. include:: github_annotateWithUrls_config_key.rst
 
-    .. include:: github_config_keys.rst
-        :start-line: 2
+``machete.github.{domain,remote,organization,repository}``:
+  .. include:: github_access_config_keys.rst
+      :start-line: 3
 
 ``machete.overrideForkPoint.<branch>.to``:
     Executing ``git machete fork-point --override-to[-parent|-inferred|=<revision>] [<branch>]`` sets up a fork point override for ``<branch>``.
@@ -23,12 +24,10 @@ Note: ``config`` is not a command as such, just a help topic (there is no ``git
     ``git machete fork-point`` with flags should be used instead.
 
 ``machete.status.extraSpaceBeforeBranchName``:
-    .. include:: status_config_key.rst
-        :start-line: 2
+    .. include:: status_extraSpaceBeforeBranchName_config_key.rst
 
 ``machete.traverse.push``:
-    .. include:: traverse_config_key.rst
-        :start-line: 2
+    .. include:: traverse_push_config_key.rst
 
 ``machete.worktree.useTopLevelMacheteFile``:
     The default value of this key is ``true``, which means that the path to branch layout file will be ``.git/machete``
@@ -45,8 +44,8 @@ Note: ``config`` is not a command as such, just a help topic (there is no ``git
 
 ``GIT_MACHETE_REBASE_OPTS``
     Used to pass extra options to the underlying ``git rebase`` invocation (called by the executed command,
-    such as: ``reapply``, ``slide-out``, ``traverse``, ``update``)
+    such as: ``reapply``, ``slide-out``, ``traverse``, ``update``).
     Example: ``GIT_MACHETE_REBASE_OPTS="--keep-empty --rebase-merges" git machete update``.
 
 ``GITHUB_TOKEN``
-    Used to store GitHub API token. Used by commands such as: ``anno``, ``clean``, ``github``.
+    Used to store GitHub API token. Used by commands such as: ``anno --sync-github-prs``, ``clean``, ``github``.
diff --git a/docs/source/cli/github.rst b/docs/source/cli/github.rst
index 1e61a80..21e6feb 100644
--- a/docs/source/cli/github.rst
+++ b/docs/source/cli/github.rst
@@ -13,23 +13,31 @@ where ``<subcommand>`` is one of: ``anno-prs``, ``checkout-prs``, ``create-pr``,
 Creates, checks out and manages GitHub PRs while keeping them reflected in branch layout file.
 
 .. include:: github_api_access.rst
-.. include:: github_config_keys.rst
+
+.. note::
+  See **Git config keys** below in case the target repository cannot be detected automatically (for example, in case of GitHub Enterprise).
 
 **Subcommands:**
 
-``anno-prs``:
+``anno-prs [--with-urls]``:
     Annotates the branches based on their corresponding GitHub PR numbers and authors.
     Any existing annotations are overwritten for the branches that have an opened PR; annotations for the other branches remain untouched.
     Equivalent to ``git machete anno --sync-github-prs``.
+
     When the current user is NOT the owner of the PR associated with that branch, adds ``rebase=no push=no`` branch qualifiers used by ``git machete traverse``,
     so that you don't rebase or push someone else's PR by accident (see help for :ref:`traverse`).
 
+    **Options:**
+
+    --with-urls                   Also include full PR URLs in the annotations (rather than just PR number).
+
 
 ``checkout-prs [--all | --by=<github-login> | --mine | <PR-number-1> ... <PR-number-N>]``:
     Check out the head branch of the given pull requests (specified by numbers or by a flag),
     also traverse chain of pull requests upwards, adding branches one by one to git-machete and check them out locally.
     Once the specified pull requests are checked out locally, annotate local branches with corresponding pull request numbers.
     If only one PR has been checked out, then switch the local repository's HEAD to its head branch.
+
     When the current user is NOT the owner of the PR associated with that branch, adds ``rebase=no push=no`` branch qualifiers used by ``git machete traverse``,
     so that you don't rebase or push someone else's PR by accident (see help for :ref:`traverse`).
 
@@ -96,6 +104,15 @@ Creates, checks out and manages GitHub PRs while keeping them reflected in branc
 
     Equivalent of ``git machete clean --checkout-my-github-prs``.
 
+**Git config keys (all subcommands):**
+
+``machete.github.annotateWithUrls``:
+  .. include:: github_annotateWithUrls_config_key.rst
+
+``machete.github.{domain,remote,organization,repository}``:
+  .. include:: github_access_config_keys.rst
+      :start-line: 2
+
 **Environment variables (all subcommands):**
 
 ``GITHUB_TOKEN``
diff --git a/docs/source/cli/status.rst b/docs/source/cli/status.rst
index bdec0ed..750c7f9 100644
--- a/docs/source/cli/status.rst
+++ b/docs/source/cli/status.rst
@@ -73,7 +73,7 @@ When colors are disabled, relation between branches is represented in the follow
     |
     m-<branch4>     # grey (merged to parent)
 
-.. include:: status_config_key.rst
+.. include:: status_extraSpaceBeforeBranchName_config_key.rst
 
 **Options:**
 
@@ -86,9 +86,9 @@ When colors are disabled, relation between branches is represented in the follow
 --no-detect-squash-merges         Only consider *strict* (fast-forward or 2-parent) merges, rather than rebase/squash merges,
                                   when detecting if a branch is merged into its upstream (parent).
 
-**Config keys:**
+**Git config keys:**
 
 ``machete.status.extraSpaceBeforeBranchName``
-    .. include:: status_config_key.rst
-        :start-line: 2
-        :end-line: 6
+
+  .. include:: status_extraSpaceBeforeBranchName_config_key.rst
+      :end-line: 3
diff --git a/docs/source/cli/traverse.rst b/docs/source/cli/traverse.rst
index 77016b6..e7fcf8b 100644
--- a/docs/source/cli/traverse.rst
+++ b/docs/source/cli/traverse.rst
@@ -130,14 +130,13 @@ when the current user is NOT the owner of the PR associated with that branch.
 
 -y, --yes                    Don't ask for any interactive input, including confirmation of rebase/push/pull. Implies ``-n``.
 
-**Config keys:**
-
-``machete.traverse.push``
-    .. include:: traverse_config_key.rst
-        :start-line: 2
-
 **Environment variables:**
 
 ``GIT_MACHETE_REBASE_OPTS``
     Extra options to pass to the underlying ``git rebase`` invocations, space-separated.
     Example: ``GIT_MACHETE_REBASE_OPTS="--keep-empty --rebase-merges" git machete traverse``.
+
+**Git config keys:**
+
+``machete.traverse.push``
+    .. include:: traverse_push_config_key.rst
diff --git a/docs/source/github_config_keys.rst b/docs/source/github_access_config_keys.rst
similarity index 92%
rename from docs/source/github_config_keys.rst
rename to docs/source/github_access_config_keys.rst
index 2451188..d42b775 100644
--- a/docs/source/github_config_keys.rst
+++ b/docs/source/github_access_config_keys.rst
@@ -17,5 +17,5 @@
     Only ``machete.github.organization`` and ``machete.github.repository`` must be specified together.
 
 ..
-    Text order in this file is relevant, if you want to change something, find each occurrence of ``.. include:: github_config_keys.rst``
+    Text order in this file is relevant, if you want to change something, find each occurrence of ``.. include:: github_access_config_keys.rst``
     and if this occurrence has ``start-line`` or ``end-line`` options provided, make sure that after changes the output text stays the same.
diff --git a/docs/source/github_annotateWithUrls_config_key.rst b/docs/source/github_annotateWithUrls_config_key.rst
new file mode 100644
index 0000000..ffac2a0
--- /dev/null
+++ b/docs/source/github_annotateWithUrls_config_key.rst
@@ -0,0 +1,5 @@
+Setting this config key to ``true`` will cause all commands that write GitHub PR numbers into annotations
+to not only include PR number and author (if different from the current user), but also the full URL of the PR.
+
+The affected (sub)commands clearly include ``anno --sync-github-prs`` and ``github anno-prs``,
+but also ``github checkout-prs``, ``github create-pr``, ``github retarget-pr`` and ``github restack-pr``.
diff --git a/docs/source/status_config_key.rst b/docs/source/status_config_key.rst
deleted file mode 100644
index c5dbfe2..0000000
--- a/docs/source/status_config_key.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-.. note::
-
-    To make it easier to select branch name from the ``status`` output on certain terminals
-    (like `Alacritty <https://github.com/alacritty/alacritty>`_), you can add an extra space between └─ and ``branch name``
-    by setting ``git config machete.status.extraSpaceBeforeBranchName true``.
-
-    For example, by default the status is displayed as:
-
-    .. code-block::
-
-      develop
-      │
-      ├─feature_branch1
-      │
-      └─feature_branch2
-
-    With ``machete.status.extraSpaceBeforeBranchName`` config set to ``true``:
-
-    .. code-block::
-
-       develop
-       │
-       ├─ feature_branch1
-       │
-       └─ feature_branch2
-
-..
-    Text order in this file is relevant, if you want to change something, find each ``.. include:: status_config_key.rst`` instance
-    and if the instance has ``start-line`` or ``end-line`` options provided, make sure that after changes the output text stays the same.
diff --git a/docs/source/status_extraSpaceBeforeBranchName_config_key.rst b/docs/source/status_extraSpaceBeforeBranchName_config_key.rst
new file mode 100644
index 0000000..0d22baf
--- /dev/null
+++ b/docs/source/status_extraSpaceBeforeBranchName_config_key.rst
@@ -0,0 +1,23 @@
+To make it easier to select branch name from the ``status`` output on certain terminals
+(like `Alacritty <https://github.com/alacritty/alacritty>`_), you can add an extra space between └─ and ``branch name``
+by setting ``git config machete.status.extraSpaceBeforeBranchName true``.
+
+For example, by default the status is displayed as:
+
+.. code-block::
+
+  develop
+  │
+  ├─feature_branch1
+  │
+  └─feature_branch2
+
+With ``machete.status.extraSpaceBeforeBranchName`` config set to ``true``:
+
+.. code-block::
+
+   develop
+   │
+   ├─ feature_branch1
+   │
+   └─ feature_branch2
diff --git a/docs/source/traverse_config_key.rst b/docs/source/traverse_config_key.rst
deleted file mode 100644
index b0f14cd..0000000
--- a/docs/source/traverse_config_key.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-.. note::
-
-    To change the behavior of ``git machete traverse`` command so that it doesn't push branches by default,
-    you need to set config key ``git config machete.traverse.push false``.
-    Configuration key value can be overridden by the presence of the ``--push`` or ``--push-untracked`` flags.
-
-..
-    Text order in this file is relevant, if you want to change something, find each ``.. include:: status_config_key.rst`` instance
-    and if the instance has ``start-line`` or ``end-line`` options provided, make sure that after changes the output text stays the same.
diff --git a/docs/source/traverse_push_config_key.rst b/docs/source/traverse_push_config_key.rst
new file mode 100644
index 0000000..9b0cbfd
--- /dev/null
+++ b/docs/source/traverse_push_config_key.rst
@@ -0,0 +1,4 @@
+To change the behavior of ``git machete traverse`` command so that it doesn't push branches by default,
+you need to set config key ``git config machete.traverse.push false``.
+
+Configuration key value can be overridden by the presence of the ``--push`` or ``--push-untracked`` flags.
diff --git a/git_machete/cli.py b/git_machete/cli.py
index 3aa4150..cd24a4f 100644
--- a/git_machete/cli.py
+++ b/git_machete/cli.py
@@ -249,6 +249,7 @@ def create_cli_parser() -> argparse.ArgumentParser:
     github_parser.add_argument('--draft', action='store_true')
     github_parser.add_argument('--ignore-if-missing', action='store_true')
     github_parser.add_argument('--mine', action='store_true')
+    github_parser.add_argument('--with-urls', action='store_true')
 
     go_parser = subparsers.add_parser(
         'go',
@@ -484,6 +485,8 @@ def update_cli_options_using_parsed_args(
             cli_opts.opt_start_from = "first-root"
             cli_opts.opt_n = True
             cli_opts.opt_return_to = "nearest-remaining"
+        elif opt == "with_urls":
+            cli_opts.opt_with_urls = True
         elif opt == "yes":
             cli_opts.opt_yes = True
 
@@ -607,7 +610,7 @@ def launch(orig_args: List[str]) -> None:
             machete_client.read_branch_layout_file(perform_interactive_slide_out=should_perform_interactive_slide_out,
                                                    verify_branches=False)
             if cli_opts.opt_sync_github_prs:
-                machete_client.sync_annotations_to_github_prs()
+                machete_client.sync_annotations_to_github_prs(include_urls=False)
             else:
                 branch = get_local_branch_short_name_from_arg_or_current_branch(cli_opts.opt_branch, git)
                 machete_client.expect_in_managed_branches(branch)
@@ -686,9 +689,11 @@ def launch(orig_args: List[str]) -> None:
                 raise MacheteException("`--branch` option is only valid with `retarget-pr` subcommand.")
             if 'ignore_if_missing' in parsed_cli and github_subcommand != 'retarget-pr':
                 raise MacheteException("`--ignore-if-missing` option is only valid with `retarget-pr` subcommand.")
+            if 'with_urls' in parsed_cli and github_subcommand != 'anno-prs':
+                raise MacheteException("`--with-urls` option is only valid with `anno-prs` subcommand.")
 
             if github_subcommand == "anno-prs":
-                machete_client.sync_annotations_to_github_prs()
+                machete_client.sync_annotations_to_github_prs(include_urls=cli_opts.opt_with_urls)
             elif github_subcommand == "checkout-prs":
                 if len(set(parsed_cli_as_dict.keys()).intersection({'all', 'by', 'mine', 'pr_no'})) != 1:
                     raise MacheteException("`checkout-prs` subcommand must take exactly one of the following options: "
diff --git a/git_machete/client.py b/git_machete/client.py
index 8109965..3ae29fb 100644
--- a/git_machete/client.py
+++ b/git_machete/client.py
@@ -1586,7 +1586,7 @@ class MacheteClient:
               f"and branch reset events irrelevant for fork point/upstream inference): {reflog}")
         return result
 
-    def sync_annotations_to_github_prs(self) -> None:
+    def sync_annotations_to_github_prs(self, include_urls: bool) -> None:
         domain = self.__derive_github_domain()
         org_repo_remote = self.__derive_org_repo_and_remote(domain=domain)
         github_client = GitHubClient(domain=domain, organization=org_repo_remote.organization, repository=org_repo_remote.repository)
@@ -1595,15 +1595,22 @@ class MacheteClient:
         debug('Current GitHub user is ' + (bold(current_user or '<none>')))
         all_open_prs: List[GitHubPullRequest] = github_client.get_open_pull_requests()
         print(fmt('<green><b>OK</b></green>'))
-        self.__sync_annotations_to_branch_layout_file(all_open_prs, current_user, verbose=True)
-
-    def __sync_annotations_to_branch_layout_file(self, prs: List[GitHubPullRequest], current_user: Optional[str], verbose: bool) -> None:
+        self.__sync_annotations_to_branch_layout_file(all_open_prs, current_user, include_urls=include_urls, verbose=True)
+
+    def __github_pr_annotation(self, pr: GitHubPullRequest, current_user: Optional[str], include_url: bool = False) -> str:
+        anno = f"PR #{pr.number}"
+        if current_user != pr.user:
+            anno += f" ({pr.user})"
+        if include_url or self.__git.get_boolean_config_attr_or_none(key=git_config_keys.GITHUB_ANNOTATE_WITH_URLS):
+            anno += f" {pr.html_url}"
+        return anno
+
+    def __sync_annotations_to_branch_layout_file(self, prs: List[GitHubPullRequest], current_user: Optional[str],
+                                                 include_urls: bool, verbose: bool) -> None:
         for pr in prs:
             if LocalBranchShortName.of(pr.head) in self.managed_branches:
                 debug(f'{pr} corresponds to a managed branch')
-                anno: str = f'PR #{pr.number}'
-                if pr.user != current_user:
-                    anno += f' ({pr.user})'
+                anno: str = self.__github_pr_annotation(pr, current_user, include_urls)
                 upstream: Optional[LocalBranchShortName] = self.__up_branch.get(LocalBranchShortName.of(pr.head))
                 if upstream is not None:
                     counterpart = self.__git.get_combined_counterpart_for_fetching_of_branch(upstream)
@@ -2104,7 +2111,7 @@ class MacheteClient:
                         checked_out_prs.append(pr)
 
         debug('Current GitHub user is ' + (current_user or '<none>'))
-        self.__sync_annotations_to_branch_layout_file(all_open_prs, current_user=current_user, verbose=False)
+        self.__sync_annotations_to_branch_layout_file(all_open_prs, current_user=current_user, include_urls=False, verbose=False)
         if len(applicable_prs) == 1:
             self.__git.checkout(LocalBranchShortName.of(pr.head))
 
@@ -2322,10 +2329,12 @@ class MacheteClient:
                 print(f'Base PR header in the description of PR #{bold(str(pr.number))} '
                       f'now points to PR #{bold(str(pr_number_for_base_branch))}')
 
+        current_user: Optional[str] = github_client.get_current_user_login()
         if self.__annotations.get(head) and self.__annotations[head].qualifiers_text:
-            self.__annotations[head] = Annotation(f'PR #{pr.number} ' + self.__annotations[head].qualifiers_text)
+            self.__annotations[head] = Annotation(f'{self.__github_pr_annotation(pr, current_user)} ' +
+                                                  self.__annotations[head].qualifiers_text)
         else:
-            self.__annotations[head] = Annotation(f'PR #{pr.number}')
+            self.__annotations[head] = Annotation(f'{self.__github_pr_annotation(pr, current_user)}')
         self.save_branch_layout_file()
 
     def __derive_github_domain(self) -> str:
@@ -2512,12 +2521,12 @@ class MacheteClient:
                     print()
                     warn(f"There are some invalid reviewers in {self.__git.get_main_git_subpath('info', 'reviewers')} file.\n"
                          "Skipped adding reviewers to pull request.")
-                else:
-                    raise e
+                else:  # pragma: no cover
+                    raise MacheteException(f"{e}\n\n{GITHUB_NEW_ISSUE_MESSAGE}")
             else:
                 print(fmt(ok_str))
 
-        self.__annotations[head] = Annotation(f'PR #{pr.number}')
+        self.__annotations[head] = Annotation(self.__github_pr_annotation(pr, current_user))
         self.save_branch_layout_file()
 
     def __handle_diverged_and_newer_state(
diff --git a/git_machete/generated_docs.py b/git_machete/generated_docs.py
index f8a8316..f956ffc 100644
--- a/git_machete/generated_docs.py
+++ b/git_machete/generated_docs.py
@@ -274,11 +274,16 @@ long_docs: Dict[str, str] = {
         Note: `config` is not a command as such, just a help topic (there is no `git machete config` command).
 
         <b>Git config keys:</b>
-           `machete.github.{domain,remote,organization,repository}`:
+           `machete.github.annotateWithUrls`:
  
-              When executing `git machete github <subcommand>` command, the following will happen:
+              Setting this config key to `true` will cause all commands that write GitHub PR numbers into annotations
+              to not only include PR number and author (if different from the current user), but also the full URL of the PR.
+
+              The affected (sub)commands clearly include `anno --sync-github-prs` and `github anno-prs`,
+              but also `github checkout-prs`, `github create-pr`, `github retarget-pr` and `github restack-pr`.
+
+           `machete.github.{domain,remote,organization,repository}`:
 
-              GitHub API server URL will be inferred from `git remote`.
               You can alter the default behavior by setting the following git config keys:
 
                  GitHub Enterprise domain
@@ -304,7 +309,7 @@ long_docs: Dict[str, str] = {
               `git machete fork-point` with flags should be used instead.
 
            `machete.status.extraSpaceBeforeBranchName`:
-
+ 
               To make it easier to select branch name from the `status` output on certain terminals
               (like Alacritty), you can add an extra space between └─ and `branch name`
               by setting `git config machete.status.extraSpaceBeforeBranchName true`.
@@ -326,9 +331,10 @@ long_docs: Dict[str, str] = {
               └─ feature_branch2
 
            `machete.traverse.push`:
-
+ 
               To change the behavior of `git machete traverse` command so that it doesn't push branches by default,
               you need to set config key `git config machete.traverse.push false`.
+
               Configuration key value can be overridden by the presence of the `--push` or `--push-untracked` flags.
 
            `machete.worktree.useTopLevelMacheteFile`:
@@ -345,11 +351,11 @@ long_docs: Dict[str, str] = {
 
            `GIT_MACHETE_REBASE_OPTS`
               Used to pass extra options to the underlying `git rebase` invocation (called by the executed command,
-              such as: `reapply`, `slide-out`, `traverse`, `update`)
+              such as: `reapply`, `slide-out`, `traverse`, `update`).
               Example: `GIT_MACHETE_REBASE_OPTS="--keep-empty --rebase-merges" git machete update`.
 
            `GITHUB_TOKEN`
-              Used to store GitHub API token. Used by commands such as: `anno`, `clean`, `github`.
+              Used to store GitHub API token. Used by commands such as: `anno --sync-github-prs`, `clean`, `github`.
 
    """,
     "delete-unmanaged": """
@@ -561,36 +567,30 @@ long_docs: Dict[str, str] = {
           ghp_mytoken_for_github_com
           ghp_myothertoken_for_git_example_org git.example.org
           ghp_yetanothertoken_for_git_example_com git.example.com
-        </dim>
-
-        GitHub API server URL will be inferred from `git remote`.
-        You can alter the default behavior by setting the following git config keys:
-           GitHub Enterprise domain
-              E.g. `git config machete.github.domain git.example.org`
-
-           Remote name (as in `git remote`)
-              E.g. `git config machete.github.remote origin`
-
-           Organization and repository name
-              E.g. `git config machete.github.organization VirtusLab; git config machete.github.repository git-machete`
-        Note that you do NOT need to set all four keys at once.
-        For example, in a typical usage of GitHub Enterprise, it should be enough to just set `machete.github.domain`.
-        Only `machete.github.organization` and `machete.github.repository` must be specified together.
+        </dim>See <b>Git config keys</b> below in case the target repository cannot be detected automatically (for example, in case of GitHub Enterprise).
 
         <b>Subcommands:</b>
-           `anno-prs`:
+           `anno-prs [--with-urls]`:
+ 
               Annotates the branches based on their corresponding GitHub PR numbers and authors.
               Any existing annotations are overwritten for the branches that have an opened PR; annotations for the other branches remain untouched.
               Equivalent to `git machete anno --sync-github-prs`.
+
               When the current user is NOT the owner of the PR associated with that branch, adds `rebase=no push=no` branch qualifiers used by `git machete traverse`,
               so that you don't rebase or push someone else's PR by accident (see help for `traverse`).
 
+              <b>Options:</b>
+
+                 <b>--with-urls</b>
+              Also include full PR URLs in the annotations (rather than just PR number).
+
            `checkout-prs [--all | --by=<github-login> | --mine | <PR-number-1> ... <PR-number-N>]`:
  
               Check out the head branch of the given pull requests (specified by numbers or by a flag),
               also traverse chain of pull requests upwards, adding branches one by one to git-machete and check them out locally.
               Once the specified pull requests are checked out locally, annotate local branches with corresponding pull request numbers.
               If only one PR has been checked out, then switch the local repository's HEAD to its head branch.
+
               When the current user is NOT the owner of the PR associated with that branch, adds `rebase=no push=no` branch qualifiers used by `git machete traverse`,
               so that you don't rebase or push someone else's PR by accident (see help for `traverse`).
 
@@ -672,6 +672,33 @@ long_docs: Dict[str, str] = {
 
               Equivalent of `git machete clean --checkout-my-github-prs`.
 
+        <b>Git config keys (all subcommands):</b>
+           `machete.github.annotateWithUrls`:
+ 
+              Setting this config key to `true` will cause all commands that write GitHub PR numbers into annotations
+              to not only include PR number and author (if different from the current user), but also the full URL of the PR.
+
+              The affected (sub)commands clearly include `anno --sync-github-prs` and `github anno-prs`,
+              but also `github checkout-prs`, `github create-pr`, `github retarget-pr` and `github restack-pr`.
+
+           `machete.github.{domain,remote,organization,repository}`:
+
+              GitHub API server URL will be inferred from `git remote`.
+              You can alter the default behavior by setting the following git config keys:
+
+                 GitHub Enterprise domain
+              E.g. `git config machete.github.domain git.example.org`
+
+                 Remote name (as in `git remote`)
+              E.g. `git config machete.github.remote origin`
+
+                 Organization and repository name
+              E.g. `git config machete.github.organization VirtusLab; git config machete.github.repository git-machete`
+
+              Note that you do NOT need to set all four keys at once.
+              For example, in a typical usage of GitHub Enterprise, it should be enough to just set `machete.github.domain`.
+              Only `machete.github.organization` and `machete.github.repository` must be specified together.
+
         <b>Environment variables (all subcommands):</b>
            `GITHUB_TOKEN`
               GitHub API token.
@@ -1041,12 +1068,33 @@ long_docs: Dict[str, str] = {
               Only consider strict (fast-forward or 2-parent) merges, rather than rebase/squash merges,
               when detecting if a branch is merged into its upstream (parent).
 
-        <b>Config keys:</b>
-           `machete.status.extraSpaceBeforeBranchName`
-              To make it easier to select branch name from the `status` output on certain terminals
-              (like Alacritty), you can add an extra space between └─ and `branch name`
-              by setting `git config machete.status.extraSpaceBeforeBranchName true`.
+        <b>Git config keys:</b>
+
+        `machete.status.extraSpaceBeforeBranchName`
+
+        To make it easier to select branch name from the `status` output on certain terminals
+        (like Alacritty), you can add an extra space between └─ and `branch name`
+        by setting `git config machete.status.extraSpaceBeforeBranchName true`.
+
+        For example, by default the status is displayed as:
+        <dim>
+          develop
+          │
+          ├─feature_branch1
+          │
+          └─feature_branch2
+        </dim>
 
+        With `machete.status.extraSpaceBeforeBranchName` config set to `true`:
+        <dim>
+          develop
+          │
+          ├─ feature_branch1
+          │
+          └─ feature_branch2
+
+           :end-line: 3
+        </dim>
    """,
     "traverse": """
         <b>Usage:</b><b>
@@ -1148,18 +1196,19 @@ long_docs: Dict[str, str] = {
            <b>-y</b>, <b>--yes</b>
               Don't ask for any interactive input, including confirmation of rebase/push/pull. Implies `-n`.
 
-        <b>Config keys:</b>
-           `machete.traverse.push`
-
-              To change the behavior of `git machete traverse` command so that it doesn't push branches by default,
-              you need to set config key `git config machete.traverse.push false`.
-              Configuration key value can be overridden by the presence of the `--push` or `--push-untracked` flags.
-
         <b>Environment variables:</b>
            `GIT_MACHETE_REBASE_OPTS`
               Extra options to pass to the underlying `git rebase` invocations, space-separated.
               Example: `GIT_MACHETE_REBASE_OPTS="--keep-empty --rebase-merges" git machete traverse`.
 
+        <b>Git config keys:</b>
+           `machete.traverse.push`
+ 
+              To change the behavior of `git machete traverse` command so that it doesn't push branches by default,
+              you need to set config key `git config machete.traverse.push false`.
+
+              Configuration key value can be overridden by the presence of the `--push` or `--push-untracked` flags.
+
    """,
     "update": """
         <b>Usage:</b><b>
diff --git a/git_machete/git_config_keys.py b/git_machete/git_config_keys.py
index 51eee9b..a214b31 100644
--- a/git_machete/git_config_keys.py
+++ b/git_machete/git_config_keys.py
@@ -1,3 +1,4 @@
+GITHUB_ANNOTATE_WITH_URLS = 'machete.github.annotateWithUrls'
 GITHUB_DOMAIN = 'machete.github.domain'
 GITHUB_REMOTE = 'machete.github.remote'
 GITHUB_ORGANIZATION = 'machete.github.organization'
diff --git a/git_machete/options.py b/git_machete/options.py
index 9db76f7..fad1f4b 100644
--- a/git_machete/options.py
+++ b/git_machete/options.py
@@ -36,6 +36,7 @@ class CommandLineOptions:
         self.opt_stat: bool = False
         self.opt_sync_github_prs: bool = False
         self.opt_unset_override: bool = False
+        self.opt_with_urls: bool = False
         self.opt_yes: bool = False
 
     def validate(self) -> None:


Test patch:
diff --git a/tests/completion_e2e/test_completion_e2e.py b/tests/completion_e2e/test_completion_e2e.py
index e6e1ae4..49670a9 100644
--- a/tests/completion_e2e/test_completion_e2e.py
+++ b/tests/completion_e2e/test_completion_e2e.py
@@ -58,6 +58,8 @@ test_cases: Dict[str, str] = {
         "develop",
     "git machete github ":
         "anno-prs checkout-prs create-pr restack-pr retarget-pr sync",
+    "git machete github anno-prs -":
+        "--debug -h --help -v --verbose --with-urls",
     "git machete github checkout-prs -":
         "--all --by --debug -h --help --mine -v --verbose",
     "git machete github create-pr -":
diff --git a/tests/test_github.py b/tests/test_github.py
index 7dd34f3..1727e8f 100644
--- a/tests/test_github.py
+++ b/tests/test_github.py
@@ -341,3 +341,5 @@ class TestGitHub(BaseTest):
                        "--ignore-if-missing option is only valid with retarget-pr subcommand.")
         assert_failure(["github", "checkout-prs", "--all", "--mine"],
                        "checkout-prs subcommand must take exactly one of the following options: --all, --by=..., --mine, pr-number(s)")
+        assert_failure(["github", "restack-pr", "--with-urls"],
+                       "--with-urls option is only valid with anno-prs subcommand.")
diff --git a/tests/test_github_anno_prs.py b/tests/test_github_anno_prs.py
index 40af186..08ece71 100644
--- a/tests/test_github_anno_prs.py
+++ b/tests/test_github_anno_prs.py
@@ -168,14 +168,14 @@ class TestGitHubAnnoPRs(BaseTest):
                     feature_1
             """
         rewrite_branch_layout_file(body)
-        launch_command("github", "anno-prs")
+        launch_command("github", "anno-prs", "--with-urls")
 
         expected_status_output = """
         root
         |
         o-feature
           |
-          o-feature_1 *  PR #20 (some_other_user) rebase=no push=no
+          o-feature_1 *  PR #20 (some_other_user) www.github.com rebase=no push=no
         """
         assert_success(
             ['status'],
diff --git a/tests/test_github_create_pr.py b/tests/test_github_create_pr.py
index 6054284..e93e126 100644
--- a/tests/test_github_create_pr.py
+++ b/tests/test_github_create_pr.py
@@ -105,7 +105,7 @@ class TestGitHubCreatePR(BaseTest):
             | |
             | x-build-chain (untracked)
             |
-            o-call-ws *  PR #4
+            o-call-ws *  PR #4 (some_other_user)
               |
               x-drop-constraint (untracked)
             """,
@@ -135,7 +135,7 @@ class TestGitHubCreatePR(BaseTest):
               | |
               | x-build-chain (untracked)
               |
-              o-call-ws  PR #4
+              o-call-ws  PR #4 (some_other_user)
                 |
                 x-drop-constraint (untracked)
 
@@ -163,7 +163,7 @@ class TestGitHubCreatePR(BaseTest):
               |
               o-ignore-trailing  PR #3 (diverged from & older than origin)
                 |
-                o-chore/fields *  PR #5
+                o-chore/fields *  PR #5 (some_other_user)
 
             develop
             |
@@ -171,7 +171,7 @@ class TestGitHubCreatePR(BaseTest):
             | |
             | x-build-chain (untracked)
             |
-            o-call-ws  PR #4
+            o-call-ws  PR #4 (some_other_user)
               |
               x-drop-constraint (untracked)
             """,
@@ -190,11 +190,11 @@ class TestGitHubCreatePR(BaseTest):
             """
             master
             |
-            o-hotfix/add-trigger *  PR #6
+            o-hotfix/add-trigger *  PR #6 (some_other_user)
               |
               x-ignore-trailing  PR #3 (diverged from & older than origin)
                 |
-                o-chore/fields  PR #5
+                o-chore/fields  PR #5 (some_other_user)
 
             develop
             |
@@ -202,7 +202,7 @@ class TestGitHubCreatePR(BaseTest):
             | |
             | x-build-chain (untracked)
             |
-            o-call-ws  PR #4
+            o-call-ws  PR #4 (some_other_user)
               |
               x-drop-constraint (untracked)
             """,
@@ -324,6 +324,8 @@ class TestGitHubCreatePR(BaseTest):
                         "Warn: Base branch for this PR (feature/api_handling) is not found on remote, pushing...\n"
                         "Push untracked branch feature/api_handling to origin? (y, Q)\n"
                         "Creating a PR from feature/api_exception_handling to feature/api_handling... OK, see www.github.com\n")
+
+        self.repo_sandbox.set_git_config_key("machete.github.annotateWithUrls", "true")
         assert_success(['github', 'create-pr'], expected_msg)
         assert_success(
             ['status'],
@@ -332,7 +334,7 @@ class TestGitHubCreatePR(BaseTest):
             |
             o-feature/api_handling
               |
-              o-feature/api_exception_handling *  PR #19
+              o-feature/api_exception_handling *  PR #19 (some_other_user) www.github.com
             """,
         )
 
@@ -511,9 +513,9 @@ class TestGitHubCreatePR(BaseTest):
           |
           o-branch-1
             |
-            o-feature  PR #16
+            o-feature  PR #16 (some_other_user)
               |
-              o-feature_1  PR #17
+              o-feature_1  PR #17 (some_other_user)
               |
               o-feature_2 *
 
diff --git a/tests/test_github_retarget_pr.py b/tests/test_github_retarget_pr.py
index 81accd6..c3b91ef 100644
--- a/tests/test_github_retarget_pr.py
+++ b/tests/test_github_retarget_pr.py
@@ -84,7 +84,7 @@ class TestGitHubRetargetPR(BaseTest):
         |
         o-develop
           |
-          o-feature *  PR #15 rebase=no push=no
+          o-feature *  PR #15 (some_other_user) rebase=no push=no
           |
           o-feature_4  PR #40 (some_other_user) WRONG PR BASE or MACHETE PARENT? PR has feature rebase=no push=no
         """
@@ -169,7 +169,7 @@ class TestGitHubRetargetPR(BaseTest):
         |
         o-branch-1
         | |
-        | o-feature  PR #15 rebase=no push=no
+        | o-feature  PR #15 (some_other_user) rebase=no push=no
         |
         o-branch-without-pr
         """