git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Chirayu Desai <chirayudesai1@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: "git tag --contains <id>" is too chatty, if <id> is invalid
Date: Wed, 23 Mar 2016 18:41:13 -0400	[thread overview]
Message-ID: <20160323224113.GB12531@sigill.intra.peff.net> (raw)
In-Reply-To: <CAJj6+1H6L=LxnDRzuC6OzXgVvzXsngGJ5X=E5Fi6Fg7JXkEJaQ@mail.gmail.com>

On Sun, Mar 20, 2016 at 12:19:46PM +0530, Chirayu Desai wrote:

> I went for 3, and have sent a patch for that here - [PATCH/GSoC]
> parse-options: Add a new nousage opt
> However, it currently has one bug
> Running 'git tag --contains qq' twice will first show an error, then
> print qq, meaning that the first command creates the tag qq.
> Running 'git tag -l --contains qq' works fine.
> My first question is if 'git tag --contains' (without '-l') supposed to work?
> If not, then I would fix that bug, otherwise fix the bug my code
> introduced, and add tests for it.

Yes, "--contains" should imply "-l", and we should complain if there is
an attempt to create a tag.

This seems to work with the tip of "master":

  $ git tag --contains v2.8.0-rc3
  v2.8.0-rc3
  v2.8.0-rc4

  $ git tag --contains qq
  error: malformed object name qq
  [...and then the usage...]

  $ git tag --contains HEAD qq
  fatal: --contains option is only allowed with -l.

  $ git rev-parse --verify qq
  fatal: Needed a single revision

but with your patch:

  $ git tag --contains qq
  error: malformed object name qq

  $ git rev-parse --verify qq
  e9cacb7f8231dd6616671f9bcdd0945043483064

So presumably we're not aborting the program when the options fail to
parse, and it continues to process the "qq" as a tag to be created.

-Peff

  reply	other threads:[~2016-03-23 22:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-19 16:49 "git tag --contains <id>" is too chatty, if <id> is invalid Chirayu Desai
2016-03-19 17:04 ` Pranit Bauva
2016-03-19 17:51   ` Chirayu Desai
2016-03-19 17:57 ` Jeff King
2016-03-19 18:08   ` Chirayu Desai
2016-03-19 18:12     ` Jeff King
2016-03-20  6:49       ` Chirayu Desai
2016-03-23 22:41         ` Jeff King [this message]
2016-03-24 17:22           ` Chirayu Desai
2016-03-20 22:25   ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2016-01-18 21:24 Toralf Förster
2016-01-18 21:54 ` Jeff King

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=20160323224113.GB12531@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=chirayudesai1@gmail.com \
    --cc=git@vger.kernel.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 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 NNTP newsgroup(s).