summary refs log tree commit diff
path: root/remote.h
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2018-01-09 18:50:16 +0000
committerJunio C Hamano <gitster@pobox.com>2018-01-24 13:48:38 -0800
commitfd9b544a2991ad74d73ad1bc0af4d24f91a6802b (patch)
tree175285017f510542e6bf558d94d025518bd3dd5d /remote.h
parentd7d1b496aeea5a151c826683ed28c57ef0ac9389 (diff)
status: add --[no-]ahead-behind to status and commit for V2 format.
Teach "git status" and "git commit" to accept "--no-ahead-behind"
and "--ahead-behind" arguments to request quick or full ahead/behind
reporting.

When "--no-ahead-behind" is given, the existing porcelain V2 line
"branch.ab +x -y" is replaced with a new "branch.ab +? -?" line.
This indicates that the branch and its upstream are or are not equal
without the expense of computing the full ahead/behind values.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.h')
-rw-r--r--remote.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/remote.h b/remote.h
index 80240f0ada..0a6e770c9e 100644
--- a/remote.h
+++ b/remote.h
@@ -259,8 +259,9 @@ enum match_refs_flags {
 
 /* Flags for --ahead-behind option. */
 enum ahead_behind_flags {
-	AHEAD_BEHIND_QUICK = 0,  /* just eq/neq reporting */
-	AHEAD_BEHIND_FULL  = 1,  /* traditional a/b reporting */
+	AHEAD_BEHIND_UNSPECIFIED = -1,
+	AHEAD_BEHIND_QUICK       =  0,  /* just eq/neq reporting */
+	AHEAD_BEHIND_FULL        =  1,  /* traditional a/b reporting */
 };
 
 /* Reporting of tracking info */