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

Re: [PATCH v2 3/4] show-ref: Optimize show_ref a bit

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 22, 2017, 22:55 UTC
Message-ID
<xmqq60l6vh61.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqa8aivhik.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> Having to do this change probably is an indication that the division
> of labour between show_ref() and show_one() up to this step needs to
> be rethought.
>
> Conceptually, "git show-ref" works in two ways:
>
>  * When in --verify mode, the end user gives which refnames to
>    consider showing.
>
>  * Otherwise the end user gives pattern and the command infers which
>    refnames to consider showing using the pattern.
>
> And for the refnames that are considered for showing, we may do
> various things, like -d to deref and --quiet to be silent.  We want
> this actual "output" step to be the same between two modes of
> operation.

... also "error out if the named object did not exist" can be part of this, which means ...

Show 6 quoted lines
> So a better division of labour would be:
>
>  * Make show_ref() about "using pattern, enumerate what refs to
>    show" and call show_one().
>
>  * Update show_one() and teach _it_ to handle quiet and deref_tags.

... "if (!has_sha1_file(oid->hash)) die()" in show_ref() would probably want to be part of this update.

Previous: Junio C HamanoNext: Vladimir Panteleev
Message 5 of 7 in “show-ref: Allow -d, --head to work with --verify”
  1. show-ref: Allow -d, --head to work with --verifyVladimir Panteleev, Jan 21, 2017
  2. 4/4 show-ref: Inline show_oneVladimir Panteleev, Jan 21, 2017
  3. 3/4 show-ref: Optimize show_ref a bitVladimir Panteleev, Jan 21, 2017
  4. Junio C HamanoJan 22, 2017
  5. Junio C HamanoJan 22, 2017
  6. 1/4 show-ref: Allow --head to work with --verifyVladimir Panteleev, Jan 21, 2017
  7. 2/4 show-ref: Allow -d to work with --verifyVladimir Panteleev, Jan 21, 2017

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.