Skip to content

commit-graph: test cleanup and modernization

Taylor Blau git 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyIn review
  2. v15 patches 9 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5t/lib-commit-graph.sh: allow `graph_read_expect()` in sub-directoriest/lib-commit-graph.sh+13 -30 replies
2/5t/lib-commit-graph.sh: avoid directory change in `graph_git_behavior()`t/lib-commit-graph.sh+15 -60 replies
3/5t5318: avoid top-level directory changest/t5318-commit-graph.sh+172 -2061 reply
4/5t5328: avoid top-level directory changest/t5328-commit-graph-64bit-time.sh+27 -270 replies
5/5t/lib-commit-graph.sh: avoid sub-shell in `graph_git_behavior()`t/lib-commit-graph.sh+5 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/5] commit-graph: test cleanup and modernization

Here is a reroll of my series to address a few style nitpicks in the commit-graph tests.

Much is the same from the previous round, except for:

- quotes >"$DIR/expect" to ensure that we work on all shells>
- adds a NOTE above graph_git_behavior to indicate that its second argument cannot contain any character in $IFS.
- rebased on top of the current tip of 'master'.

As usual, a range-diff is available below. Thanks in advance for your review!

Taylor Blau (5):
t/lib-commit-graph.sh: allow graph_read_expect() in sub-directories t/lib-commit-graph.sh: avoid directory change in

    `graph_git_behavior()`

t5318: avoid top-level directory changes
t5328: avoid top-level directory changes t/lib-commit-graph.sh: avoid sub-shell in graph_git_behavior()

 t/lib-commit-graph.sh              |  34 ++-
 t/t5318-commit-graph.sh            | 378 +++++++++++++----------------
 t/t5328-commit-graph-64bit-time.sh |  54 ++---
 3 files changed, 224 insertions(+), 242 deletions(-)

Range-diff against v1:
1: 08482212630 ! 1: c81a059c181 t/lib-commit-graph.sh: allow graph_read_expect() in sub-directories

    @@ t/lib-commit-graph.sh: graph_read_expect() {
      		OPTIONS=" read_generation_data"
      	fi
     -	cat >expect <<- EOF
    -+	cat >$DIR/expect <<- EOF
    ++	cat >"$DIR/expect" <<-EOF
      	header: 43475048 1 $(test_oid oid_version) $NUM_CHUNKS 0
      	num_commits: $1
      	chunks: oid_fanout oid_lookup commit_metadata$OPTIONAL

2: 715a160903b ! 2: 115df6fe226 t/lib-commit-graph.sh: avoid directory change in graph_git_behavior()
@@ Commit message

## t/lib-commit-graph.sh ##
-@@ t/lib-commit-graph.sh: graph_git_behavior() {
+@@ t/lib-commit-graph.sh: graph_git_two_modes() {
+ test_cmp expect output
+ }
+
++# graph_git_behavior <name> <directory> <branch> <compare>
++#
++# Ensures that a handful of traversal operations produce the same ++# results with and without the commit-graph in use.
++#
++# NOTE: it is a bug to call this function with <directory> containing ++# any characters in $IFS.
+ graph_git_behavior() {
+ MSG=$1
+ DIR=$2
BRANCH=$3
COMPARE=$4
test_expect_success "check normal git operations: $MSG" '

3:  451ec003be8 = 3:  12ce967bafe t5318: avoid top-level directory changes
4:  ba550987055 = 4:  79b3444660f t5328: avoid top-level directory changes
5:  c3432f27b94 = 5:  887006eab46 t/lib-commit-graph.sh: avoid sub-shell in `graph_git_behavior()`
Signature · 1 line
2.41.0.399.g887006eab46