Subject: [PATCH v4 0/6] refs: cleanup errno sideband ref related functions

From: "Han-Wen Nienhuys via GitGitGadget" <[email-masked]>
Date: Tue, 06 Jul 2021 18:55:51 +0000

v5

 * address Ævar's comment; punt on clearing errno.

Han-Wen Nienhuys (6):
  refs: remove EINVAL errno output from specification of read_raw_ref_fn
  refs/files-backend: stop setting errno from lock_ref_oid_basic
  refs: make errno output explicit for read_raw_ref_fn
  refs: add failure_errno to refs_read_raw_ref() signature
  refs: explicitly return failure_errno from parse_loose_ref_contents
  refs: make errno output explicit for refs_resolve_ref_unsafe

 refs.c                | 60 ++++++++++++++++++++++++-----------
 refs/debug.c          |  4 +--
 refs/files-backend.c  | 73 ++++++++++++++++++++++---------------------
 refs/packed-backend.c | 15 ++++-----
 refs/refs-internal.h  | 40 ++++++++++++++++--------
 5 files changed, 116 insertions(+), 76 deletions(-)

base-commit: 670b81a890388c60b7032a4f5b879f2ece8c4558
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1012%2Fhanwen%2Feinval-sideband-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1012/hanwen/einval-sideband-v4
Pull-Request: https://github.com/git/git/pull/1012

Range-diff vs v3:

 1:  e2a0e5387ab ! 1:  d6a41c3c0cb refs: remove EINVAL errno output from specification of read_raw_ref_fn
     @@ Commit message
          Spotted by Ævar Arnfjörð Bjarmason <[email-masked]>.
      
          Signed-off-by: Han-Wen Nienhuys <[email-masked]>
     -    Reviewed-by: Jonathan Tan <[email-masked]>
      
       ## refs/refs-internal.h ##
      @@ refs/refs-internal.h: typedef int reflog_expire_fn(struct ref_store *ref_store,
 2:  c594c9c5c67 ! 2:  ff7ea6efcba refs/files-backend: stop setting errno from lock_ref_oid_basic
     @@ Commit message
          documented to use and/or preserve errno)
      
          Signed-off-by: Han-Wen Nienhuys <[email-masked]>
     -    Reviewed-by: Jonathan Tan <[email-masked]>
     -    Reviewed-by: Ævar Arnfjörð Bjarmason <[email-masked]>
     +    Reviewed-By: Ævar Arnfjörð Bjarmason <[email-masked]>
      
       ## refs/files-backend.c ##
      @@ refs/files-backend.c: static int create_reflock(const char *path, void *cb)
 3:  b017caf54ba ! 3:  ff5696b0875 refs: make errno output explicit for read_raw_ref_fn
     @@ Commit message
          relevant.
      
          Signed-off-by: Han-Wen Nienhuys <[email-masked]>
     -    Reviewed-by: Jonathan Tan <[email-masked]>
     -    Reviewed-by: Ævar Arnfjörð Bjarmason <[email-masked]>
     +    Reviewed-By: Ævar Arnfjörð Bjarmason <[email-masked]>
      
       ## refs.c ##
      @@ refs.c: int refs_read_raw_ref(struct ref_store *ref_store,
 4:  4aaa9d3bd6f ! 4:  9c933706cb0 refs: add failure_errno to refs_read_raw_ref() signature
     @@ Commit message
          This lets us use the explicit errno output parameter in refs_resolve_ref_unsafe.
      
          Signed-off-by: Han-Wen Nienhuys <[email-masked]>
     -    Reviewed-by: Jonathan Tan <[email-masked]>
     -    Reviewed-by: Ævar Arnfjörð Bjarmason <[email-masked]>
     +    Reviewed-By: Ævar Arnfjörð Bjarmason <[email-masked]>
      
       ## refs.c ##
      @@ refs.c: done:
 -:  ----------- > 5:  ab147afb38d refs: explicitly return failure_errno from parse_loose_ref_contents
 5:  ed5347d7bb6 ! 6:  0526a41b4b3 refs: make errno output explicit for refs_resolve_ref_unsafe
     @@ Commit message
          that needs error information to make logic decisions, so update that caller
      
          Signed-off-by: Han-Wen Nienhuys <[email-masked]>
     -    Reviewed-by: Jonathan Tan <[email-masked]>
     -    Reviewed-by: Ævar Arnfjörð Bjarmason <[email-masked]>
     +    Reviewed-By: Ævar Arnfjörð Bjarmason <[email-masked]>
      
       ## refs/files-backend.c ##
      @@ refs/files-backend.c: static struct ref_lock *lock_ref_oid_basic(struct files_ref_store *refs,

-- 
gitgitgadget