All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@grubix.eu>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Lars Schneider <larsxschneider@gmail.com>,
	Luke Diamand <luke@diamand.org>
Subject: Re: [PATCH v3 3/4] name-rev: provide debug output
Date: Mon, 3 Apr 2017 16:46:01 +0200	[thread overview]
Message-ID: <c85bc2a1-56d8-8a02-6089-2b8cb3d39e99@grubix.eu> (raw)
In-Reply-To: <xmqqzig1xpm6.fsf@gitster.mtv.corp.google.com>

Junio C Hamano venit, vidit, dixit 31.03.2017 20:33:
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Michael J Gruber <git@grubix.eu> writes:
>>
>>>> The only case that this change may make a difference I can think of
>>>> is when you have a tag object pointed at from outside refs/tags
>>>> (e.g. refs/heads/foo is a tag object); if you are trying to change
>>>> the definition of "from_tag" from the current "Is the tip inside
>>>> refs/tags/?" to "Is the tip either inside refs/tags/ or is it a tag
>>>> object anywhere?", that may be a good change (I didn't think things
>>>> through, though), but that shouldn't be hidden inside a commit that
>>>> claims to only add support for debugging.
>>>>
>>>> What problem are you solving?  
>>>
>>> Sorry, I forgot about that change and failed to mention it.
>>>
>>> It makes no difference in the non-debug case which cares about the
>>> Boolean only. In the debug case, I want to distinguish between
>>> annotated and lightweight tags, just like describe --debug does. By
>>> adding 1 via deref and passing this down, I know that an annotated tag
>>> gets the value 2, a lightweight tag 1 and everything else 0, just like
>>> describe --tags.
>>
>> So it sounds like you meant to do something else, and the
>> implementation is wrong for that something else (i.e. it wouldn't do
>> the right thing for a tag object outside refs/tags/, with or without
>> the "--debug" option passed).
> 
> The damage seems worse, but I may be misreading the code.
> 
> is_better_name() compares name->from_tag and from_tag numerically,
> because it was designed to take a boolean view of that variable.
> Now, an artificially bumped 2 gets compared with name->from_tag that
> may be 1 and gets different priority.  That artificially inflated
> value may be propagated to name->from_tag when the current tip is
> judged as a better basis for naming the object.

No, I checked not to change the existing behaviour.

If you look at the comment above that then you see that one of the sides
of the comparison is a non-tag, so we compare 0 to 1 or 2, the boolean
outcome being the same.

> If this change is only for debugging, perhaps inside if(data->debug)
> you added, instead of looking at from_tag, you can look at both
> from_tag and deref to choose which prio-nmes to show, without
> butchering the value in from_tag variable to affect the existing
> code that is exercised with or without --debug?

What I did overlook, though, was that name-rev uses the notion "under
refs/tags" for "being a tag".

In fact, it's puzzling how different describe and name-rev proceed and
weigh the alternatives. I didn't mean to change that.

In retrospect, displaying the "same" debug information for the two
commands doesn't make too much sense as long as they use different
information. name-rev does-not distinguish between tag types, so why
even display it?

I think I should change 3/4 to display exactly those bits that name-rev
actually uses for weighing different possible descriptions; they are
differents from the "describe-bits". So please withhold 3/4 and 4/4.

Michael

  reply	other threads:[~2017-04-03 14:46 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
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c85bc2a1-56d8-8a02-6089-2b8cb3d39e99@grubix.eu \
    --to=git@grubix.eu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    --cc=luke@diamand.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.