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

Re: [PATCH 5/5] load_ref_decorations(): avoid parsing non-tag objects

From
Derrick Stolee <stolee@gmail.com>
Date
Jun 22, 2021, 17:25 UTC
Message-ID
<c4c27819-157c-d694-d758-8dbb46499ab3@gmail.com>
In-Reply-To
<YNIZRlTic6K+6rvf@coredump.intra.peff.net>
On 6/22/2021 1:09 PM, Jeff King wrote:
Show 17 quoted lines
> On Tue, Jun 22, 2021 at 01:06:48PM -0400, Jeff King wrote:
> 
>>> Do you mean "if (objtype < 0)" here? There is a 'type' variable,
>>> but it is an enum decoration_type and I can't find a reason why
>>> it would be negative. oid_object_info() _does_ return -1 if there
>>> is a problem loading the object, so that would make sense.
>>
>> Whoops, thanks for catching that. I originally called it "enum
>> object_type type", but then of course the compiler informed that there
>> was already a "type" variable in the function. So I renamed it to
>> "objtype" but missed updating that line. But it still compiled. Yikes. :)
>>
>> It doesn't trigger in the test suite because it only happens if the
>> repository is corrupted.
> 
> I'm tempted by this as a cleanup on top (I don't want to do it inline,
> since the diff is so noisy). But I'm also content to leave it.
Naming is hard. This change seems worth it.

Thanks, -Stolee

Previous: Jeff KingNext: Ævar Arnfjörð Bjarmason
Message 10 of 16 in “some "log --decorate" optimizations”
  1. 0/5 some "log --decorate" optimizationsJeff King, Jun 22, 2021
  2. 1/5 pretty.h: update and expand docstring for userformat_find_requirements()Jeff King, Jun 22, 2021
  3. 2/5 log: avoid loading decorations for userformats that don't need itJeff King, Jun 22, 2021
  4. 3/5 object.h: expand docstring for lookup_unknown_object()Jeff King, Jun 22, 2021
  5. 4/5 object.h: add lookup_object_by_type() functionJeff King, Jun 22, 2021
  6. 5/5 load_ref_decorations(): avoid parsing non-tag objectsJeff King, Jun 22, 2021
  7. Derrick StoleeJun 22, 2021
  8. Jeff KingJun 22, 2021
  9. Jeff KingJun 22, 2021
  10. Derrick StoleeJun 22, 2021
  11. Ævar Arnfjörð BjarmasonJun 22, 2021
  12. Jeff KingJun 22, 2021
  13. Ævar Arnfjörð BjarmasonJun 22, 2021
  14. Jeff KingJun 22, 2021
  15. Taylor BlauJun 23, 2021
  16. Jeff KingJun 23, 2021

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.