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

[PATCH 0/2] Cleanup refs API [WAS: Re: [PATCH 2/3] refs: introduce new API, wrap old API shallowly around new API]

From
Stefan Beller <sbeller@google.com>
Date
Jul 30, 2018, 19:47 UTC
Message-ID
<20180730194731.220191-1-sbeller@google.com>
In-Reply-To
<CACsJy8Cx7u5YtK6sPJ=HbAOUBXCrP7VOgMyoQ58SB6q_s4N7Gg@mail.gmail.com>
Show 9 quoted lines
> > I anticipate that we need to have a lot of back pointers to the repository
> > in question, hence I think we should have the repository pointer promoted
> > to not just a back pointer.
>
> I will probably need more time to study that commit and maybe the mail
> archive for the history of this series. But if I remember correctly
> some of these for_each_ api is quite a pain (perhaps it's the for_each
> version of reflog?) and it's probably better to redesign it (again
> talking without real understanding of the problem).

I stepped back a bit and reconsidered the point made above, and I do not think that the repository argument is any special. If you need a repository (for e.g. lookup_commit or friends), you'll have to pass it through the callback cookie, whether directly or as part of a struct tailored to your purpose.

Instead we should strive to make the refs API smaller and cleaner, omitting the repository argument at all, and instead should be focussing on a ref_store argument instead.

This series applies on master; when we decide to go this direction we can drop origin/sb/refs-in-repo.

Thanks, Stefan

Derrick Stolee (1):
  replace-objects: use arbitrary repositories
Stefan Beller (1):
  refs: switch for_each_replace_ref back to use a ref_store
 builtin/replace.c | 4 +---
 refs.c            | 4 ++--
 refs.h            | 2 +-
 replace-object.c  | 5 +++--
 4 files changed, 7 insertions(+), 8 deletions(-)
-- 
2.18.0.132.g195c49a2227
Previous: Duy NguyenNext: Stefan Beller
Message 8 of 14 in “Migrate the refs API to take the repository argument”
  1. 0/3 Migrate the refs API to take the repository argumentStefan Beller, Jul 27, 2018
  2. 1/3 refs.c: migrate internal ref iteration to pass thru repository argumentStefan Beller, Jul 27, 2018
  3. 2/3 refs: introduce new API, wrap old API shallowly around new APIStefan Beller, Jul 27, 2018
  4. Duy NguyenJul 27, 2018
  5. Brandon WilliamsJul 27, 2018
  6. Stefan BellerJul 27, 2018
  7. Duy NguyenJul 27, 2018
  8. 0/2 Cleanup refs API [WAS: Re: [PATCH 2/3] refs: introduce new API, wrap old API shallowly around new API]Stefan Beller, Jul 30, 2018
  9. 1/2 replace-objects: use arbitrary repositoriesStefan Beller, Jul 30, 2018
  10. 2/2 refs: switch for_each_replace_ref back to use a ref_storeStefan Beller, Jul 30, 2018
  11. Jonathan TanJul 31, 2018
  12. Stefan BellerJul 31, 2018
  13. Duy NguyenJul 31, 2018
  14. 3/3 replace: migrate to for_each_replace_repo_refStefan Beller, Jul 27, 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.