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

[PATCH 0/3] update delete_ref(), update_ref() and ref_exists() to take a struct repository

From
PGPhillip Wood via GitGitGadget <gitgitgadget@gmail.com>
Date
Jun 19, 2020, 15:21 UTC
Message-ID
<pull.665.git.1592580071.gitgitgadget@gmail.com>

The code handling pseudo refs such as BISECT_HEAD or CHERRY_PICK_HEAD assumes that they are files and uses unlink() and file_exists() on the corresponding paths rather than using the ref api. In repositories using reftable to store references this will not work. This patch series is a preparatory step that updates some reference functions to take a struct repository in preparation for converting code that handles pseudo refs to the ref api. The conversion will be handled by a separate series

These patches could each be split in two (thereby making the individual patches smaller) by changing the callers to pass the_repository first and then changing the call chain to pass a struct repository around if desired.

This series is based on master - 101b3204f3 ("The third batch", 2020-06-17). When merging into pu there are non-trivial conflicts with jx/proc-receive-hook, dr/push-remoteref-fix and mr/bisect-in-c-2. I have prepared a conflict resolution [1] I'm happy to rebase on top of a merge of master and those three branches if that is helpful.

[1] tag merge-repo-refs-into-pu/v1 at https://github.com/phillipwood/git.git
Phillip Wood (3):
  refs: update delete_ref() to take a struct repository
  refs: update update_ref() to take a struct repository
  refs: update ref_exists() to take a struct repository
 bisect.c                 | 18 ++++++----
 branch.c                 | 14 ++++----
 branch.h                 |  6 ++--
 builtin/am.c             | 19 +++++-----
 builtin/bisect--helper.c |  8 ++---
 builtin/branch.c         | 23 ++++++------
 builtin/checkout.c       | 17 +++++----
 builtin/clone.c          | 16 ++++-----
 builtin/commit.c         |  4 +--
 builtin/for-each-ref.c   |  4 +--
 builtin/log.c            |  6 ++--
 builtin/ls-remote.c      |  2 +-
 builtin/merge.c          | 12 +++----
 builtin/notes.c          | 15 ++++----
 builtin/pull.c           |  5 +--
 builtin/rebase.c         | 10 +++---
 builtin/receive-pack.c   |  2 +-
 builtin/remote.c         | 11 +++---
 builtin/replace.c        |  2 +-
 builtin/reset.c          | 10 +++---
 builtin/revert.c         |  2 +-
 builtin/send-pack.c      |  3 +-
 builtin/stash.c          |  8 ++---
 builtin/symbolic-ref.c   |  3 +-
 builtin/tag.c            |  8 ++---
 builtin/update-ref.c     |  5 +--
 builtin/verify-tag.c     |  2 +-
 builtin/worktree.c       |  8 ++---
 diff.c                   |  2 +-
 fast-import.c            |  2 +-
 notes-cache.c            |  4 +--
 notes-cache.h            |  2 +-
 notes-utils.c            |  2 +-
 ref-filter.c             | 76 +++++++++++++++++++++++++---------------
 ref-filter.h             | 11 +++---
 refs.c                   | 14 ++++----
 refs.h                   |  6 ++--
 remote.c                 | 30 +++++++++-------
 remote.h                 | 13 ++++---
 reset.c                  |  8 ++---
 sequencer.c              | 41 +++++++++++-----------
 sequencer.h              |  2 +-
 sha1-name.c              |  5 +--
 transport-helper.c       | 32 +++++++++--------
 transport-internal.h     |  4 ++-
 transport.c              | 15 ++++----
 transport.h              |  3 +-
 wt-status.c              | 41 ++++++++++++----------
 wt-status.h              |  2 +-
 49 files changed, 314 insertions(+), 244 deletions(-)
base-commit: 101b3204f37606972b40fc17dec84560c22f69f6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-665%2Fphillipwood%2Fwip%2Frepo-refs-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-665/phillipwood/wip/repo-refs-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/665
-- 
gitgitgadget
Next: Phillip Wood via GitGitGadget
Message 1 of 4 in “update delete_ref(), update_ref() and ref_exists() to take a struct repository”
  1. 0/3 update delete_ref(), update_ref() and ref_exists() to take a struct repositoryPhillip Wood via GitGitGadget, Jun 19, 2020
  2. 3/3 refs: update ref_exists() to take a struct repositoryPhillip Wood via GitGitGadget, Jun 19, 2020
  3. 2/3 refs: update update_ref() to take a struct repositoryPhillip Wood via GitGitGadget, Jun 19, 2020
  4. 1/3 refs: update delete_ref() to take a struct repositoryPhillip Wood via GitGitGadget, Jun 19, 2020

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.