git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* "git tag --contains <id>" is too chatty, if <id> is invalid
@ 2016-01-18 21:24 Toralf Förster
  2016-01-18 21:54 ` Jeff King
  0 siblings, 1 reply; 12+ messages in thread
From: Toralf Förster @ 2016-01-18 21:24 UTC (permalink / raw)
  To: git

 very first line is "error: malformed object name <id>" which tells all, or ?

-- 
Toralf, pgp: C4EACDDE 0076E94E

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: "git tag --contains <id>" is too chatty, if <id> is invalid
@ 2016-03-19 16:49 Chirayu Desai
  2016-03-19 17:04 ` Pranit Bauva
  2016-03-19 17:57 ` Jeff King
  0 siblings, 2 replies; 12+ messages in thread
From: Chirayu Desai @ 2016-03-19 16:49 UTC (permalink / raw)
  To: git, peff

Hi, I want to work on this as my GSoC micro project.

> On Mon, Jan 18, 2016 at 10:24:31PM +0100, Toralf Förster wrote:
> > very first line is "error: malformed object name <id>" which tells all, or ?
> Yeah, I agree that showing the "-h" help is a bit much.
> This is a side effect of looking up in the commit in the parse-options
> callback. It has to signal an error to the option parser, and then the
> option parser always shows the help on an error.
> I think we'd need to do one of:
> 1. call die() in the option-parsing callback (this is probably a bad
> precedent, as the callbacks might be reused from a place that wants
> to behave differently)
I assume you mean parse-options-cb.c:parse_opt_commits() by the callback.
I see that it is currently used only by commands which have a "--with"
or "--contains" option,
and all of them behave the same way, printing the full usage, so a one
line change in that function would fix it for all of those.
> 2. have the callback just store the argument string, and then resolve
> the commit later (and die or whatever if it doesn't exist). This
> pushes more work onto the caller, but in this case it's all done by
> the ref-filter code, so it could presumably happen during another
> part of the ref-filter setup.
I'm not quire sure how exactly to do that.
> 3. teach parse-options to accept some specific non-zero return code
> that means "return an error, but don't show the usage"
This sounds good, but also the most intrusive of 3.
> I think any one of those would be a good project for somebody looking to
> get their feet wet in working on git. I think (2) is the cleanest.
> -Peff

What would be the best way to proceed with this?

Thanks,
Chirayu Desai

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-03-24 17:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-18 21:24 "git tag --contains <id>" is too chatty, if <id> is invalid Toralf Förster
2016-01-18 21:54 ` Jeff King
  -- strict thread matches above, loose matches on Subject: below --
2016-03-19 16:49 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
2016-03-24 17:22           ` Chirayu Desai
2016-03-20 22:25   ` Junio C Hamano

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).