All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] describe: make '--always' fallback work after '--exact-match' failed
Date: Fri, 21 Aug 2015 08:55:32 -0700	[thread overview]
Message-ID: <xmqqwpwo7i17.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20150821134039.Horde.wW7OPRQO28gZidreZRgP7g2@webmail.informatik.kit.edu> ("SZEDER Gábor"'s message of "Fri, 21 Aug 2015 13:40:39 +0200")

SZEDER Gábor <szeder@ira.uka.de> writes:

> Quoting Junio C Hamano <gitster@pobox.com>:
>
>> Well, that can be argued both ways.
> ...
>
> 'git describe' errors out by default if it can't describe the given
> commit.

Yes.  "describe" always fails when it cannot produce an acceptable
description.

And "--always" and "--exact-match" are two incompatible ways for
users to change what is considered an acceptable description.

 - With "--exact-match" and "--always", the definition of
   "acceptable" changes: by default, only a name based on some
   anchor point is acceptable.

   - "--always" loosens the definition and also allows an
     abbreviated commit object name as acceptable.

   - "--exact-match" tightens the definition.  In addition to "only
     a name based on some anchor point is acceptable", it requires
     that "based on" to be "0 distance from the anchor point".  The
     help text says succinctly: "*ONLY* output exact matches".

If you allow a request with "--exact-match" to show something that
is not an exact match, that no longer is "--exact-match".  Allowing
to mix "--always" to that option breaks it, as what the command does
no longer is to "only outputs exact matches".

 - One option "--exact-match" says that it is wrong to show anything
   but exact matches.

 - The other option "--always" says it is willing to show a name
   that is not an exact match.  

These are competing goals.  You give preference to the latter, but
that is not the only valid point of view.

And that is why I said it can be argued both ways.  I think these
two are fundamentally incompatible.


[Footnote]

*1* Other parts of "'describe' only considers a name based on some
    anchor point as acceptable." are also modified by various
    options:

    - With "--contains", the definition of "based on" changes
      direction: a commit may be described as somewhere ahead of an
      anchor point by default, but can be described as somewhere behind
      of an anchor point.

    - With "--all" and "--tags", the definition of "anchor point"
      changes: by default, only annotated tags are possible anchor
      points.

  reply	other threads:[~2015-08-21 15:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-20 12:13 [PATCH] describe: make '--always' fallback work after '--exact-match' failed SZEDER Gábor
2015-08-20 18:39 ` Junio C Hamano
2015-08-21 11:40   ` SZEDER Gábor
2015-08-21 15:55     ` Junio C Hamano [this message]
2015-08-21 14:50 ` [PATCH] describe --contains: default to HEAD when no commit-ish is given SZEDER Gábor
2015-08-21 16:30   ` Junio C Hamano
2015-08-24 16:14     ` SZEDER Gábor
2015-08-24 16:15       ` [PATCH v2] " SZEDER Gábor
2015-08-24 18:47       ` [PATCH] " Junio C Hamano

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=xmqqwpwo7i17.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=szeder@ira.uka.de \
    /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.