From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/3] describe: debug is incompatible with contains
Date: Fri, 17 Mar 2017 11:54:29 +0100 [thread overview]
Message-ID: <a76bd1ae-74a8-a85c-852a-e36514cd05d5@drmicha.warpmail.net> (raw)
In-Reply-To: <xmqqzigme474.fsf@gitster.mtv.corp.google.com>
Junio C Hamano venit, vidit, dixit 15.03.2017 20:21:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
>
>> `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.
>
> I am not sure if this is worth it. Those who are really doing the
> debugging would be staring at the code while running it anyway, so
> it is not like this new error condition would help anybody from
> wasting time scratching her head before viewing the source and
> realize that the underlying name-rev does not honor the option.
The story was: I tried to understand why git describe --contains did not
do what I expected. The documentation said that --debug would output
candidates, but it did not do anything.
So, instead of learning how git describe --contains works, I got
side-tracked into understanding why git describe --contains does not do
what the documentation says. That was a waste of time that we can avoid.
"viewing the source" should not be necessary to understand what is going
on, should it?
> If "--debug" is truly valuable, "name-rev" can gain "--debug" later
> and then we can pass it down if we want.
>
> Also, it is not like "--debug" is incompatible. It is just the
> "--contains" codepath is overly silent and does not give any useful
> information when run in the debug mode. "incompatible" is more like
> "would not work correctly when both are given", which is not the
> case here.
Well, thee notion of giving debug output is certainly not incompatible.
But if the "--debug" does not output anything with "--contains" then it
is not working, which I would call incompatible (implementation, not
concept).
>>
>> Signed-off-by: Michael J Gruber <git@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;
next prev parent reply other threads:[~2017-03-17 11:31 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-15 13:15 [PATCH 0/3] describe --contains sanity Michael J Gruber
2017-03-15 13:15 ` [PATCH 1/3] describe: debug is incompatible with contains Michael J Gruber
2017-03-15 19:21 ` Junio C Hamano
2017-03-17 10:54 ` Michael J Gruber [this message]
2017-03-15 13:15 ` [PATCH 2/3] git-prompt: add a describe style for any tags Michael J Gruber
2017-03-15 19:25 ` Junio C Hamano
2017-03-17 10:56 ` Michael J Gruber
2017-03-15 13:15 ` [RFD PATCH 3/3] name-rev: Allow lightweight tags and branch refs Michael J Gruber
2017-03-15 16:14 ` Junio C Hamano
2017-03-15 19:50 ` Junio C Hamano
2017-03-15 20:51 ` Junio C Hamano
2017-03-15 22:50 ` [PATCH 0/2] Teach name-rev to pay more attention to lightweight tags Junio C Hamano
2017-03-15 22:50 ` [PATCH 1/2] name-rev: refactor logic to see if a new candidate is a better name Junio C Hamano
2017-03-15 22:50 ` [PATCH 2/2] name-rev: favor describing with tags and use committer date to tiebreak Junio C Hamano
2017-03-17 4:07 ` Lars Schneider
2017-03-17 5:45 ` Junio C Hamano
2017-03-17 5:56 ` Junio C Hamano
2017-03-17 17:09 ` Lars Schneider
2017-03-17 17:17 ` Junio C Hamano
2017-03-17 22:43 ` Junio C Hamano
2017-03-29 14:39 ` [PATCH v2 0/3] name-rev sanity Michael J Gruber
2017-03-29 14:39 ` [PATCH v2 1/3] name-rev: refactor logic to see if a new candidate is a better name Michael J Gruber
2017-03-29 14:39 ` [PATCH v2 2/3] name-rev: favor describing with tags and use committer date to tiebreak Michael J Gruber
2017-03-29 14:39 ` [PATCH v2 3/3] name-rev: provide debug output Michael J Gruber
2017-03-29 17:15 ` [PATCH v2 0/3] name-rev sanity Junio C Hamano
2017-03-29 17:43 ` Junio C Hamano
2017-03-30 13:48 ` Michael J Gruber
2017-03-30 17:30 ` Junio C Hamano
2017-03-31 13:51 ` [PATCH v3 0/4] " Michael J Gruber
2017-03-31 13:51 ` [PATCH v3 1/4] name-rev: refactor logic to see if a new candidate is a better name Michael J Gruber
2017-03-31 13:51 ` [PATCH v3 2/4] name-rev: favor describing with tags and use committer date to tiebreak Michael J Gruber
2017-03-31 13:51 ` [PATCH v3 3/4] name-rev: provide debug output Michael J Gruber
2017-03-31 16:52 ` Junio C Hamano
2017-03-31 16:55 ` Junio C Hamano
2017-03-31 18:02 ` Michael J Gruber
2017-03-31 18:06 ` Junio C Hamano
2017-03-31 18:33 ` Junio C Hamano
2017-04-03 14:46 ` Michael J Gruber
2017-04-03 17:07 ` Junio C Hamano
2017-05-20 5:19 ` Junio C Hamano
2017-03-31 19:10 ` Junio C Hamano
2017-03-31 13:51 ` [PATCH v3 4/4] describe: pass --debug down to name-rev Michael J Gruber
2017-03-17 11:25 ` [PATCH 2/2] name-rev: favor describing with tags and use committer date to tiebreak Michael J Gruber
2017-03-17 16:03 ` Junio C Hamano
2017-03-16 0:14 ` [PATCH 0/2] Teach name-rev to pay more attention to lightweight tags Stefan Beller
2017-03-16 10:28 ` Jacob Keller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a76bd1ae-74a8-a85c-852a-e36514cd05d5@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).