Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: git/git
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ed155187b429a2a6b6475efe1767053df37ccfe1
Choose a base ref
...
head repository: git/git
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2b14ced370aea017efc32b525fd72a6dd2cc60c5
Choose a head ref
  • 6 commits
  • 9 files changed
  • 1 contributor

Commits on Sep 8, 2024

  1. t: move reftable/stack_test.c to the unit testing framework

    reftable/stack_test.c exercises the functions defined in
    reftable/stack.{c, h}. Migrate reftable/stack_test.c to the
    unit testing framework. Migration involves refactoring the tests
    to use the unit testing framework instead of reftable's test
    framework and renaming the tests to be in-line with unit-tests'
    standards.
    
    Since some of the tests use set_test_hash() defined by
    reftable/test_framework.{c, h} but these files are not
    '#included' in the test file, copy this function in the
    ported test file.
    
    With the migration of stack test to the unit-tests framework,
    "test-tool reftable" becomes a no-op. Hence, get rid of everything
    that uses "test-tool reftable" alongside everything that is used
    to implement it.
    
    While at it, alphabetically sort the cmds[] list in
    helper/test-tool.c by moving the entry for "dump-reftable".
    
    Mentored-by: Patrick Steinhardt <ps@pks.im>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Chandra Pratap authored and gitster committed Sep 8, 2024
    Configuration menu
    Copy the full SHA
    15e29ea View commit details
    Browse the repository at this point in the history
  2. t: harmonize t-reftable-stack.c with coding guidelines

    Harmonize the newly ported test unit-tests/t-reftable-stack.c
    with the following guidelines:
    - Single line 'for' statements must omit curly braces.
    - Structs must be 0-initialized with '= { 0 }' instead of '= { NULL }'.
    - Array sizes and indices should preferably be of type 'size_t' and
      not 'int'.
    - Function pointers should be passed as 'func' and not '&func'.
    
    While at it, remove initialization for those variables that are
    re-used multiple times, like loop variables.
    
    Mentored-by: Patrick Steinhardt <ps@pks.im>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Chandra Pratap authored and gitster committed Sep 8, 2024
    Configuration menu
    Copy the full SHA
    e4e384f View commit details
    Browse the repository at this point in the history
  3. t-reftable-stack: use Git's tempfile API instead of mkstemp()

    Git's tempfile API defined by $GIT_DIR/tempfile.{c,h} provides
    a unified interface for tempfile operations. Since reftable/stack.c
    uses this API for all its tempfile needs instead of raw functions
    like mkstemp(), make the ported stack test strictly use Git's
    tempfile API as well.
    
    A bigger benefit is the fact that we know to clean up the tempfile
    in case the test fails because it gets registered and pruned via a
    signal handler.
    
    Mentored-by: Patrick Steinhardt <ps@pks.im>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Chandra Pratap authored and gitster committed Sep 8, 2024
    Configuration menu
    Copy the full SHA
    476abc3 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. t-reftable-stack: use reftable_ref_record_equal() to compare ref records

    In the current stack tests, ref records are compared for equality
    by sometimes using the dedicated function for ref-record comparison,
    reftable_ref_record_equal(), and sometimes by explicity comparing
    contents of the ref records.
    
    The latter method is undesired because there can exist unequal ref
    records with some of the contents being equal. Replace the latter
    instances of ref-record comparison with the former. This has the
    added benefit of preserving uniformity throughout the test file.
    
    Mentored-by: Patrick Steinhardt <ps@pks.im>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Chandra Pratap authored and gitster committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    1052280 View commit details
    Browse the repository at this point in the history
  2. t-reftable-stack: add test for non-default compaction factor

    In a recent codebase update (commit ae8e378, merge branch
    'ps/reftable-write-options', 2024/05/13) the geometric factor used
    in auto-compaction of reftable tables was made configurable. Add
    a test to verify the functionality introduced by this update.
    
    Mentored-by: Patrick Steinhardt <ps@pks.im>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Chandra Pratap authored and gitster committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    e879524 View commit details
    Browse the repository at this point in the history
  3. t-reftable-stack: add test for stack iterators

    reftable_stack_init_ref_iterator and reftable_stack_init_log_iterator
    as defined by reftable/stack.{c,h} initialize a stack iterator to
    iterate over the ref and log records in a reftable stack respectively.
    Since these functions are not exercised by any of the existing tests,
    add a test for them.
    
    Mentored-by: Patrick Steinhardt <ps@pks.im>
    Mentored-by: Christian Couder <chriscool@tuxfamily.org>
    Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
    Chandra Pratap authored and gitster committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    2b14ced View commit details
    Browse the repository at this point in the history
Loading