All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwen@google.com>, Jeff King <peff@peff.net>,
	Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: [PATCH v4 0/8] Allow writing invalid OIDs into refs for testing purposes
Date: Tue, 07 Dec 2021 13:38:12 +0000	[thread overview]
Message-ID: <pull.1147.v4.git.git.1638884300.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1147.v3.git.git.1638470403.gitgitgadget@gmail.com>

this covers a few cases of direct filesystem access to the ref database in
tests.

v4:

 * fix stack OOB read due to missing array terminator.

Han-Wen Nienhuys (8):
  test-ref-store: remove force-create argument for create-reflog
  test-ref-store: parse symbolic flag constants
  test-ref-store: plug memory leak in cmd_delete_refs
  refs: update comment.
  refs: introduce REF_SKIP_OID_VERIFICATION flag
  refs: introduce REF_SKIP_REFNAME_VERIFICATION flag
  t1430: remove refs using test-tool
  t1430: create valid symrefs using test-helper

 refs.c                         |  7 +--
 refs.h                         | 16 +++++-
 refs/files-backend.c           | 53 ++++++++++---------
 t/helper/test-ref-store.c      | 75 +++++++++++++++++++++++----
 t/t1006-cat-file.sh            |  5 +-
 t/t1405-main-ref-store.sh      |  8 ++-
 t/t1406-submodule-ref-store.sh |  2 +-
 t/t1430-bad-ref-name.sh        | 93 ++++++++++++++++++----------------
 t/t3800-mktag.sh               |  6 ++-
 9 files changed, 172 insertions(+), 93 deletions(-)


base-commit: abe6bb3905392d5eb6b01fa6e54d7e784e0522aa
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1147%2Fhanwen%2Fskip-verification-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1147/hanwen/skip-verification-v4
Pull-Request: https://github.com/git/git/pull/1147

