`git describe --contains` calls into `git name-rev` which does not have
any searching to do and thus does not display any debug information.

Say so in the documentation and catch the incompatible arguments.

Signed-off-by: Michael J Gruber <g...@drmicha.warpmail.net>
---
 Documentation/git-describe.txt | 2 +-
 builtin/describe.c             | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index 8755f3af7b..0f9adb6e9a 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -69,7 +69,7 @@ OPTIONS
 --debug::
        Verbosely display information about the searching strategy
        being employed to standard error.  The tag name will still
-       be printed to standard out.
+       be printed to standard out. This is incompatible with --contains.
 
 --long::
        Always output the long format (the tag, the number of commits
diff --git a/builtin/describe.c b/builtin/describe.c
index 76c18059bf..01a6d159a0 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -462,6 +462,8 @@ int cmd_describe(int argc, const char **argv, const char 
*prefix)
 
        if (longformat && abbrev == 0)
                die(_("--long is incompatible with --abbrev=0"));
+       if (contains && debug)
+               die(_("--debug is incompatible with --contains"));
 
        if (contains) {
                struct string_list_item *item;
-- 
2.12.0.384.g157040b11f.dirty

Reply via email to