summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-03-12 14:09:06 -0700
committerJunio C Hamano <gitster@pobox.com>2026-03-12 14:09:06 -0700
commitd0413b31ddcce6ae6ffaff0a30a67ffbd1a7c648 (patch)
tree1caab056d17c7d62d2727398c34259fe3cc315f5 /Documentation
parent03161747b412fe739d8a7ef631769b3d8f60d56f (diff)
parent68791d7506aa39da7c98de4143cac09cc93fc404 (diff)
Merge branch 'hn/status-compare-with-push'
"git status" learned to show comparison between the current branch and various other branches listed on status.compareBranches configuration. * hn/status-compare-with-push: status: clarify how status.compareBranches deduplicates status: add status.compareBranches config for multiple branch comparisons refactor format_branch_comparison in preparation
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/config/status.adoc25
1 files changed, 25 insertions, 0 deletions
diff --git a/Documentation/config/status.adoc b/Documentation/config/status.adoc
index 8caf90f51c..b5dd85b761 100644
--- a/Documentation/config/status.adoc
+++ b/Documentation/config/status.adoc
@@ -17,6 +17,31 @@ status.aheadBehind::
`--no-ahead-behind` by default in linkgit:git-status[1] for
non-porcelain status formats. Defaults to true.
+status.compareBranches::
+ A space-separated list of branch comparison specifiers to use in
+ linkgit:git-status[1]. Currently, only `@{upstream}` and `@{push}`
+ are supported. They are interpreted as `branch@{upstream}` and
+ `branch@{push}` for the current branch.
++
+If not set, the default behavior is equivalent to `@{upstream}`, which
+compares against the configured upstream tracking branch.
++
+The entries are shown in the order they appear in the configuration.
+Duplicate entries that resolve to the same ref are suppressed after
+their first occurrence, so `@{push} @{upstream} @{push}` shows at
+most two comparisons. When `@{upstream}` and `@{push}` resolve to
+the same remote-tracking branch, only one comparison is shown.
++
+Example:
++
+----
+[status]
+ compareBranches = @{upstream} @{push}
+----
++
+This would show comparisons against both the configured upstream and push
+tracking branches for the current branch.
+
status.displayCommentPrefix::
If set to true, linkgit:git-status[1] will insert a comment
prefix before each output line (starting with