Range-diff vs v3:

 1:  3649ef6d0fa = 1:  3649ef6d0fa test-ref-store: remove force-create argument for create-reflog
 2:  3cdebd2dbca ! 2:  865458bc0cb test-ref-store: parse symbolic flag constants
     @@ t/helper/test-ref-store.c
      +	return result;
      +}
      +
     -+static struct flag_definition empty_flags[] = {
     -+	{ NULL, 0 },
     -+};
     ++static struct flag_definition empty_flags[] = { { NULL, 0 } };
      +
       static const char *notnull(const char *arg, const char *name)
       {
     @@ t/helper/test-ref-store.c: static const char **get_store(const char **argv, stru
       	return argv + 1;
       }
       
     -+static struct flag_definition pack_flags[] = {
     -+	FLAG_DEF(PACK_REFS_PRUNE),
     -+	FLAG_DEF(PACK_REFS_ALL),
     -+};
     ++static struct flag_definition pack_flags[] = { FLAG_DEF(PACK_REFS_PRUNE),
     ++					       FLAG_DEF(PACK_REFS_ALL),
     ++					       { NULL, 0 } };
       
       static int cmd_pack_refs(struct ref_store *refs, const char **argv)
       {
     @@ t/helper/test-ref-store.c: static int cmd_create_symref(struct ref_store *refs,
      +static struct flag_definition transaction_flags[] = {
      +	FLAG_DEF(REF_NO_DEREF),
      +	FLAG_DEF(REF_FORCE_CREATE_REFLOG),
     -+	{ NULL, 0 },
     ++	{ NULL, 0 }
      +};
      +
       static int cmd_delete_refs(struct ref_store *refs, const char **argv)
 3:  536005d65a2 = 3:  dcd4e9f5f26 test-ref-store: plug memory leak in cmd_delete_refs
 4:  466b4451015 = 4:  67d22211ac4 refs: update comment.
 5:  89d692a34b8 ! 5:  a8713dd59ee refs: introduce REF_SKIP_OID_VERIFICATION flag
     @@ t/helper/test-ref-store.c: static int cmd_create_symref(struct ref_store *refs,
       	FLAG_DEF(REF_NO_DEREF),
       	FLAG_DEF(REF_FORCE_CREATE_REFLOG),
      +	FLAG_DEF(REF_SKIP_OID_VERIFICATION),
     - 	{ NULL, 0 },
     + 	{ NULL, 0 }
       };
       
      
 6:  af9e94935bf ! 6:  577726dc9df refs: introduce REF_SKIP_REFNAME_VERIFICATION flag
     @@ t/helper/test-ref-store.c: static struct flag_definition transaction_flags[] = {
       	FLAG_DEF(REF_FORCE_CREATE_REFLOG),
       	FLAG_DEF(REF_SKIP_OID_VERIFICATION),
      +	FLAG_DEF(REF_SKIP_REFNAME_VERIFICATION),
     - 	{ NULL, 0 },
     + 	{ NULL, 0 }
       };
       
      
 7:  d4f1d209468 = 7:  d85cfa3fee1 t1430: remove refs using test-tool
 8:  ca7f8aea3d9 = 8:  7597620ec83 t1430: create valid symrefs using test-helper

-- 
gitgitgadget

  parent reply	other threads:[~2021-12-07 13:39 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 15:55 [PATCH 0/2] Allow writing invalid OIDs into refs for testing purposes Han-Wen Nienhuys via GitGitGadget
2021-11-25 15:56 ` [PATCH 1/2] refs: update comment Han-Wen Nienhuys via GitGitGadget
2021-11-25 15:56 ` [PATCH 2/2] refs: allow skipping OID verification Han-Wen Nienhuys via GitGitGadget
2021-11-26  7:32   ` Junio C Hamano
2021-11-29 18:49 ` [PATCH v2 0/6] Allow writing invalid OIDs into refs for testing purposes Han-Wen Nienhuys via GitGitGadget
2021-11-29 18:49   ` [PATCH v2 1/6] test-ref-store: plug memory leak in cmd_delete_refs Han-Wen Nienhuys via GitGitGadget
2021-11-29 23:15     ` Junio C Hamano
2021-11-29 18:49   ` [PATCH v2 2/6] refs: update comment Han-Wen Nienhuys via GitGitGadget
2021-11-29 23:17     ` Junio C Hamano
2021-11-29 18:49   ` [PATCH v2 3/6] refs: allow skipping OID verification Han-Wen Nienhuys via GitGitGadget
2021-11-29 23:28     ` Junio C Hamano
2021-11-29 18:49   ` [PATCH v2 4/6] refs: add REF_SKIP_REFNAME_VERIFICATION flag Han-Wen Nienhuys via GitGitGadget
2021-11-29 23:22     ` Junio C Hamano
2021-11-29 23:31     ` Junio C Hamano
2021-11-30 10:31       ` Han-Wen Nienhuys
2021-12-01 19:00         ` Junio C Hamano
2021-12-01 19:26           ` Jeff King
2021-12-02 16:40             ` Han-Wen Nienhuys
2021-12-02 19:05               ` Junio C Hamano
2021-11-29 18:49   ` [PATCH v2 5/6] t1430: remove refs using test-tool Han-Wen Nienhuys via GitGitGadget
2021-11-29 18:49   ` [PATCH v2 6/6] t1430: create valid symrefs using test-helper Han-Wen Nienhuys via GitGitGadget
2021-11-29 23:12   ` [PATCH v2 0/6] Allow writing invalid OIDs into refs for testing purposes Junio C Hamano
2021-12-02 18:39   ` [PATCH v3 0/8] " Han-Wen Nienhuys via GitGitGadget
2021-12-02 18:39     ` [PATCH v3 1/8] test-ref-store: remove force-create argument for create-reflog Han-Wen Nienhuys via GitGitGadget
2021-12-02 18:39     ` [PATCH v3 2/8] test-ref-store: parse symbolic flag constants Han-Wen Nienhuys via GitGitGadget
2021-12-03  6:22       ` Jeff King
2021-12-02 18:39     ` [PATCH v3 3/8] test-ref-store: plug memory leak in cmd_delete_refs Han-Wen Nienhuys via GitGitGadget
2021-12-02 18:39     ` [PATCH v3 4/8] refs: update comment Han-Wen Nienhuys via GitGitGadget
2021-12-02 18:39     ` [PATCH v3 5/8] refs: introduce REF_SKIP_OID_VERIFICATION flag Han-Wen Nienhuys via GitGitGadget
2021-12-02 18:40     ` [PATCH v3 6/8] refs: introduce REF_SKIP_REFNAME_VERIFICATION flag Han-Wen Nienhuys via GitGitGadget
2021-12-02 18:40     ` [PATCH v3 7/8] t1430: remove refs using test-tool Han-Wen Nienhuys via GitGitGadget
2021-12-02 18:40     ` [PATCH v3 8/8] t1430: create valid symrefs using test-helper Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38     ` Han-Wen Nienhuys via GitGitGadget [this message]
2021-12-07 13:38       ` [PATCH v4 1/8] test-ref-store: remove force-create argument for create-reflog Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38       ` [PATCH v4 2/8] test-ref-store: parse symbolic flag constants Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38       ` [PATCH v4 3/8] test-ref-store: plug memory leak in cmd_delete_refs Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38       ` [PATCH v4 4/8] refs: update comment Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38       ` [PATCH v4 5/8] refs: introduce REF_SKIP_OID_VERIFICATION flag Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38       ` [PATCH v4 6/8] refs: introduce REF_SKIP_REFNAME_VERIFICATION flag Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38       ` [PATCH v4 7/8] t1430: remove refs using test-tool Han-Wen Nienhuys via GitGitGadget
2021-12-07 13:38       ` [PATCH v4 8/8] t1430: create valid symrefs using test-helper Han-Wen Nienhuys via GitGitGadget
2021-12-07 21:18       ` [PATCH v4 0/8] Allow writing invalid OIDs into refs for testing purposes Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1147.v4.git.git.1638884300.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hanwen@google.com \
    --cc=hanwenn@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.