git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] rev-parse: honor --quiet when asking for reflog dates that do not exist

From
David Aguilar <davvid@gmail.com>
Date
Sep 19, 2014, 03:47 UTC
Message-ID
<20140919034715.GA26728@gmail.com>
In-Reply-To
<xmqqmw9wq54z.fsf@gitster.dls.corp.google.com>
On Thu, Sep 18, 2014 at 09:12:44AM -0700, Junio C Hamano wrote:
Show 22 quoted lines
> David Aguilar <davvid@gmail.com> writes:
> 
> > @@ -514,8 +514,11 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1,
> >  
> >  	if (warn_ambiguous_refs &&
> >  	    (refs_found > 1 ||
> > -	     !get_short_sha1(str, len, tmp_sha1, GET_SHA1_QUIETLY)))
> > -		warning(warn_msg, len, str);
> > +	     !get_short_sha1(str, len, tmp_sha1, GET_SHA1_QUIETLY))) {
> > +		if (!(flags & GET_SHA1_QUIETLY)) {
> > +			warning(warn_msg, len, str);
> > +		}
> > +	}
> 
> Hmph, wouldn't it be simpler to read and understand if it were done
> this way instead?
> 
> -	if (warn_ambiguous_refs &&
> +	if (warn_ambiguous_refs && !(flags & GET_SHA1_QUIETLY) &&
>  	    (refs_found > 1 || !get_short_sha1(...)))
> 		waqrning(...);
> 
Yes, it would.

I squashed this patch into the original "make rev-parse --quiet actually quiet" patch, along with your suggestions, and sent it as a replacement patch for the commit in pu.

-- 
David
Previous: Junio C Hamano
Message 5 of 5 in “fixup! refs: make rev-parse --quiet actually quiet”
  1. 1/2 fixup! refs: make rev-parse --quiet actually quietDavid Aguilar, Sep 17, 2014
  2. 2/2 rev-parse: honor --quiet when asking for reflog dates that do not existDavid Aguilar, Sep 17, 2014
  3. Junio C HamanoSep 18, 2014
  4. Junio C HamanoSep 18, 2014
  5. David AguilarSep 19, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.