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

Re: New semantic patches vs. in-flight topics [was: Re: [PATCH 00/19] Bring more repository handles into our code base]

From
Stefan Beller <sbeller@google.com>
Date
Oct 23, 2018, 00:26 UTC
Message-ID
<CAGZ79kaWaY+oxJfoMbsCcq6MZDPoq1OgOwK0a9mkKR7sUEOHpg@mail.gmail.com>
In-Reply-To
<xmqqzhv5tx4m.fsf@gitster-ct.c.googlers.com>
Show 7 quoted lines
> Stepping back a bit, I'd imagine in an ideal world where "make
> coccicheck" can be done instantaneously _and_ the spatch machinery
> is just as reliable as C compilers.
> [...]
> Now we do not live in that ideal world and [...]
>  such a series will have zero
> chance of landing in 'pu', unless we freeze the world.

I wonder if we could approximate the ideal world with rerere+spatch a bit more:

1) I resend the series that includes "apply cocci patches"
    as the last patch and you queue it as usual
2) The first time such a series is merged, you'd merge
    HEAD^ (i.e. excluding the "apply the semantic patch)
    to pu instead. I view this as a yet-to-be invented mode
    '--theirs-is-stale-use-tree-instead=THEIRS~1^{tree}',
    then run spatch to reproduce the last patch into the
    dirty merge (which has pu and the last patch as parent)
    This step is done to 'pre-heat' the rerere cache.
3) Any further integration (e.g. rebuilding pu) would
    benefit from the hot rerere cache and very little work
    is actually required as the conflicts are resolved by rerere.
Am I overestimating or misunderstanding rerere here?
Show 10 quoted lines
> What I _could_ do (and what I did do only for one round of pushing
> out 'pu') is to queue a coccinelle transformation at the tip of
> integration branches.  If "make coccicheck" ran in subsecond, I
> could even automate it in the script that is used to rebuild 'pu'
> every day, so that after merging each and every topic, do the "make
> coccicheck" and apply resulting .cocci.patch files and squash that
> into the merge commit.
>
> But with the current "make coccicheck" performance, that is not
> realistic.
Would it be realistic for next and master branch instead of pu?

I'd be wary for the master branch, as we may not want to rely on spatch without review. (It can produce funny white space issues, but seems to produce working/correct code)

> I am wondering if it is feasible to do it at the tip of 'pu' (which
> is rebuilt two to three times a day), 'next' (which is updated once
> or twice a week) and 'master'.

We could even optimize that, by checking if contrib/cocci/ has changes for the new tip of next/master respectively.

Another thing I wonder is if we care about the distinction between the (a) pending changes as described by SZEDER, as we introduce these deliberately, whereas (b) undesirable code patterns (e.g. free and null instead of FREE_AND_NULL macro) might be caught and reported in pu/next and then someone learns from it. Automatic rewriting the (b) cases seems not just as desirable as (a), where we do it purely to avoid resolving merge conflicts by hand.

> I find that your "pending" idea may be nicer, as it distributes the
> load.  Whoever wants to change the world order by updating the .cocci
> rules is primarily responsible for making it happen without breaking
> the world during the transition.  That's more scalable.

... and I think SZEDER considers the current world broken as 'make coccicheck' returns non-empty, so it sounds to me as if the current transition is thought less-than-optimal.

Previous: Junio C HamanoNext: Junio C Hamano
Message 39 of 46 in “Bring more repository handles into our code base”
  1. 00/19 Bring more repository handles into our code baseStefan Beller, Oct 16, 2018
  2. 01/19 sha1_file: allow read_object to read objects in arbitrary repositoriesStefan Beller, Oct 16, 2018
  3. 02/19 packfile: allow has_packed_and_bad to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  4. 03/19 object-store: allow read_object_file_extended to read from arbitrary repositoriesStefan Beller, Oct 16, 2018
  5. 04/19 object-store: prepare read_object_file to deal with arbitrary repositoriesStefan Beller, Oct 16, 2018
  6. 05/19 object-store: prepare has_{sha1, object}_file[_with_flags] to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  7. 06/19 object: parse_object to honor its repository argumentStefan Beller, Oct 16, 2018
  8. 07/19 commit: allow parse_commit* to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  9. 08/19 commit-reach.c: allow paint_down_to_common to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  10. 09/19 commit-reach.c: allow merge_bases_many to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  11. 10/19 commit-reach.c: allow remove_redundant to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  12. 11/19 commit-reach.c: allow get_merge_bases_many_0 to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  13. 12/19 commit-reach: prepare get_merge_bases to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  14. 13/19 commit-reach: prepare in_merge_bases[_many] to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  15. 14/19 commit: prepare get_commit_buffer to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  16. 15/19 commit: prepare repo_unuse_commit_buffer to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  17. 16/19 commit: prepare logmsg_reencode to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  18. 17/19 pretty: prepare format_commit_message to handle arbitrary repositoriesStefan Beller, Oct 16, 2018
  19. 18/19 submodule: use submodule repos for object lookupStefan Beller, Oct 16, 2018
  20. Jonathan TanOct 19, 2018
  21. SZEDER GáborOct 25, 2018
  22. Derrick StoleeOct 31, 2018
  23. Stefan BellerNov 1, 2018
  24. 19/19 submodule: don't add submodule as odb for pushStefan Beller, Oct 16, 2018
  25. Jonathan TanOct 19, 2018
  26. Derrick StoleeOct 17, 2018
  27. Stefan BellerOct 17, 2018
  28. 0/2 Bring the_repository into cmd_fooStefan Beller, Oct 18, 2018
  29. 1/2 repository: have get_the_repository() to remove the_repository dependencyStefan Beller, Oct 18, 2018
  30. 2/2 builtin/merge-base.c: do not rely on the_repository any moreStefan Beller, Oct 18, 2018
  31. Jonathan TanOct 18, 2018
  32. Stefan BellerOct 18, 2018
  33. Junio C HamanoOct 19, 2018
  34. New semantic patches vs. in-flight topics [was: Re: [PATCH 00/19] Bring more repository handles into our code base]SZEDER Gábor, Oct 22, 2018
  35. Stefan BellerOct 22, 2018
  36. SZEDER GáborOct 25, 2018
  37. Stefan BellerOct 25, 2018
  38. Junio C HamanoOct 22, 2018
  39. Stefan BellerOct 23, 2018
  40. Junio C HamanoOct 23, 2018
  41. Junio C HamanoOct 23, 2018
  42. Carlo ArenasOct 23, 2018
  43. Junio C HamanoOct 23, 2018
  44. Stefan BellerOct 23, 2018
  45. Junio C HamanoOct 24, 2018
  46. Jeff KingOct 25, 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.