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

[PATCH v2 0/3] refs: cleanup errno sideband ref related functions.

From
Han-Wen Nienhuys via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 23, 2021, 15:31 UTC
Message-ID
<pull.1011.v2.git.git.1619191907.gitgitgadget@gmail.com>
In-Reply-To
<pull.1011.git.git.1619173446857.gitgitgadget@gmail.com>
v2:
 * peff's feedback. For now, leave refs.c alone; instead cleanups in
   files-backend and the ref backend API.
Han-Wen Nienhuys (3):
  refs: remove EINVAL specification from the errno sideband in
    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.c                |  7 +++++--
 refs/debug.c          |  4 ++--
 refs/files-backend.c  | 26 +++++++++-----------------
 refs/packed-backend.c |  5 +++--
 refs/refs-internal.h  | 14 ++++++++------
 5 files changed, 27 insertions(+), 29 deletions(-)
base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1011%2Fhanwen%2Feinval-sideband-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1011/hanwen/einval-sideband-v2
Pull-Request: https://github.com/git/git/pull/1011
Range-diff vs v1:
 1:  ed080f6a9c40 ! 1:  7e8181e77d40 refs: remove EINVAL specification from the errno sideband in read_raw_ref_fn
     @@ Commit message
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
     - ## refs.c ##
     -@@ refs.c: const char *refs_resolve_ref_unsafe(struct ref_store *refs,
     - 	if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
     - 		if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) ||
     - 		    !refname_is_safe(refname)) {
     --			errno = EINVAL;
     - 			return NULL;
     - 		}
     - 
     -@@ refs.c: const char *refs_resolve_ref_unsafe(struct ref_store *refs,
     - 		if (check_refname_format(refname, REFNAME_ALLOW_ONELEVEL)) {
     - 			if (!(resolve_flags & RESOLVE_REF_ALLOW_BAD_NAME) ||
     - 			    !refname_is_safe(refname)) {
     --				errno = EINVAL;
     - 				return NULL;
     - 			}
     - 
     -
       ## refs/refs-internal.h ##
      @@ refs/refs-internal.h: typedef int reflog_expire_fn(struct ref_store *ref_store,
        * properly-formatted or even safe reference name. NEITHER INPUT NOR
 -:  ------------ > 2:  db5da7d7fb51 refs/files-backend: stop setting errno from lock_ref_oid_basic
 -:  ------------ > 3:  7fbc1c754f43 refs: make errno output explicit for read_raw_ref_fn
-- 
gitgitgadget
Previous: Han-Wen NienhuysNext: Han-Wen Nienhuys via GitGitGadget
Message 4 of 11 in “refs: remove EINVAL specification from the errno sideband in read_raw_ref_fn”
  1. refs: remove EINVAL specification from the errno sideband in read_raw_ref_fnHan-Wen Nienhuys via GitGitGadget, Apr 23, 2021
  2. Jeff KingApr 23, 2021
  3. Han-Wen NienhuysApr 23, 2021
  4. 0/3 refs: cleanup errno sideband ref related functions.Han-Wen Nienhuys via GitGitGadget, Apr 23, 2021
  5. 1/3 refs: remove EINVAL specification from the errno sideband in read_raw_ref_fnHan-Wen Nienhuys via GitGitGadget, Apr 23, 2021
  6. 2/3 refs/files-backend: stop setting errno from lock_ref_oid_basicHan-Wen Nienhuys via GitGitGadget, Apr 23, 2021
  7. Junio C HamanoApr 28, 2021
  8. Han-Wen NienhuysApr 28, 2021
  9. Junio C HamanoApr 29, 2021
  10. Han-Wen NienhuysApr 29, 2021
  11. 3/3 refs: make errno output explicit for read_raw_ref_fnHan-Wen Nienhuys via GitGitGadget, Apr 23, 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.