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

Re: [PATCH v2 7/6] t7814: do not generate same commits in different repos

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 28, 2019, 16:17 UTC
Message-ID
<xmqqtvc98z1n.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190628093528.20372-1-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 32 quoted lines
> t7814 has repo tree like this
>
>   initial-repo
>     submodule
>       sub
>
> In each repo 'submodule' and 'sub', a commit is made to add the same
> initial file 'a' with the same message 'add a'. If tests run fast
> enough, the two commits are made in the same second, resulting
> identical commits.
>
> There is nothing wrong with that per-se. But it could make the test
> flaky. Currently all submodule odbs are merged back in the main
> one (because we can't, or couldn't, access separate submodule repos
> otherwise). But eventually we need to access objects from the right
> repo.
>
> Because the same commit could sometimes be present in both 'submodule'
> and 'sub', if there is a bug looking up objects in the wrong repo,
> sometimes it will go unnoticed because it finds the needed object in the
> wrong repo anyway.
>
> Fix this by changing commit time after every commit. This makes all
> commits unique. Of course there are still identical blobs in different
> repos, but because we often lookup commit first, then tree and blob,
> unique commits are already quite safe.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  > And I can't quite understand how t7814 sometimes passed.
>
>  I do now. This patch makes it fail consistently for me.
Well analysed.  Very well done.  Thanks.
Previous: Nguyễn Thái Ngọc Duy
Message 31 of 31 in “Kill the_repository in tree-walk.c”
  1. 0/6 Kill the_repository in tree-walk.cNguyễn Thái Ngọc Duy, Jun 24, 2019
  2. 1/6 sha1-file.c: remove the_repo from read_object_with_reference()Nguyễn Thái Ngọc Duy, Jun 24, 2019
  3. Johannes SchindelinJun 27, 2019
  4. Duy NguyenJun 27, 2019
  5. 2/6 tree-walk.c: remove the_repo from fill_tree_descriptor()Nguyễn Thái Ngọc Duy, Jun 24, 2019
  6. Derrick StoleeJun 24, 2019
  7. Junio C HamanoJun 26, 2019
  8. Derrick StoleeJun 26, 2019
  9. 3/6 tree-walk.c: remove the_repo from get_tree_entry()Nguyễn Thái Ngọc Duy, Jun 24, 2019
  10. Derrick StoleeJun 24, 2019
  11. Duy NguyenJun 24, 2019
  12. 4/6 tree-walk.c: remove the_repo from get_tree_entry_follow_symlinks()Nguyễn Thái Ngọc Duy, Jun 24, 2019
  13. 5/6 match-trees.c: remove the_repo from shift_tree*()Nguyễn Thái Ngọc Duy, Jun 24, 2019
  14. 6/6 Use the right 'struct repository' instead of the_repositoryNguyễn Thái Ngọc Duy, Jun 24, 2019
  15. Derrick StoleeJun 24, 2019
  16. Duy NguyenJun 24, 2019
  17. Johannes SchindelinJun 27, 2019
  18. Junio C HamanoJun 26, 2019
  19. Johannes SchindelinJun 27, 2019
  20. Derrick StoleeJun 27, 2019
  21. 0/6 Kill the_repository in tree-walk.cNguyễn Thái Ngọc Duy, Jun 27, 2019
  22. 1/6 sha1-file.c: remove the_repo from read_object_with_reference()Nguyễn Thái Ngọc Duy, Jun 27, 2019
  23. Johannes SchindelinJun 28, 2019
  24. 2/6 tree-walk.c: remove the_repo from fill_tree_descriptor()Nguyễn Thái Ngọc Duy, Jun 27, 2019
  25. 3/6 tree-walk.c: remove the_repo from get_tree_entry()Nguyễn Thái Ngọc Duy, Jun 27, 2019
  26. 4/6 tree-walk.c: remove the_repo from get_tree_entry_follow_symlinks()Nguyễn Thái Ngọc Duy, Jun 27, 2019
  27. 5/6 match-trees.c: remove the_repo from shift_tree*()Nguyễn Thái Ngọc Duy, Jun 27, 2019
  28. 6/6 Use the right 'struct repository' instead of the_repositoryNguyễn Thái Ngọc Duy, Jun 27, 2019
  29. Junio C HamanoJun 27, 2019
  30. 7/6 t7814: do not generate same commits in different reposNguyễn Thái Ngọc Duy, Jun 28, 2019
  31. Junio C HamanoJun 28, 2019

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.