# [PATCH] describe: Add unlisted option

5 messages from 2007-07-23 to 2007-07-23. Participants: Yasushi SHOJI, Shawn O. Pearce, Junio C Hamano.
Thread: https://gitlist.dev/t/9167

## Yasushi SHOJI, 2007-07-23 06:24

Subject: [PATCH] describe: Add unlisted option
Message-ID: <87sl7fmyca.wl@mail2.atmark-techno.com>
URL: https://gitlist.dev/e/87sl7fmyca.wl%40mail2.atmark-techno.com

```
added unlisted options, --contains, --candidates and --debug, to usage
line.  also, prints some info when --contains and --debug are given.
---
 Documentation/git-describe.txt |    4 +++-
 builtin-describe.c             |    5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index ac23e28..f0bcb61 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -8,7 +8,9 @@ git-describe - Show the most recent tag that is reachable from a commit
 
 SYNOPSIS
 --------
-'git-describe' [--all] [--tags] [--contains] [--abbrev=<n>] <committish>...
+'git-describe' [--all] [--tags] [--contains] [--abbrev=<n>]
+               [--candidates=<n>] [--debug]
+               <committish>...
 
 DESCRIPTION
 -----------
diff --git a/builtin-describe.c b/builtin-describe.c
index 669110c..e94f867 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -9,7 +9,7 @@
 #define MAX_TAGS	(FLAG_BITS - 1)
 
 static const char describe_usage[] =
-"git-describe [--all] [--tags] [--abbrev=<n>] <committish>*";
+"git-describe [--all] [--tags] [--contains] [--abbrev=<n>] [--candidates] [--debug] <committish>*";
 
 static int debug;	/* Display lots of verbose info */
 static int all;	/* Default to annotated tags only */
@@ -283,6 +283,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 		args[2] = "--tags";
 		memcpy(args + 3, argv + i, (argc - i) * sizeof(char*));
 		args[3 + argc - i] = NULL;
+		if (debug)
+			fprintf(stderr, "redirecting to \"git name-rev\"; "
+				"no searching strategy will be printed\n");
 		return cmd_name_rev(3 + argc - i, args, prefix);
 	}
 
-- 
1.5.3.rc2.4.g726f9

```

## Shawn O. Pearce, 2007-07-23 07:03

Subject: Re: [PATCH] describe: Add unlisted option
Message-ID: <20070723070308.GH32566@spearce.org>
URL: https://gitlist.dev/e/20070723070308.GH32566%40spearce.org
In-Reply-To: <87sl7fmyca.wl@mail2.atmark-techno.com>

```
Yasushi SHOJI <yashi@atmark-techno.com> wrote:
> added unlisted options, --contains, --candidates and --debug, to usage
> line.  also, prints some info when --contains and --debug are given.

That makes sense.  Especially telling the user why --debug --contains
doesn't actually print anything.  ;-)

Originally I left out --candidates and --debug when I wrote the code
for them as I thought they were a tad too internal for casual use.
But maybe it makes sense to include them in the usage string.


Acked-by: Shawn O. Pearce <spearce@spearce.org>

-- 
Shawn.

```

## Junio C Hamano, 2007-07-23 07:41

Subject: Re: [PATCH] describe: Add unlisted option
Message-ID: <7vabtnmusm.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vabtnmusm.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070723070308.GH32566@spearce.org>

```
"Shawn O. Pearce" <spearce@spearce.org> writes:

> Yasushi SHOJI <yashi@atmark-techno.com> wrote:
>> added unlisted options, --contains, --candidates and --debug, to usage
>> line.  also, prints some info when --contains and --debug are given.
>
> That makes sense.  Especially telling the user why --debug --contains
> doesn't actually print anything.  ;-)
>
> Originally I left out --candidates and --debug when I wrote the code
> for them as I thought they were a tad too internal for casual use.
> But maybe it makes sense to include them in the usage string.

I was actually going to suggest removing these options, that
were primarily meant for debugging and tweaking while we figure
out what the optimum default should be.  Do you think they are
worth keeping?

```

## Shawn O. Pearce, 2007-07-23 07:47

Subject: Re: [PATCH] describe: Add unlisted option
Message-ID: <20070723074736.GJ32566@spearce.org>
URL: https://gitlist.dev/e/20070723074736.GJ32566%40spearce.org
In-Reply-To: <7vabtnmusm.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <gitster@pobox.com> wrote:
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> > Originally I left out --candidates and --debug when I wrote the code
> > for them as I thought they were a tad too internal for casual use.
> > But maybe it makes sense to include them in the usage string.
> 
> I was actually going to suggest removing these options, that
> were primarily meant for debugging and tweaking while we figure
> out what the optimum default should be.  Do you think they are
> worth keeping?

Yea, I do.  I'd like to keep them in the code as sometimes I do
look at their output.  I'll even help maintain them, because they
change oh so often.  ;-)

But if you really want them gone, I won't stop you.

-- 
Shawn.

```

## Junio C Hamano, 2007-07-23 08:54

Subject: Re: [PATCH] describe: Add unlisted option
Message-ID: <7vwswrlcui.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vwswrlcui.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070723074736.GJ32566@spearce.org>

```
"Shawn O. Pearce" <spearce@spearce.org> writes:

>> I was actually going to suggest removing these options, that
>> were primarily meant for debugging and tweaking while we figure
>> out what the optimum default should be.  Do you think they are
>> worth keeping?
>
> Yea, I do.  I'd like to keep them in the code as sometimes I do
> look at their output.  I'll even help maintain them, because they
> change oh so often.  ;-)
>
> But if you really want them gone, I won't stop you.

Nah, I already noticed your Ack and inferred that you would want
to keep them.  Haven't applied the patches yet, though.

```
