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

Re: [RFC PATCH 00/19] Bring more repository handles into our code base

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 12, 2018, 18:50 UTC
Message-ID
<20181012185037.GA52080@aiede.svl.corp.google.com>
In-Reply-To
<20181011211754.31369-1-sbeller@google.com>
Hi,
Stefan Beller wrote:
Show 6 quoted lines
> This applies on nd/the-index (b3c7eef9b05) and is the logical continuation of
> the object store series, which I sent over the last year.
>
> The previous series did take a very slow and pedantic approach,
> using a #define trick, see cfc62fc98c for details, but it turns out,
> that it doesn't work:

Thanks for the heads up --- this will remind me to review this new series more carefully, since it differs from what was reviewed before.

I think this will be easiest to review with --function-context. I can generate that diff locally, so no need to resend.

Show 7 quoted lines
>    When changing the signature of widely used functions, it burdens the
>    maintainer in resolving the semantic conflicts.
>
>    In the orginal approach this was called a feature, as then we can ensure
>    that not bugs creep into the code base during the merge window (while such
>    a refactoring series wanders from pu to master). It turns out this
>    was not well received and was just burdensome.
I don't agree with this characterization.

The question of who resolves conflicts is separate from the question of whether conflicts appear, which is in turn separate from the question of whether the build breaks.

I consider making the build break when a caller tries to use a half-converted function too early to be a very useful feature. There is a way to do that in C++ that allows decoupled conversions, but the C version forced an ordering of the conversions. It seems that the pain was caused by the combination of

 1. that coupling, which forced an ordering on the conversions and
    prevented us from ordering the patches in an order based on
    convenience of integration (unlike e.g. the "struct object_id"
    series which was able to proceed by taking a batch covering a
    quiet area of the tree at a time)
 2. as you mentioned, removal of old API at the same time of addition
 of new API forced callers across the tree to update at once
 3. the lack of having decided how to handle the anticipated churn

Now most of the conversions are done (thanks much for that) so the ordering (1) is not the main remaining pain point. Thanks for tackling the other two in this series.

I want future API changes to be easier. That means tackling the following questions up front:

 i. Where does this fit in Rusty's API rating scheme
    <http://sweng.the-davies.net/Home/rustys-api-design-manifesto>?
    Does misuse (or misconverted callers) break the build, break
    visibly at runtime, or are the effects more subtle?
 ii. Is there good test coverage for the new API?  Are there tests
     that need to be migrated?
 iii. Is there a way to automatically migrate callers, or does this
      require manual, error-prone work (thanks for tackling that in
      this one.)
 iv. How are we planning to handle multiple patches in flight?  Will
     the change produce merge conflicts?  How can others on the list
     help the maintainer with integrating this set of changes?
 iv. Is the ending point cleaner than where we started?
The #define trick you're referring to was a way of addressing (i).
[...]
>  79 files changed, 571 insertions(+), 278 deletions(-)

Most of the increase is in the coccinelle file and in improved documentation.

It appears that some patches use a the_index-style NO_THE_REPOSITORY_COMPATIBILITY_MACROS backward compatibility synonym and others don't. Can you say a little more about this aspect of the approach? Would the compatibility macros go away eventually?

Thanks, Jonathan

Previous: Junio C HamanoNext: Stefan Beller
Message 36 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.