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

Re: [PATCH 05/19] object: parse_object to honor its repository argument

From
Stefan Beller <sbeller@google.com>
Date
Oct 13, 2018, 00:00 UTC
Message-ID
<CAGZ79kbr-K3OARrn=3dGTmeMUUVVHPw3fp9zX=vy3pJrv8g2Tg@mail.gmail.com>
In-Reply-To
<20181011221114.186377-1-jonathantanmy@google.com>
On Thu, Oct 11, 2018 at 3:11 PM Jonathan Tan <jonathantanmy@google.com> wrote:
Show 21 quoted lines
>
> > In 8e4b0b6047 (object.c: allow parse_object to handle
> > arbitrary repositories, 2018-06-28), we forgot to pass the
> > repository down to the read_object_file.
>
> [snip]
>
> > @@ -270,7 +270,7 @@ struct object *parse_object(struct repository *r, const struct object_id *oid)
> >               return lookup_object(r, oid->hash);
> >       }
> >
> > -     buffer = read_object_file(oid, &type, &size);
> > +     buffer = repo_read_object_file(r, oid, &type, &size);
>
> There is still the matter of the 2 invocations of has_object_file()
> earlier in this function. The first one probably can be replaced with
> oid_object_info_extended() (see the definition of
> has_sha1_file_with_flags() to see how to do it), and the second one
> looks redundant to me and can be removed. Apart from that, I don't see
> any other invocations that need to be converted, so parse_object() will
> indeed fully honor its repository argument.

I will convert the has_{sha1, object}_file[_with_flags] functions before this patch in a resend and just pass along the repository.

I'll defer the change of logic to another patch to be followed up later.
Previous: Jonathan TanNext: Stefan Beller
Message 11 of 37 in “Bring more repository handles into our code base”
  1. 00/19 Bring more repository handles into our code baseStefan Beller, Oct 11, 2018
  2. 01/19 sha1_file: allow read_object to read objects in arbitrary repositoriesStefan Beller, Oct 11, 2018
  3. 02/19 packfile: allow has_packed_and_bad to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  4. 03/19 object-store: allow read_object_file_extended to read from arbitrary repositoriesStefan Beller, Oct 11, 2018
  5. Jonathan TanOct 11, 2018
  6. 04/19 object-store: prepare read_object_file to deal with arbitrary repositoriesStefan Beller, Oct 11, 2018
  7. Jonathan TanOct 11, 2018
  8. Stefan BellerOct 11, 2018
  9. 05/19 object: parse_object to honor its repository argumentStefan Beller, Oct 11, 2018
  10. Jonathan TanOct 11, 2018
  11. Stefan BellerOct 13, 2018
  12. 06/19 commit: allow parse_commit* to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  13. 07/19 commit.c: allow paint_down_to_common to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  14. 08/19 commit.c: allow merge_bases_many to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  15. 09/19 commit.c: allow remove_redundant to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  16. 10/19 commit: allow get_merge_bases_many_0 to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  17. 11/19 commit: prepare get_merge_bases to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  18. 12/19 commit: prepare get_commit_buffer to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  19. 13/19 commit: prepare in_merge_bases[_many] to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  20. 14/19 commit: prepare repo_unuse_commit_buffer to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  21. 15/19 commit: prepare logmsg_reencode to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  22. 16/19 pretty: prepare format_commit_message to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  23. Jonathan TanOct 11, 2018
  24. 17/19 submodule: use submodule repos for object lookupStefan Beller, Oct 11, 2018
  25. Jonathan TanOct 11, 2018
  26. Stefan BellerOct 13, 2018
  27. Stefan BellerOct 16, 2018
  28. Jonathan TanOct 16, 2018
  29. Stefan BellerOct 16, 2018
  30. 18/19 submodule: don't add submodule as odb for pushStefan Beller, Oct 11, 2018
  31. Jonathan TanOct 11, 2018
  32. Stefan BellerOct 11, 2018
  33. 19/19 Apply semantic patches from previous patchesStefan Beller, Oct 11, 2018
  34. Jonathan TanOct 11, 2018
  35. Junio C HamanoOct 11, 2018
  36. Jonathan NiederOct 12, 2018
  37. Stefan BellerOct 13, 2018

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.