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

Re: [PATCH 0/3] More add_submodule_odb() cleanup in merge code

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Sep 9, 2021, 17:51 UTC
Message-ID
<20210909175152.2550626-1-jonathantanmy@google.com>
In-Reply-To
<CABPp-BGKBMtue-T1ah-+RQHJ+ceYBVsqs54Vx0p-Hs+UkLXPtw@mail.gmail.com>
Show 19 quoted lines
> On Wed, Sep 8, 2021 at 11:18 AM Jonathan Tan <jonathantanmy@google.com> wrote:
> >
> > (CC-ing Elijah in case he has insight into the merge-ort part.)
> 
> All the submodule merging related functions were lifted from
> merge-recursive.c and minimally modified to fit the new structure.
> The only substantive change I made was to fix the merge result for
> virtual merge bases, but that's like one or two lines of code.  In
> particular, everything relating to submodule objects was totally
> untouched...and I think that's reflected in the fact that your PATCH 2
> basically is the same patch twice, once for merge-recursive and once
> for merge-ort.
> 
> I read over PATCH 2 and I didn't find anything that looked
> problematic, but I'm not up-to-speed on the add_submodule_odb and repo
> handling bits of the codebase so I'm not sure I would catch anything.
> But I am encouraged by the fact that it looks like you did the same
> stuff to merge-recursive and merge-ort; I'd be worried you missed
> something if that weren't the case.
Thanks for taking a look.
Show 21 quoted lines
> As a sidenote, though...
> 
> This does remind me that I noticed that the following functions from
> object-store.h do not take an explicit repository:
> 
> write_object_file()
> hash_object_file()
> hash_object_file_literally()
> force_object_loose()
> 
> I have a patch sitting around somewhere (possibly only still
> referenced in my 'temp' branch) to make repo_*() variants of the above
> functions, and turn the above into simple wrappers of the repo_*()
> variants which just pass the_repository (much like someone else did
> with read_object_file() and repo_read_object_file()).  It also updates
> merge-ort to use the new repo_*() functions.  However, I ended up
> excluding it from my merge-ort submissions since it wasn't necessary.
> Would this be of interest in your submodule work, though?  I guess
> it'd only matter if we started doing real merges of submodules as part
> of a parent repo merge.  (As opposed to the fast-forward-only merges
> that merge-recursive/merge-ort do right now for submodules.)

I think that these functions would be useful if we were to write into submodules (for example, in a real merge of submodules, as you said). Right now my submodule work is just making it support partial clones, so I'm not planning to introduce any new submodule writes. (Well, besides the fact that a lazy-fetch in a submodule would end up with new objects, but that's already handled because we do the fetch in a separate process in the submodule's gitdir.)

Previous: Elijah NewrenNext: Jonathan Tan
Message 9 of 14 in “More add_submodule_odb() cleanup in merge code”
  1. 0/3 More add_submodule_odb() cleanup in merge codeJonathan Tan, Sep 8, 2021
  2. 1/3 t6437: run absorbgitdirs on reposJonathan Tan, Sep 8, 2021
  3. Jonathan TanSep 8, 2021
  4. Junio C HamanoSep 8, 2021
  5. Jonathan TanSep 9, 2021
  6. 2/3 revision: remove "submodule" from opt structJonathan Tan, Sep 8, 2021
  7. 3/3 DO NOT SUBMIT commit-reach,revision: verify non-mixingJonathan Tan, Sep 8, 2021
  8. Elijah NewrenSep 9, 2021
  9. Jonathan TanSep 9, 2021
  10. 0/3 More add_submodule_odb() cleanup in merge codeJonathan Tan, Sep 9, 2021
  11. 1/3 submodule: remove unnecessary unabsorbed fallbackJonathan Tan, Sep 9, 2021
  12. 2/3 repository: support unabsorbed in repo_submodule_initJonathan Tan, Sep 9, 2021
  13. 3/3 revision: remove "submodule" from opt structJonathan Tan, Sep 9, 2021
  14. Elijah NewrenSep 14, 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.