* [PATCH 03/12] t1414: convert test to use Git commands instead of writing refs manually
From: John Cai via GitGitGadget @ 2024-01-17 19:52 UTC (permalink / raw)
To: git; +Cc: John Cai, John Cai
In-Reply-To: <pull.1647.git.git.1705521155.gitgitgadget@gmail.com>
From: John Cai <johncai86@gmail.com>
This test can be re-written to use Git commands rather than writing a
manual ref in the reflog. This way this test no longer needs the
REFFILES prerequisite.
Signed-off-by: John Cai <johncai86@gmail.com>
---
t/t1414-reflog-walk.sh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index ea64cecf47b..c7b3817d3bd 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -121,13 +121,14 @@ test_expect_success 'min/max age uses entry date to limit' '
# Create a situation where the reflog and ref database disagree about the latest
# state of HEAD.
-test_expect_success REFFILES 'walk prefers reflog to ref tip' '
+test_expect_success 'walk prefers reflog to ref tip' '
+ test_commit A &&
+ test_commit B &&
+ git reflog delete HEAD@{0} &&
head=$(git rev-parse HEAD) &&
- one=$(git rev-parse one) &&
- ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
- echo "$head $one $ident broken reflog entry" >>.git/logs/HEAD &&
+ A=$(git rev-parse A) &&
- echo $one >expect &&
+ echo $A >expect &&
git log -g --format=%H -1 >actual &&
test_cmp expect actual
'
--
gitgitgadget
^ permalink raw reply related
* [PATCH 02/12] remove REFFILES prerequisite
From: John Cai via GitGitGadget @ 2024-01-17 19:52 UTC (permalink / raw)
To: git; +Cc: John Cai, John Cai
In-Reply-To: <pull.1647.git.git.1705521155.gitgitgadget@gmail.com>
From: John Cai <johncai86@gmail.com>
These tests are compatible with the reftable backend and thus do not
need the REFFILES prerequisite.
Signed-off-by: John Cai <johncai86@gmail.com>
---
t/t1405-main-ref-store.sh | 2 +-
t/t2017-checkout-orphan.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh
index e4627cf1b61..62c1eadb190 100755
--- a/t/t1405-main-ref-store.sh
+++ b/t/t1405-main-ref-store.sh
@@ -112,7 +112,7 @@ test_expect_success 'delete_reflog(HEAD)' '
test_must_fail git reflog exists HEAD
'
-test_expect_success REFFILES 'create-reflog(HEAD)' '
+test_expect_success 'create-reflog(HEAD)' '
$RUN create-reflog HEAD &&
git reflog exists HEAD
'
diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index 947d1587ac8..a5c7358eeab 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -86,7 +86,7 @@ test_expect_success '--orphan makes reflog by default' '
git rev-parse --verify delta@{0}
'
-test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '
+test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
git checkout main &&
git config core.logAllRefUpdates false &&
git checkout --orphan epsilon &&
--
gitgitgadget
^ permalink raw reply related
* [PATCH 01/12] t3210: move to t0602
From: John Cai via GitGitGadget @ 2024-01-17 19:52 UTC (permalink / raw)
To: git; +Cc: John Cai, John Cai
In-Reply-To: <pull.1647.git.git.1705521155.gitgitgadget@gmail.com>
From: John Cai <johncai86@gmail.com>
Move t3210 to t0602, since these tests are reffiles specific in that
they modify loose refs manually. This is part of the effort to
categorize these tests together based on the ref backend they test. When
we upstream the reftable backend, we can add more tests to t06xx. This
way, all tests that test specific ref backend behavior will be grouped
together.
Signed-off-by: John Cai <johncai86@gmail.com>
---
t/{t3210-pack-refs.sh => t0602-reffiles-pack-refs.sh} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename t/{t3210-pack-refs.sh => t0602-reffiles-pack-refs.sh} (100%)
diff --git a/t/t3210-pack-refs.sh b/t/t0602-reffiles-pack-refs.sh
similarity index 100%
rename from t/t3210-pack-refs.sh
rename to t/t0602-reffiles-pack-refs.sh
--
gitgitgadget
^ permalink raw reply
* [PATCH 00/12] Group reffiles tests
From: John Cai via GitGitGadget @ 2024-01-17 19:52 UTC (permalink / raw)
To: git; +Cc: John Cai
This series groups REFFILES specific tests together. These tests are
currently grouped together across the test suite based on functionality.
However, since they exercise low-level behavior specific to the refs backend
being used (in these cases, the ref-files backend), group them together
based on which refs backend they test. This way, in the near future when the
reftables backend gets upstreamed we can add tests that exercise the
reftables backend close by in the t06xx area.
These patches also remove the REFFILES prerequisite, since all the tests in
t06xx are reffiles specific. In the near future, once the reftable backend
is upstreamed, all the tests in t06xx will be forced to run with the
reffiles backend.
John Cai (12):
t3210: move to t0602
remove REFFILES prerequisite
t1414: convert test to use Git commands instead of writing refs
manually
t1404: move reffiles specific tests to t0600
t1405: move reffiles specific tests to t0600
t1406: move reffiles specific tests to t0600
t1410: move reffiles specific tests to t0600
t1415: move reffiles specific tests to t0600
t1503: move reffiles specific tests to t0600
t3903: move reffiles specific tests to t0600
t4202: move reffiles specific tests to t0600
t5312: move reffiles specific tests to t0600
t/t0600-reffiles-backend.sh | 604 ++++++++++++++++++
...ck-refs.sh => t0602-reffiles-pack-refs.sh} | 0
t/t1404-update-ref-errors.sh | 378 -----------
t/t1405-main-ref-store.sh | 10 +-
t/t1407-worktree-ref-store.sh | 37 --
t/t1410-reflog.sh | 42 --
t/t1414-reflog-walk.sh | 11 +-
t/t1415-worktree-refs.sh | 11 -
t/t1503-rev-parse-verify.sh | 5 -
t/t2017-checkout-orphan.sh | 2 +-
t/t3903-stash.sh | 43 --
t/t4202-log.sh | 17 -
t/t5312-prune-corruption.sh | 26 -
t/test-lib-functions.sh | 16 +
14 files changed, 628 insertions(+), 574 deletions(-)
create mode 100755 t/t0600-reffiles-backend.sh
rename t/{t3210-pack-refs.sh => t0602-reffiles-pack-refs.sh} (100%)
base-commit: 186b115d3062e6230ee296d1ddaa0c4b72a464b5
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1647%2Fjohn-cai%2Fjc%2Fgroup-reffiles-tests-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1647/john-cai/jc/group-reffiles-tests-v1
Pull-Request: https://github.com/git/git/pull/1647
--
gitgitgadget
^ permalink raw reply
* Re: Full disclosure
From: Junio C Hamano @ 2024-01-17 18:33 UTC (permalink / raw)
To: Michael Lohmann; +Cc: git, j6t, newren, phillip.wood123
In-Reply-To: <20240117091905.14354-1-mi.al.lohmann@gmail.com>
Michael Lohmann <mi.al.lohmann@gmail.com> writes:
> Just as a disclosure: I was told that my contributions are not welcome [1]
> (even though I have to say that I don't fully agree with the reasoning), but I
> did not want to leave these patches alone.
Rereading the message I agree that the message came out in a wrong
way that I did not intend. It is sure that I do not want to see
certain attitude and behaviour in the patches in our contributors,
but that is totally different from "contribution from a specific
contributor is not welcome". The phrasing was making of my
incompetence in communication skills, not from malice.
So I am sorry that I wrote something that it is fair to read as
saying "you are unwelcome". I didn't mean it that way.
^ permalink raw reply
* Full disclosure
From: Michael Lohmann @ 2024-01-17 17:41 UTC (permalink / raw)
To: christian.couder
Cc: git, gitster, j6t, mi.al.lohmann, newren, phillip.wood123
In-Reply-To: <CAP8UFD3g_N+JJ_cdas2ZdsBPxuQFBXW8yY+1nC6AKvQppOYaDw@mail.gmail.com>
Hi Christian!
Yes: I agree that the current state of the last submitted patch in that
discussion is far from optimal.
After Jeff Kings explanation I had a much better understanding for the
situation and the reasoning (and his suggestion was definitely better than
mine).
I had already prepared a new version which tackled (I think) pretty much all of
the criticisms. But then the above mentioned message came in and when I read
this:
> [...] they are trying to be different for the sake of being different, which
> is not a good sign. I'd want our contributors to be original where being
> original matters more.
I am reading:
1) I am "trying to be different for the sake of being different"
2) Contributors like this are not wanted
So yes, I do understand this as a general statement on me as a contributor
without any proposal for me at least to explain the situation from my side.
I teach my colleges not to name variables with how they are initialized, but
with what information they actually convey and I found the "_NONE" one at least
misleading in its name.
So in the initial discussion I was a bit stubborn, because Philip wrote "I
don't have a strong opinion" and from my perspective the only argument was
"over there we also do it that way" (which _can_ 100% be a valid reason), but
Junio C Hamano did not even acknowledge my criticisms of the other the variable
name. I am totally fine with a decision like this if done consciously, but if I
don't even get an acknowledgement, let alone an explanation, my demands I place
on my code quality are that I write the best code I can. And with all the info
I had (prior to Jeffs message) I did still favour my first suggestion.
In my eyes it would be helpful to at least tell me what your (in my eyes not
obvious) preferences are on naming things, because otherwise I will rather
stick to my standards than blindly follow a single instance of other code where
I don't even know if that was a concious decision or it just happened by
accident.
So no, I don't agree with the assessment of point 1), but I still read the
message like that. I will accept it and instead use my skills in different
projects where they are indeed valued.
Cheers
Michael
^ permalink raw reply
* [PATCH v6 2/2] t7501: add tests for --amend --signoff
From: Ghanshyam Thakkar @ 2024-01-17 16:13 UTC (permalink / raw)
To: git; +Cc: gitster, phillip.wood123, christian.couder, Ghanshyam Thakkar
In-Reply-To: <20240117161421.17333-1-shyamthakkar001@gmail.com>
Add tests for amending the commit to add Signed-off-by trailer. And
also to check if it does not add another trailer if one already exists.
Currently, there are tests for --signoff separately in t7501, however,
they are not tested with --amend.
Therefore, these tests belong with other similar tests of --amend in
t7501-commit-basic-functionality.
Helped-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
---
t/t7501-commit-basic-functionality.sh | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index c169f10458..bced44a0fc 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -3,8 +3,7 @@
# Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
#
-# FIXME: Test the various index usages, test reflog,
-# signoff
+# FIXME: Test the various index usages, test reflog
test_description='git commit'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
@@ -462,6 +461,28 @@ test_expect_success 'amend commit to fix date' '
'
+test_expect_success 'amend commit to add signoff' '
+
+ test_commit "msg" file content &&
+ git commit --amend --signoff &&
+ test_commit_message HEAD <<-EOF
+ msg
+
+ Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
+ EOF
+'
+
+test_expect_success 'amend does not add signoff if it already exists' '
+
+ test_commit --signoff "tenor" file newcontent &&
+ git commit --amend --signoff &&
+ test_commit_message HEAD <<-EOF
+ tenor
+
+ Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>
+ EOF
+'
+
test_expect_success 'commit mentions forced date in output' '
git commit --amend --date=2010-01-02T03:04:05 >output &&
grep "Date: *Sat Jan 2 03:04:05 2010" output
--
2.43.0
^ permalink raw reply related
* [PATCH v6 1/2] t7501: add tests for --include and --only
From: Ghanshyam Thakkar @ 2024-01-17 16:13 UTC (permalink / raw)
To: git; +Cc: gitster, phillip.wood123, christian.couder, Ghanshyam Thakkar
In-Reply-To: <20240117161421.17333-1-shyamthakkar001@gmail.com>
Add tests for --only (-o) and --include (-i). This include testing
with or without staged changes for both -i and -o. Also to test
for committing untracked files with -i, -o and without -i/-o.
Some tests already exist in t7501 for testing --only, however,
it is only tested in combination with --amend and --allow-empty
and on to-be-born branch. The addition of these tests check, when
the pathspec is provided without using -only, that only the files
matching the pathspec get committed. This behavior is same when
we provide --only and it is checked by the tests.
(as --only is the default mode of operation when pathspec is
provided.)
As for --include, there is no prior test for checking if --include
also commits staged changes, thus add test for that. Along with
the tests also document a potential bug, in which, when provided
with -i and a pathspec that does not match any tracked path,
commit does not fail if there are staged changes. And when there
are no staged changes commit fails. However, no error is returned
to stderr in either of the cases. This is described in the TODO
comment before the relevent testcase.
And also add a test for checking incompatibilty when using -o and
-i together.
Thus, these tests belong in t7501 with other similar existing tests,
as described in the case of --only.
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
---
t/t7501-commit-basic-functionality.sh | 75 ++++++++++++++++++++++++++-
1 file changed, 74 insertions(+), 1 deletion(-)
diff --git a/t/t7501-commit-basic-functionality.sh b/t/t7501-commit-basic-functionality.sh
index 3d8500a52e..c169f10458 100755
--- a/t/t7501-commit-basic-functionality.sh
+++ b/t/t7501-commit-basic-functionality.sh
@@ -3,7 +3,7 @@
# Copyright (c) 2007 Kristian Høgsberg <krh@redhat.com>
#
-# FIXME: Test the various index usages, -i and -o, test reflog,
+# FIXME: Test the various index usages, test reflog,
# signoff
test_description='git commit'
@@ -92,6 +92,34 @@ test_expect_success '--long fails with nothing to commit' '
test_must_fail git commit -m initial --long
'
+test_expect_success 'fail to commit untracked file (even with --include/--only)' '
+ echo content >baz &&
+ error="error: pathspec .baz. did not match any file(s) known to git" &&
+
+ test_must_fail git commit -m "baz" baz 2>err &&
+ test_grep -e "$error" err &&
+
+ test_must_fail git commit --only -m "baz" baz 2>err &&
+ test_grep -e "$error" err &&
+
+ # TODO: as for --include, the below command will fail because
+ # nothing is staged. If something was staged, it would not fail
+ # even though the provided pathspec does not match any tracked
+ # path. (However, the untracked paths that match the pathspec are
+ # not committed and only the staged changes get committed.)
+ # In either cases, no error is returned to stderr like in (--only
+ # and without --only/--include) cases. In a similar manner,
+ # "git add -u baz" also does not error out.
+ #
+ # Therefore, the below test is just to document the current behavior
+ # and is not an endorsement to the current behavior, and we may
+ # want to fix this. And when that happens, this test should be
+ # updated accordingly.
+
+ test_must_fail git commit --include -m "baz" baz 2>err &&
+ test_must_be_empty err
+'
+
test_expect_success 'setup: non-initial commit' '
echo bongo bongo bongo >file &&
git commit -m next -a
@@ -117,6 +145,51 @@ test_expect_success '--long with stuff to commit returns ok' '
git commit -m next -a --long
'
+for opt in "" "-o" "--only"
+do
+ test_expect_success 'exclude additional staged changes when given pathspec' '
+ echo content >>file &&
+ echo content >>baz &&
+ git add baz &&
+ git commit $opt -m "file" file &&
+
+ git diff --name-only >actual &&
+ test_must_be_empty actual &&
+
+ test_write_lines baz >expect &&
+ git diff --name-only --cached >actual &&
+ test_cmp expect actual &&
+
+ test_write_lines file >expect &&
+ git diff --name-only HEAD^ HEAD >actual &&
+ test_cmp expect actual
+ '
+done
+
+test_expect_success '-i/--include includes staged changes' '
+ echo content >>file &&
+ echo content >>baz &&
+ git add file &&
+
+ # baz is in the index, therefore, it will be committed
+ git commit --include -m "file and baz" baz &&
+
+ git diff --name-only HEAD >remaining &&
+ test_must_be_empty remaining &&
+
+ test_write_lines baz file >expect &&
+ git diff --name-only HEAD^ HEAD >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success '--include and --only do not mix' '
+ test_when_finished "git reset --hard" &&
+ echo content >>file &&
+ echo content >>baz &&
+ test_must_fail git commit --include --only -m "file baz" file baz 2>actual &&
+ test_grep -e "fatal: options .-i/--include. and .-o/--only. cannot be used together" actual
+'
+
test_expect_success 'commit message from non-existing file' '
echo more bongo: bongo bongo bongo bongo >file &&
test_must_fail git commit -F gah -a
--
2.43.0
^ permalink raw reply related
* [PATCH v6 0/2] t7501: add tests for --include, --only, --signoff
From: Ghanshyam Thakkar @ 2024-01-17 16:13 UTC (permalink / raw)
To: git; +Cc: gitster, phillip.wood123, christian.couder, Ghanshyam Thakkar
In-Reply-To: <20240113042254.38602-1-shyamthakkar001@gmail.com>
The v6 addresses the comments from Junio, which suggested to improve the
TODO comment describing the potential bug for --include. Also, replace
here-doc with expected output file for better debugging, as suggested by
Junio.
--signoff tests remain unchanged.
Ghanshyam Thakkar (2):
t7501: add tests for --include and --only
t7501: add tests for --amend --signoff
t/t7501-commit-basic-functionality.sh | 98 ++++++++++++++++++++++++++-
1 file changed, 96 insertions(+), 2 deletions(-)
--
2.43.0
^ permalink raw reply
* [PATCH v3] tests: move t0009-prio-queue.sh to the new unit testing framework
From: Chandra Pratap via GitGitGadget @ 2024-01-17 14:38 UTC (permalink / raw)
To: git; +Cc: Chandra Pratap, Chandra Pratap, Chandra Pratap
In-Reply-To: <pull.1642.v2.git.1705220304781.gitgitgadget@gmail.com>
From: Chandra Pratap <chandrapratap3519@gmail.com>
t/t0009-prio-queue.sh along with t/helper/test-prio-queue.c unit
tests Git's implementation of a priority queue. Migrate the
test over to the new unit testing framework to simplify debugging
and reduce test run-time. Refactor the required logic and add
a new test case in addition to porting over the original ones in
shell.
Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
---
tests: move t0009-prio-queue.sh to the new unit testing framework
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1642%2FChand-ra%2Fprio-queue-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1642/Chand-ra/prio-queue-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/1642
Range-diff vs v2:
1: 60ac9b3c259 ! 1: 6b10028177a tests: move t0009-prio-queue.sh to the new unit testing framework
@@ t/unit-tests/t-prio-queue.c (new)
+ return *a - *b;
+}
+
++
++#define MISSING -1
++#define DUMP -2
++#define STACK -3
++#define GET -4
++#define REVERSE -5
++
+static int show(int *v)
+{
-+ int ret = -1;
-+ if (v)
-+ ret = *v;
-+ free(v);
-+ return ret;
++ return v ? *v : MISSING;
+}
+
-+static int test_prio_queue(const char **input, int *result)
++static int test_prio_queue(int *input, int *result)
+{
+ struct prio_queue pq = { intcmp };
+ int i = 0;
+
+ while (*input) {
-+ if (!strcmp(*input, "get")) {
-+ void *peek = prio_queue_peek(&pq);
-+ void *get = prio_queue_get(&pq);
-+ if (peek != get)
-+ BUG("peek and get results do not match");
-+ result[i++] = show(get);
-+ } else if (!strcmp(*input, "dump")) {
-+ void *peek;
-+ void *get;
-+ while ((peek = prio_queue_peek(&pq))) {
++ int *val = input++;
++ void *peek, *get;
++ switch(*val) {
++ case GET:
++ peek = prio_queue_peek(&pq);
+ get = prio_queue_get(&pq);
+ if (peek != get)
-+ BUG("peek and get results do not match");
++ BUG("peek and get results don't match");
+ result[i++] = show(get);
-+ }
-+ } else if (!strcmp(*input, "stack")) {
-+ pq.compare = NULL;
-+ } else if (!strcmp(*input, "reverse")) {
-+ prio_queue_reverse(&pq);
-+ } else {
-+ int *v = xmalloc(sizeof(*v));
-+ *v = atoi(*input);
-+ prio_queue_put(&pq, v);
++ break;
++ case DUMP:
++ while ((peek = prio_queue_peek(&pq))) {
++ get = prio_queue_get(&pq);
++ if (peek != get)
++ BUG("peek and get results don't match");
++ result[i++] = show(get);
++ }
++ break;
++ case STACK:
++ pq.compare = NULL;
++ break;
++ case REVERSE:
++ prio_queue_reverse(&pq);
++ break;
++ default:
++ prio_queue_put(&pq, val);
++ break;
+ }
-+ input++;
+ }
-+
+ clear_prio_queue(&pq);
-+
+ return 0;
+}
+
-+#define INPUT_SIZE 6
-+
-+#define BASIC_INPUT "1", "2", "3", "4", "5", "5", "dump"
++#define BASIC_INPUT 1, 2, 3, 4, 5, 5, DUMP
+#define BASIC_EXPECTED 1, 2, 3, 4, 5, 5
+
-+#define MIXED_PUT_GET_INPUT "6", "2", "4", "get", "5", "3", "get", "get", "1", "dump"
++#define MIXED_PUT_GET_INPUT 6, 2, 4, GET, 5, 3, GET, GET, 1, DUMP
+#define MIXED_PUT_GET_EXPECTED 2, 3, 4, 1, 5, 6
+
-+#define EMPTY_QUEUE_INPUT "1", "2", "get", "get", "get", "1", "2", "get", "get", "get"
-+#define EMPTY_QUEUE_EXPECTED 1, 2, -1, 1, 2, -1
++#define EMPTY_QUEUE_INPUT 1, 2, GET, GET, GET, 1, 2, GET, GET, GET
++#define EMPTY_QUEUE_EXPECTED 1, 2, MISSING, 1, 2, MISSING
+
-+#define STACK_INPUT "stack", "1", "5", "4", "6", "2", "3", "dump"
++#define STACK_INPUT STACK, 1, 5, 4, 6, 2, 3, DUMP
+#define STACK_EXPECTED 3, 2, 6, 4, 5, 1
+
-+#define REVERSE_STACK_INPUT "stack", "1", "2", "3", "4", "5", "6", "reverse", "dump"
++#define REVERSE_STACK_INPUT STACK, 1, 2, 3, 4, 5, 6, REVERSE, DUMP
+#define REVERSE_STACK_EXPECTED 1, 2, 3, 4, 5, 6
+
+#define TEST_INPUT(INPUT, EXPECTED, name) \
-+ static void test_##name(void) \
++ static void test_##name(void) \
+{ \
-+ const char *input[] = {INPUT}; \
++ int input[] = {INPUT}; \
+ int expected[] = {EXPECTED}; \
-+ int result[INPUT_SIZE]; \
++ int result[ARRAY_SIZE(expected)]; \
+ test_prio_queue(input, result); \
+ check(!memcmp(expected, result, sizeof(expected))); \
+}
Makefile | 2 +-
t/helper/test-prio-queue.c | 51 ------------------
t/helper/test-tool.c | 1 -
t/helper/test-tool.h | 1 -
t/t0009-prio-queue.sh | 66 -----------------------
t/unit-tests/t-prio-queue.c | 101 ++++++++++++++++++++++++++++++++++++
6 files changed, 102 insertions(+), 120 deletions(-)
delete mode 100644 t/helper/test-prio-queue.c
delete mode 100755 t/t0009-prio-queue.sh
create mode 100644 t/unit-tests/t-prio-queue.c
diff --git a/Makefile b/Makefile
index 312d95084c1..d5e48e656b3 100644
--- a/Makefile
+++ b/Makefile
@@ -828,7 +828,6 @@ TEST_BUILTINS_OBJS += test-partial-clone.o
TEST_BUILTINS_OBJS += test-path-utils.o
TEST_BUILTINS_OBJS += test-pcre2-config.o
TEST_BUILTINS_OBJS += test-pkt-line.o
-TEST_BUILTINS_OBJS += test-prio-queue.o
TEST_BUILTINS_OBJS += test-proc-receive.o
TEST_BUILTINS_OBJS += test-progress.o
TEST_BUILTINS_OBJS += test-reach.o
@@ -1340,6 +1339,7 @@ THIRD_PARTY_SOURCES += sha1dc/%
UNIT_TEST_PROGRAMS += t-basic
UNIT_TEST_PROGRAMS += t-strbuf
+UNIT_TEST_PROGRAMS += t-prio-queue
UNIT_TEST_PROGS = $(patsubst %,$(UNIT_TEST_BIN)/%$X,$(UNIT_TEST_PROGRAMS))
UNIT_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))
UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c
deleted file mode 100644
index f0bf255f5f0..00000000000
--- a/t/helper/test-prio-queue.c
+++ /dev/null
@@ -1,51 +0,0 @@
-#include "test-tool.h"
-#include "prio-queue.h"
-
-static int intcmp(const void *va, const void *vb, void *data UNUSED)
-{
- const int *a = va, *b = vb;
- return *a - *b;
-}
-
-static void show(int *v)
-{
- if (!v)
- printf("NULL\n");
- else
- printf("%d\n", *v);
- free(v);
-}
-
-int cmd__prio_queue(int argc UNUSED, const char **argv)
-{
- struct prio_queue pq = { intcmp };
-
- while (*++argv) {
- if (!strcmp(*argv, "get")) {
- void *peek = prio_queue_peek(&pq);
- void *get = prio_queue_get(&pq);
- if (peek != get)
- BUG("peek and get results do not match");
- show(get);
- } else if (!strcmp(*argv, "dump")) {
- void *peek;
- void *get;
- while ((peek = prio_queue_peek(&pq))) {
- get = prio_queue_get(&pq);
- if (peek != get)
- BUG("peek and get results do not match");
- show(get);
- }
- } else if (!strcmp(*argv, "stack")) {
- pq.compare = NULL;
- } else {
- int *v = xmalloc(sizeof(*v));
- *v = atoi(*argv);
- prio_queue_put(&pq, v);
- }
- }
-
- clear_prio_queue(&pq);
-
- return 0;
-}
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index 876cd2dc313..5f591b9718f 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -57,7 +57,6 @@ static struct test_cmd cmds[] = {
{ "path-utils", cmd__path_utils },
{ "pcre2-config", cmd__pcre2_config },
{ "pkt-line", cmd__pkt_line },
- { "prio-queue", cmd__prio_queue },
{ "proc-receive", cmd__proc_receive },
{ "progress", cmd__progress },
{ "reach", cmd__reach },
diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
index 70dd4eba119..b921138d8ec 100644
--- a/t/helper/test-tool.h
+++ b/t/helper/test-tool.h
@@ -50,7 +50,6 @@ int cmd__partial_clone(int argc, const char **argv);
int cmd__path_utils(int argc, const char **argv);
int cmd__pcre2_config(int argc, const char **argv);
int cmd__pkt_line(int argc, const char **argv);
-int cmd__prio_queue(int argc, const char **argv);
int cmd__proc_receive(int argc, const char **argv);
int cmd__progress(int argc, const char **argv);
int cmd__reach(int argc, const char **argv);
diff --git a/t/t0009-prio-queue.sh b/t/t0009-prio-queue.sh
deleted file mode 100755
index eea99107a48..00000000000
--- a/t/t0009-prio-queue.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-test_description='basic tests for priority queue implementation'
-
-TEST_PASSES_SANITIZE_LEAK=true
-. ./test-lib.sh
-
-cat >expect <<'EOF'
-1
-2
-3
-4
-5
-5
-6
-7
-8
-9
-10
-EOF
-test_expect_success 'basic ordering' '
- test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
- test_cmp expect actual
-'
-
-cat >expect <<'EOF'
-2
-3
-4
-1
-5
-6
-EOF
-test_expect_success 'mixed put and get' '
- test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
- test_cmp expect actual
-'
-
-cat >expect <<'EOF'
-1
-2
-NULL
-1
-2
-NULL
-EOF
-test_expect_success 'notice empty queue' '
- test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
- test_cmp expect actual
-'
-
-cat >expect <<'EOF'
-3
-2
-6
-4
-5
-1
-8
-EOF
-test_expect_success 'stack order' '
- test-tool prio-queue stack 8 1 5 4 6 2 3 dump >actual &&
- test_cmp expect actual
-'
-
-test_done
diff --git a/t/unit-tests/t-prio-queue.c b/t/unit-tests/t-prio-queue.c
new file mode 100644
index 00000000000..0b826b463e9
--- /dev/null
+++ b/t/unit-tests/t-prio-queue.c
@@ -0,0 +1,101 @@
+#include "test-lib.h"
+#include "prio-queue.h"
+
+static int intcmp(const void *va, const void *vb, void *data UNUSED)
+{
+ const int *a = va, *b = vb;
+ return *a - *b;
+}
+
+
+#define MISSING -1
+#define DUMP -2
+#define STACK -3
+#define GET -4
+#define REVERSE -5
+
+static int show(int *v)
+{
+ return v ? *v : MISSING;
+}
+
+static int test_prio_queue(int *input, int *result)
+{
+ struct prio_queue pq = { intcmp };
+ int i = 0;
+
+ while (*input) {
+ int *val = input++;
+ void *peek, *get;
+ switch(*val) {
+ case GET:
+ peek = prio_queue_peek(&pq);
+ get = prio_queue_get(&pq);
+ if (peek != get)
+ BUG("peek and get results don't match");
+ result[i++] = show(get);
+ break;
+ case DUMP:
+ while ((peek = prio_queue_peek(&pq))) {
+ get = prio_queue_get(&pq);
+ if (peek != get)
+ BUG("peek and get results don't match");
+ result[i++] = show(get);
+ }
+ break;
+ case STACK:
+ pq.compare = NULL;
+ break;
+ case REVERSE:
+ prio_queue_reverse(&pq);
+ break;
+ default:
+ prio_queue_put(&pq, val);
+ break;
+ }
+ }
+ clear_prio_queue(&pq);
+ return 0;
+}
+
+#define BASIC_INPUT 1, 2, 3, 4, 5, 5, DUMP
+#define BASIC_EXPECTED 1, 2, 3, 4, 5, 5
+
+#define MIXED_PUT_GET_INPUT 6, 2, 4, GET, 5, 3, GET, GET, 1, DUMP
+#define MIXED_PUT_GET_EXPECTED 2, 3, 4, 1, 5, 6
+
+#define EMPTY_QUEUE_INPUT 1, 2, GET, GET, GET, 1, 2, GET, GET, GET
+#define EMPTY_QUEUE_EXPECTED 1, 2, MISSING, 1, 2, MISSING
+
+#define STACK_INPUT STACK, 1, 5, 4, 6, 2, 3, DUMP
+#define STACK_EXPECTED 3, 2, 6, 4, 5, 1
+
+#define REVERSE_STACK_INPUT STACK, 1, 2, 3, 4, 5, 6, REVERSE, DUMP
+#define REVERSE_STACK_EXPECTED 1, 2, 3, 4, 5, 6
+
+#define TEST_INPUT(INPUT, EXPECTED, name) \
+ static void test_##name(void) \
+{ \
+ int input[] = {INPUT}; \
+ int expected[] = {EXPECTED}; \
+ int result[ARRAY_SIZE(expected)]; \
+ test_prio_queue(input, result); \
+ check(!memcmp(expected, result, sizeof(expected))); \
+}
+
+TEST_INPUT(BASIC_INPUT, BASIC_EXPECTED, basic)
+TEST_INPUT(MIXED_PUT_GET_INPUT, MIXED_PUT_GET_EXPECTED, mixed)
+TEST_INPUT(EMPTY_QUEUE_INPUT, EMPTY_QUEUE_EXPECTED, empty)
+TEST_INPUT(STACK_INPUT, STACK_EXPECTED, stack)
+TEST_INPUT(REVERSE_STACK_INPUT, REVERSE_STACK_EXPECTED, reverse)
+
+int cmd_main(int argc, const char **argv)
+{
+ TEST(test_basic(), "prio-queue works for basic input");
+ TEST(test_mixed(), "prio-queue works for mixed put & get commands");
+ TEST(test_empty(), "prio-queue works when queue is empty");
+ TEST(test_stack(), "prio-queue works when used as a LIFO stack");
+ TEST(test_reverse(), "prio-queue works when LIFO stack is reversed");
+
+ return test_done();
+}
base-commit: 1a87c842ece327d03d08096395969aca5e0a6996
--
gitgitgadget
^ permalink raw reply related
* Re: Full disclosure
From: Christian Couder @ 2024-01-17 9:58 UTC (permalink / raw)
To: Michael Lohmann; +Cc: git, gitster, j6t, newren, phillip.wood123
In-Reply-To: <20240117091905.14354-1-mi.al.lohmann@gmail.com>
On Wed, Jan 17, 2024 at 10:20 AM Michael Lohmann
<mi.al.lohmann@gmail.com> wrote:
>
> Just as a disclosure: I was told that my contributions are not welcome [1]
> (even though I have to say that I don't fully agree with the reasoning), but I
> did not want to leave these patches alone.
I might have missed something, but as far as I see in the email you
mention, you weren't told that your contributions are not welcome.
Junio reviewed your patch and agreed with some of Peff's comments
about your patch. It just means that they both think your patch could
be further improved. They didn't reject your patch, nor your
contributions in general.
> @Junio C Hamano: Please take this into account when deciding if you want to
> accept the patches. This is just for transparancy and I will not do any more
> contributions than potentially finishing this one. If you do not want these
> patches from me, but it was still deemed to be an interesting feature: could
> someone else take over?
>
> Michael
>
> [1]: https://lore.kernel.org/git/xmqqil3ybets.fsf@gitster.g/
>
^ permalink raw reply
* Full disclosure
From: Michael Lohmann @ 2024-01-17 9:19 UTC (permalink / raw)
To: mi.al.lohmann; +Cc: git, gitster, j6t, newren, phillip.wood123
In-Reply-To: <20240117081405.14012-2-mi.al.lohmann@gmail.com>
Just as a disclosure: I was told that my contributions are not welcome [1]
(even though I have to say that I don't fully agree with the reasoning), but I
did not want to leave these patches alone.
@Junio C Hamano: Please take this into account when deciding if you want to
accept the patches. This is just for transparancy and I will not do any more
contributions than potentially finishing this one. If you do not want these
patches from me, but it was still deemed to be an interesting feature: could
someone else take over?
Michael
[1]: https://lore.kernel.org/git/xmqqil3ybets.fsf@gitster.g/
^ permalink raw reply
* [PATCH v2] rebase: Fix documentation about used shell in -x
From: Nikolay Borisov @ 2024-01-17 8:53 UTC (permalink / raw)
To: git; +Cc: Nikolay Borisov
The shell used when using the -x option is erroneously documented to be
the one pointed to by the $SHELL environmental variable. This was true
when rebase was implemented as a shell script but this is no longer
true.
Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
---
Documentation/git-rebase.txt | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 25516c45d8b8..2cd55aedc0f9 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -963,10 +963,9 @@ The interactive rebase will stop when a command fails (i.e. exits with
non-0 status) to give you an opportunity to fix the problem. You can
continue with `git rebase --continue`.
-The "exec" command launches the command in a shell (the one specified
-in `$SHELL`, or the default shell if `$SHELL` is not set), so you can
-use shell features (like "cd", ">", ";" ...). The command is run from
-the root of the working tree.
+The "exec" command launches the command in a shell (the default one, usually
+/bin/sh), so you can use shell features (like "cd", ">", ";" ...). The command
+is run from the root of the working tree.
----------------------------------
$ git rebase -i --exec "make test"
--
2.34.1
^ permalink raw reply related
* [PATCH v3 2/2] revision: Implement `git log --merge` also for rebase/cherry_pick/revert
From: Michael Lohmann @ 2024-01-17 8:14 UTC (permalink / raw)
To: gitster; +Cc: git, mi.al.lohmann, newren, phillip.wood123, Johannes Sixt
In-Reply-To: <20240117081405.14012-1-mi.al.lohmann@gmail.com>
Co-authored-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Michael Lohmann <mi.al.lohmann@gmail.com>
---
On 12. Jan 2024, at 21:18, Junio C Hamano <gitster@pobox.com> wrote:
> I like the way your other_merge_candidate() loops over an array of
> possible candidates, which makes it a lot easier to extend, though,
> admittedly the "die()" message needs auto-generating if we really
> wanted to make it maintenance free ;-)
I would certainly like that but I did not find an easy way of achieving
this in C. Help wanted.
Changes with respect to v2:
- use read_ref_full instead of refs_resolve_ref_unsafe
- check for symbolic ref
- extract "other_name" in this patch, instead of patch 1
revision.c | 31 +++++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/revision.c b/revision.c
index aa4c4dc778..c778413c7d 100644
--- a/revision.c
+++ b/revision.c
@@ -1961,11 +1961,31 @@ static void add_pending_commit_list(struct rev_info *revs,
}
}
+static const char *lookup_other_head(struct object_id *oid)
+{
+ int i;
+ static const char *const other_head[] = {
+ "MERGE_HEAD", "REBASE_HEAD", "CHERRY_PICK_HEAD", "REVERT_HEAD"
+ };
+
+ for (i = 0; i < ARRAY_SIZE(other_head); i++)
+ if (!read_ref_full(other_head[i],
+ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ oid, NULL)) {
+ if (is_null_oid(oid))
+ die("%s is a symbolic ref???", other_head[i]);
+ return other_head[i];
+ }
+
+ die("--merge without MERGE_HEAD, REBASE_HEAD, CHERRY_PICK_HEAD or REVERT_HEAD?");
+}
+
static void prepare_show_merge(struct rev_info *revs)
{
struct commit_list *bases;
struct commit *head, *other;
struct object_id oid;
+ const char *other_name;
const char **prune = NULL;
int i, prune_num = 1; /* counting terminating NULL */
struct index_state *istate = revs->repo->index;
@@ -1973,15 +1993,10 @@ static void prepare_show_merge(struct rev_info *revs)
if (repo_get_oid(the_repository, "HEAD", &oid))
die("--merge without HEAD?");
head = lookup_commit_or_die(&oid, "HEAD");
- if (read_ref_full("MERGE_HEAD",
- RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
- &oid, NULL))
- die("--merge without MERGE_HEAD?");
- if (is_null_oid(&oid))
- die("MERGE_HEAD is a symbolic ref???");
- other = lookup_commit_or_die(&oid, "MERGE_HEAD");
+ other_name = lookup_other_head(&oid);
+ other = lookup_commit_or_die(&oid, other_name);
add_pending_object(revs, &head->object, "HEAD");
- add_pending_object(revs, &other->object, "MERGE_HEAD");
+ add_pending_object(revs, &other->object, other_name);
bases = repo_get_merge_bases(the_repository, head, other);
add_rev_cmdline_list(revs, bases, REV_CMD_MERGE_BASE, UNINTERESTING | BOTTOM);
add_pending_commit_list(revs, bases, UNINTERESTING | BOTTOM);
--
2.39.3 (Apple Git-145)
^ permalink raw reply related
* [PATCH v3 1/2] revision: ensure MERGE_HEAD is a ref in prepare_show_merge
From: Michael Lohmann @ 2024-01-17 8:14 UTC (permalink / raw)
To: gitster; +Cc: git, mi.al.lohmann, newren, phillip.wood123
In-Reply-To: <xmqqzfxa9usx.fsf@gitster.g>
This is done to
(1) ensure MERGE_HEAD is a ref,
(2) obtain the oid without any prefixing by refs.c:repo_dwim_ref()
(3) error out when MERGE_HEAD is a symref.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Michael Lohmann <mi.al.lohmann@gmail.com>
---
Changes with respect to v2:
- use read_ref_full instead of refs_resolve_ref_unsafe
- don't use "other_head" variable to store MERGE_HEAD
- check for symbolic ref
revision.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/revision.c b/revision.c
index 2424c9bd67..aa4c4dc778 100644
--- a/revision.c
+++ b/revision.c
@@ -1973,8 +1973,12 @@ static void prepare_show_merge(struct rev_info *revs)
if (repo_get_oid(the_repository, "HEAD", &oid))
die("--merge without HEAD?");
head = lookup_commit_or_die(&oid, "HEAD");
- if (repo_get_oid(the_repository, "MERGE_HEAD", &oid))
+ if (read_ref_full("MERGE_HEAD",
+ RESOLVE_REF_READING | RESOLVE_REF_NO_RECURSE,
+ &oid, NULL))
die("--merge without MERGE_HEAD?");
+ if (is_null_oid(&oid))
+ die("MERGE_HEAD is a symbolic ref???");
other = lookup_commit_or_die(&oid, "MERGE_HEAD");
add_pending_object(revs, &head->object, "HEAD");
add_pending_object(revs, &other->object, "MERGE_HEAD");
--
2.39.3 (Apple Git-145)
^ permalink raw reply related
* Re: [PATCH 3/3] ci: add macOS jobs to GitLab CI
From: Patrick Steinhardt @ 2024-01-17 7:34 UTC (permalink / raw)
To: phillip.wood; +Cc: git
In-Reply-To: <61115e68-3d63-4e08-85f7-ae6650f3724e@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
On Tue, Jan 16, 2024 at 02:58:53PM +0000, Phillip Wood wrote:
> Hi Patrick
>
> On 15/01/2024 11:45, Patrick Steinhardt wrote:
> > Add two macOS-based jobs to GitLab CI, one for Clang and one for GCC.
>
> This doesn't match whats in the rest of the commit message where you explain
> why there is no gcc job. The patch itself looks good to me and it is nice
> that we'll now be testing on arm64 with the GitLab runners.
Oops. In my first iterations I still had an osx-gcc job, but I could not
get it passing due to the architectural difficulties explained in the
message, so I ended up removing it. This sentence is thus a leftover
from previous iterations.
> > This matches equivalent jobs we have for GitHub Workflows, except that
> > we use macOS 14 instead of macOS 13.
> >
> > Note that one test marked as `test_must_fail` is surprisingly passing:
> >
> > t7815-grep-binary.sh (Wstat: 0 Tests: 22 Failed: 0)
> > TODO passed: 12
> >
> > This seems to boil down to an unexpected difference in how regcomp(1)
>
> nit: regcomp(3)?
Indeed, thanks!
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] pack-objects: enable multi-pack reuse via `feature.experimental`
From: Patrick Steinhardt @ 2024-01-17 7:32 UTC (permalink / raw)
To: Taylor Blau; +Cc: git, Jeff King, Junio C Hamano
In-Reply-To: <a2d0af562a5d0a4052c94f87c1d71639ff0b87f2.1705431816.git.me@ttaylorr.com>
[-- Attachment #1: Type: text/plain, Size: 2641 bytes --]
On Tue, Jan 16, 2024 at 02:03:47PM -0500, Taylor Blau wrote:
> Now that multi-pack reuse is supported, enable it via the
> feature.experimental configuration in addition to the classic
> `pack.allowPackReuse`.
>
> This will allow more users to experiment with the new behavior who might
> not otherwise be aware of the existing `pack.allowPackReuse`
> configuration option.
>
> The enum with values NO_PACK_REUSE, SINGLE_PACK_REUSE, and
> MULTI_PACK_REUSE is defined statically in builtin/pack-objects.c's
> compilation unit. We could hoist that enum into a scope visible from the
> repository_settings struct, and then use that enum value in
> pack-objects. Instead, define a single int that indicates what
> pack-objects's default value should be to avoid additional unnecessary
> code movement.
>
> Though `feature.experimental` implies `pack.allowPackReuse=multi`, this
> can still be overridden by explicitly setting the latter configuration
> to either "single" or "false". Tests covering all of these cases are
> showin t5332.
I do not mind adding more configs to `feature.experimental` because it
is the best mechanism we have for a staged rollout of features. It is
not ideal by any means as we have no way to tell how many people enable
this, or whether they hit any bugs. But we do not really have any
alternatives.
But one thing I would like to see is to have a clear plan for how
experimental features become stable. It's not a huge problem (yet)
because there are only two experimental features. One of them
("pack.useBitmapBoundaryTraversal=true") was recently added by you via
b0afdce5da (pack-bitmap.c: use commit boundary during bitmap traversal,
2023-05-08), which is perfectly fine. But the other one
("fetch.negotiationAlgorithm=skipping") has been added has been added
via b5651a2092 (experimental: default to fetch.writeCommitGraph=false,
2020-07-06), so it's been experimental for ~3.5 years by now.
I would like to avoid cases like this by laying out a plan for when
experimental features become the new default. It could be as simple as
"Let's wait N releases and then mark it stable". But having something
and documenting such a plan in our code makes it a lot more actionable
to promote those features to become stable eventually.
I know that this is not in any way specific to your patch, but I thought
this was a good opportunity to start this discussion. If we can agree on
my opinion then it would be great to add a comment to the experimental
feature to explain such an exit criterion.
Other than that this patch looks good to me, thanks!
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] t5332-multi-pack-reuse.sh: extract pack-objects helper functions
From: Patrick Steinhardt @ 2024-01-17 7:32 UTC (permalink / raw)
To: Taylor Blau; +Cc: git, Jeff King, Junio C Hamano
In-Reply-To: <94dd41e1afdd6d926a106ab387295cf5fce624cf.1705431816.git.me@ttaylorr.com>
[-- Attachment #1: Type: text/plain, Size: 2738 bytes --]
On Tue, Jan 16, 2024 at 02:03:44PM -0500, Taylor Blau wrote:
> Most of the tests in t5332 perform some setup before repeating a common
> refrain that looks like:
>
> : >trace2.txt &&
> GIT_TRACE2_EVENT="$PWD/trace2.txt" \
> git pack-objects --stdout --revs --all >/dev/null &&
>
> test_pack_reused $objects_nr <trace2.txt &&
> test_packs_reused $packs_nr <trace2.txt
>
> The next commit will add more tests which repeat the above refrain.
> Avoid duplicating this invocation even further and prepare for the
> following commit by wrapping the above in a helper function called
> `test_pack_objects_reused_all()`.
>
> Introduce another similar function `test_pack_objects_reused`, which
> expects to read a list of revisions over stdin for tests which need more
> fine-grained control of the contents of the pack they generate.
>
> Signed-off-by: Taylor Blau <me@ttaylorr.com>
> ---
> t/t5332-multi-pack-reuse.sh | 70 +++++++++++++++----------------------
> 1 file changed, 28 insertions(+), 42 deletions(-)
>
> diff --git a/t/t5332-multi-pack-reuse.sh b/t/t5332-multi-pack-reuse.sh
> index 2ba788b042..b53e821bc0 100755
> --- a/t/t5332-multi-pack-reuse.sh
> +++ b/t/t5332-multi-pack-reuse.sh
> @@ -23,6 +23,26 @@ pack_position () {
> grep "$1" objects | cut -d" " -f1
> }
>
> +# test_pack_objects_reused_all <pack-reused> <packs-reused>
> +test_pack_objects_reused_all () {
> + : >trace2.txt &&
> + GIT_TRACE2_EVENT="$PWD/trace2.txt" \
> + git pack-objects --stdout --revs --all >/dev/null &&
> +
> + test_pack_reused "$1" <trace2.txt &&
> + test_packs_reused "$2" <trace2.txt
> +}
> +
> +# test_pack_objects_reused <pack-reused> <packs-reused>
> +test_pack_objects_reused () {
> + : >trace2.txt &&
> + GIT_TRACE2_EVENT="$PWD/trace2.txt" \
> + git pack-objects --stdout --revs >/dev/null &&
> +
> + test_pack_reused "$1" <trace2.txt &&
> + test_packs_reused "$2" <trace2.txt
> +}
> +
> test_expect_success 'preferred pack is reused for single-pack reuse' '
> test_config pack.allowPackReuse single &&
>
[snip]
> @@ -104,12 +110,7 @@ test_expect_success 'reuse objects from first pack with middle gap' '
> ^$(git rev-parse D)
> EOF
>
> - : >trace2.txt &&
> - GIT_TRACE2_EVENT="$PWD/trace2.txt" \
> - git pack-objects --stdout --delta-base-offset --revs <in >/dev/null &&
> -
> - test_pack_reused 3 <trace2.txt &&
> - test_packs_reused 1 <trace2.txt
> + test_pack_objects_reused 3 1 <in
This conversion causes us to drop the `--delta-base-offset` flag. It
would be great to have an explanation in the commit message why it is
fine to drop it.
Other than that this looks like a nice simplification to me.
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: Git mirror at gitlab
From: Patrick Steinhardt @ 2024-01-17 6:35 UTC (permalink / raw)
To: Olliver Schinagl
Cc: git, gitster, Ævar Arnfjörð Bjarmason, psteinhardt
In-Reply-To: <ZYQl_G-S4vQibHWn@framework>
[-- Attachment #1: Type: text/plain, Size: 2476 bytes --]
On Thu, Dec 21, 2023 at 12:48:12PM +0100, Patrick Steinhardt wrote:
> On Thu, Dec 21, 2023 at 12:30:02PM +0100, Olliver Schinagl wrote:
> > Hey list,
> >
> > For years, I wanted (tried, but time) to run the mirror for git on gitlab.
> > Actually, the original idea was to run a docker container ([0] 10k+ pulls
> > :p)
> >
> > I initially set this up via docker build containers, where docker hub would
> > pull my mirror of the git repo. My mirror, because I added a Dockerfile
> > which was enough for docker to do its trick. I was planning (time ..) on
> > submitting this upstream to the list, but never did. Because of me not doing
> > that, I had to manually (I was even too lazy to script it) rebase the
> > branch. Docker then did some changes to their business, where the docker
> > builds where not possible anymore.
> >
> > So then I figured, I'll do the same on gitlab and push it to the docker hub.
> > Thus I setup a mirror on gitlab [1], with the idea to work there on it.
> >
> > Again, I never got around to finalize this work, mostly because the docker
> > container 'just worked' for pretty much everything. After all, git is very
> > stable overal.
> >
> > So very interestingly, last month commit 0e3b67e2aa25edb ("ci: add support
> > for GitLab CI") landed, which started to trigger pipeline jobs!
> >
> > Sadly, this only worked for 3 builds, as that's when the minutes ran out :)
> >
> > So one, I would very much like to offer the registered names (cause they are
> > pretty nice in name) to here, so people can use and find it.
>
> Not to throw a wrench into this, but are you aware of the official
> GitLab mirror at https://gitlab.com/git-vcs/git? I myself wasn't aware
> of this mirror for a rather long time.
>
> I also wondered whether we want to have https://gitlab.com/git/git as we
> do on GitHub. I don't think anybody registered it, but it is blocked
> from being registered as far as I can tell. Maybe we block the namespace
> out of caution, I dunno. I can certainly check in with our SREs in case
> it is something the Git project would like to own.
Circling back on this topic: https://gitlab.com/git is unfortunately
taken, so it's out of question. I'd say the most pragmatic thing to do
would thus be to retain the already-existing location of the official
mirror at GitLab.
I'm still trying to reach Ævar so that we can collaborate and set up CI
for that mirror.
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH 1/1] builtin/show-ref: treat directory directory as non-existing in --exists
From: Patrick Steinhardt @ 2024-01-17 6:29 UTC (permalink / raw)
To: Toon Claes; +Cc: Eric Sunshine, git
In-Reply-To: <874jflfc26.fsf@iotcl.com>
[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]
On Wed, Jan 10, 2024 at 04:20:41PM +0100, Toon Claes wrote:
>
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
> > It may not be worth a reroll, but I found the explanation you gave in
> > the cover letter more illuminating than what is written above for
> > explaining why this change is desirable. In particular, the discussion
> > of the reftable backend was very helpful.
>
> Well, I wasn't sure the explanation would be relevant in the present,
> because the reftable backend might happen relatively far into the
> future.
I think it's not _that_ far in the future anymore. All prerequisite
topics are in flight already, so I expect that I can send the reftable
backend's implementation upstream around the end of January or start of
February. It will surely require several iterations, but we might be
able to land it in v2.44 (very optimistic) or v2.45 (more reasonable).
With that in mind I think it is okay to already mention the new backend
in commit messages -- at least I have been doing that, as well. Also,
the tree already knows about the reftable backend because we have both
the library and technical documentation in it for quite some time
already.
The patch itself looks good to me, thanks! Whether we want to reroll
just to amend the commit message I'll leave to you and others to decide.
Patrick
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH v2] tests: move t0009-prio-queue.sh to the new unit testing framework
From: Josh Steadmon @ 2024-01-17 6:01 UTC (permalink / raw)
To: Chandra Pratap via GitGitGadget; +Cc: git, Chandra Pratap, Chandra Pratap
In-Reply-To: <pull.1642.v2.git.1705220304781.gitgitgadget@gmail.com>
On 2024.01.14 08:18, Chandra Pratap via GitGitGadget wrote:
> From: Chandra Pratap <chandrapratap3519@gmail.com>
>
> t/t0009-prio-queue.sh along with t/helper/test-prio-queue.c unit
> tests Git's implementation of a priority queue. Migrate the
> test over to the new unit testing framework to simplify debugging
> and reduce test run-time. Refactor the required logic and add
> a new test case in addition to porting over the original ones in
> shell.
>
> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
> ---
> tests: move t0009-prio-queue.sh to the new unit testing framework
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1642%2FChand-ra%2Fprio-queue-v2
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1642/Chand-ra/prio-queue-v2
> Pull-Request: https://github.com/gitgitgadget/git/pull/1642
>
> Range-diff vs v1:
>
> 1: ca20abe95ea ! 1: 60ac9b3c259 tests: move t0009-prio-queue.sh to the new unit testing framework
> @@ t/unit-tests/t-prio-queue.c (new)
> +#define REVERSE_STACK_INPUT "stack", "1", "2", "3", "4", "5", "6", "reverse", "dump"
> +#define REVERSE_STACK_EXPECTED 1, 2, 3, 4, 5, 6
> +
> -+#define TEST_INPUT(INPUT, EXPECTED, name) \
> ++#define TEST_INPUT(INPUT, EXPECTED, name) \
> + static void test_##name(void) \
> -+{ \
> -+ const char *input[] = {INPUT}; \
> -+ int expected[] = {EXPECTED}; \
> -+ int result[INPUT_SIZE]; \
> -+ test_prio_queue(input, result); \
> ++{ \
> ++ const char *input[] = {INPUT}; \
> ++ int expected[] = {EXPECTED}; \
> ++ int result[INPUT_SIZE]; \
> ++ test_prio_queue(input, result); \
> + check(!memcmp(expected, result, sizeof(expected))); \
> +}
> +
>
>
> Makefile | 2 +-
> t/helper/test-prio-queue.c | 51 -------------------
> t/helper/test-tool.c | 1 -
> t/helper/test-tool.h | 1 -
> t/t0009-prio-queue.sh | 66 -------------------------
> t/unit-tests/t-prio-queue.c | 99 +++++++++++++++++++++++++++++++++++++
> 6 files changed, 100 insertions(+), 120 deletions(-)
> delete mode 100644 t/helper/test-prio-queue.c
> delete mode 100755 t/t0009-prio-queue.sh
> create mode 100644 t/unit-tests/t-prio-queue.c
>
> diff --git a/Makefile b/Makefile
> index 312d95084c1..d5e48e656b3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -828,7 +828,6 @@ TEST_BUILTINS_OBJS += test-partial-clone.o
> TEST_BUILTINS_OBJS += test-path-utils.o
> TEST_BUILTINS_OBJS += test-pcre2-config.o
> TEST_BUILTINS_OBJS += test-pkt-line.o
> -TEST_BUILTINS_OBJS += test-prio-queue.o
> TEST_BUILTINS_OBJS += test-proc-receive.o
> TEST_BUILTINS_OBJS += test-progress.o
> TEST_BUILTINS_OBJS += test-reach.o
> @@ -1340,6 +1339,7 @@ THIRD_PARTY_SOURCES += sha1dc/%
>
> UNIT_TEST_PROGRAMS += t-basic
> UNIT_TEST_PROGRAMS += t-strbuf
> +UNIT_TEST_PROGRAMS += t-prio-queue
> UNIT_TEST_PROGS = $(patsubst %,$(UNIT_TEST_BIN)/%$X,$(UNIT_TEST_PROGRAMS))
> UNIT_TEST_OBJS = $(patsubst %,$(UNIT_TEST_DIR)/%.o,$(UNIT_TEST_PROGRAMS))
> UNIT_TEST_OBJS += $(UNIT_TEST_DIR)/test-lib.o
> diff --git a/t/helper/test-prio-queue.c b/t/helper/test-prio-queue.c
> deleted file mode 100644
> index f0bf255f5f0..00000000000
> --- a/t/helper/test-prio-queue.c
> +++ /dev/null
> @@ -1,51 +0,0 @@
> -#include "test-tool.h"
> -#include "prio-queue.h"
> -
> -static int intcmp(const void *va, const void *vb, void *data UNUSED)
> -{
> - const int *a = va, *b = vb;
> - return *a - *b;
> -}
> -
> -static void show(int *v)
> -{
> - if (!v)
> - printf("NULL\n");
> - else
> - printf("%d\n", *v);
> - free(v);
> -}
> -
> -int cmd__prio_queue(int argc UNUSED, const char **argv)
> -{
> - struct prio_queue pq = { intcmp };
> -
> - while (*++argv) {
> - if (!strcmp(*argv, "get")) {
> - void *peek = prio_queue_peek(&pq);
> - void *get = prio_queue_get(&pq);
> - if (peek != get)
> - BUG("peek and get results do not match");
> - show(get);
> - } else if (!strcmp(*argv, "dump")) {
> - void *peek;
> - void *get;
> - while ((peek = prio_queue_peek(&pq))) {
> - get = prio_queue_get(&pq);
> - if (peek != get)
> - BUG("peek and get results do not match");
> - show(get);
> - }
> - } else if (!strcmp(*argv, "stack")) {
> - pq.compare = NULL;
> - } else {
> - int *v = xmalloc(sizeof(*v));
> - *v = atoi(*argv);
> - prio_queue_put(&pq, v);
> - }
> - }
> -
> - clear_prio_queue(&pq);
> -
> - return 0;
> -}
> diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
> index 876cd2dc313..5f591b9718f 100644
> --- a/t/helper/test-tool.c
> +++ b/t/helper/test-tool.c
> @@ -57,7 +57,6 @@ static struct test_cmd cmds[] = {
> { "path-utils", cmd__path_utils },
> { "pcre2-config", cmd__pcre2_config },
> { "pkt-line", cmd__pkt_line },
> - { "prio-queue", cmd__prio_queue },
> { "proc-receive", cmd__proc_receive },
> { "progress", cmd__progress },
> { "reach", cmd__reach },
> diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h
> index 70dd4eba119..b921138d8ec 100644
> --- a/t/helper/test-tool.h
> +++ b/t/helper/test-tool.h
> @@ -50,7 +50,6 @@ int cmd__partial_clone(int argc, const char **argv);
> int cmd__path_utils(int argc, const char **argv);
> int cmd__pcre2_config(int argc, const char **argv);
> int cmd__pkt_line(int argc, const char **argv);
> -int cmd__prio_queue(int argc, const char **argv);
> int cmd__proc_receive(int argc, const char **argv);
> int cmd__progress(int argc, const char **argv);
> int cmd__reach(int argc, const char **argv);
> diff --git a/t/t0009-prio-queue.sh b/t/t0009-prio-queue.sh
> deleted file mode 100755
> index eea99107a48..00000000000
> --- a/t/t0009-prio-queue.sh
> +++ /dev/null
> @@ -1,66 +0,0 @@
> -#!/bin/sh
> -
> -test_description='basic tests for priority queue implementation'
> -
> -TEST_PASSES_SANITIZE_LEAK=true
> -. ./test-lib.sh
> -
> -cat >expect <<'EOF'
> -1
> -2
> -3
> -4
> -5
> -5
> -6
> -7
> -8
> -9
> -10
> -EOF
> -test_expect_success 'basic ordering' '
> - test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
> - test_cmp expect actual
> -'
> -
> -cat >expect <<'EOF'
> -2
> -3
> -4
> -1
> -5
> -6
> -EOF
> -test_expect_success 'mixed put and get' '
> - test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
> - test_cmp expect actual
> -'
> -
> -cat >expect <<'EOF'
> -1
> -2
> -NULL
> -1
> -2
> -NULL
> -EOF
> -test_expect_success 'notice empty queue' '
> - test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
> - test_cmp expect actual
> -'
> -
> -cat >expect <<'EOF'
> -3
> -2
> -6
> -4
> -5
> -1
> -8
> -EOF
> -test_expect_success 'stack order' '
> - test-tool prio-queue stack 8 1 5 4 6 2 3 dump >actual &&
> - test_cmp expect actual
> -'
> -
> -test_done
> diff --git a/t/unit-tests/t-prio-queue.c b/t/unit-tests/t-prio-queue.c
> new file mode 100644
> index 00000000000..07b112f5894
> --- /dev/null
> +++ b/t/unit-tests/t-prio-queue.c
> @@ -0,0 +1,99 @@
> +#include "test-lib.h"
> +#include "prio-queue.h"
> +
> +static int intcmp(const void *va, const void *vb, void *data UNUSED)
> +{
> + const int *a = va, *b = vb;
> + return *a - *b;
> +}
> +
> +static int show(int *v)
> +{
> + int ret = -1;
> + if (v)
> + ret = *v;
> + free(v);
> + return ret;
> +}
> +
> +static int test_prio_queue(const char **input, int *result)
> +{
> + struct prio_queue pq = { intcmp };
> + int i = 0;
> +
> + while (*input) {
> + if (!strcmp(*input, "get")) {
Running the test segfaults at the above strcmp() for me, from the very
first test_basic test case. I'm not sure why, there's not an obvious
problem that I can see. Does it run properly for you?
> + void *peek = prio_queue_peek(&pq);
> + void *get = prio_queue_get(&pq);
> + if (peek != get)
> + BUG("peek and get results do not match");
> + result[i++] = show(get);
> + } else if (!strcmp(*input, "dump")) {
> + void *peek;
> + void *get;
> + while ((peek = prio_queue_peek(&pq))) {
> + get = prio_queue_get(&pq);
> + if (peek != get)
> + BUG("peek and get results do not match");
> + result[i++] = show(get);
> + }
> + } else if (!strcmp(*input, "stack")) {
> + pq.compare = NULL;
> + } else if (!strcmp(*input, "reverse")) {
> + prio_queue_reverse(&pq);
> + } else {
> + int *v = xmalloc(sizeof(*v));
> + *v = atoi(*input);
> + prio_queue_put(&pq, v);
> + }
> + input++;
> + }
> +
> + clear_prio_queue(&pq);
> +
> + return 0;
> +}
> +
> +#define INPUT_SIZE 6
> +
> +#define BASIC_INPUT "1", "2", "3", "4", "5", "5", "dump"
> +#define BASIC_EXPECTED 1, 2, 3, 4, 5, 5
> +
> +#define MIXED_PUT_GET_INPUT "6", "2", "4", "get", "5", "3", "get", "get", "1", "dump"
> +#define MIXED_PUT_GET_EXPECTED 2, 3, 4, 1, 5, 6
> +
> +#define EMPTY_QUEUE_INPUT "1", "2", "get", "get", "get", "1", "2", "get", "get", "get"
> +#define EMPTY_QUEUE_EXPECTED 1, 2, -1, 1, 2, -1
> +
> +#define STACK_INPUT "stack", "1", "5", "4", "6", "2", "3", "dump"
> +#define STACK_EXPECTED 3, 2, 6, 4, 5, 1
> +
> +#define REVERSE_STACK_INPUT "stack", "1", "2", "3", "4", "5", "6", "reverse", "dump"
> +#define REVERSE_STACK_EXPECTED 1, 2, 3, 4, 5, 6
> +
> +#define TEST_INPUT(INPUT, EXPECTED, name) \
> + static void test_##name(void) \
> +{ \
> + const char *input[] = {INPUT}; \
> + int expected[] = {EXPECTED}; \
> + int result[INPUT_SIZE]; \
> + test_prio_queue(input, result); \
> + check(!memcmp(expected, result, sizeof(expected))); \
> +}
> +
> +TEST_INPUT(BASIC_INPUT, BASIC_EXPECTED, basic)
> +TEST_INPUT(MIXED_PUT_GET_INPUT, MIXED_PUT_GET_EXPECTED, mixed)
> +TEST_INPUT(EMPTY_QUEUE_INPUT, EMPTY_QUEUE_EXPECTED, empty)
> +TEST_INPUT(STACK_INPUT, STACK_EXPECTED, stack)
> +TEST_INPUT(REVERSE_STACK_INPUT, REVERSE_STACK_EXPECTED, reverse)
> +
> +int cmd_main(int argc, const char **argv)
> +{
> + TEST(test_basic(), "prio-queue works for basic input");
> + TEST(test_mixed(), "prio-queue works for mixed put & get commands");
> + TEST(test_empty(), "prio-queue works when queue is empty");
> + TEST(test_stack(), "prio-queue works when used as a LIFO stack");
> + TEST(test_reverse(), "prio-queue works when LIFO stack is reversed");
> +
> + return test_done();
> +}
>
> base-commit: 1a87c842ece327d03d08096395969aca5e0a6996
> --
> gitgitgadget
^ permalink raw reply
* Re: [Outreachy][PATCH v5] Port helper/test-ctype.c to unit-tests/t-ctype.c
From: Josh Steadmon @ 2024-01-17 5:37 UTC (permalink / raw)
To: René Scharfe
Cc: Junio C Hamano, Phillip Wood, Achu Luma, git, chriscool,
christian.couder, me, phillip.wood
In-Reply-To: <41cf1944-2456-4115-a934-aff2306a26e5@web.de>
On 2024.01.16 20:27, René Scharfe wrote:
> Am 16.01.24 um 16:38 schrieb Junio C Hamano:
> > Phillip Wood <phillip.wood123@gmail.com> writes:
> >
> >> Thanks for adding back the test for EOF, this version looks good to me.
> >
> > Thanks. Let's merge it to 'next'.
>
> OK. I'm still interested in replies to my question in
> https://lore.kernel.org/git/a087f57c-ce72-45c7-8182-f38d0aca9030@web.de/,
> i.e. whether we should have one TEST per class or one per class and
> character -- or in a broader sense: What's the ideal scope of a TEST?
> But I can ask it again in the form of a follow-up patch.
>
> René
I think that the scope of a TEST() should tend small: we want the
minimal amount of setup required to test the invariants that we're
interested in. For this particular unit test, since we're just testing
simple predicates on static sets of characters, I would be OK seeing one
TEST() per class/character. That would certainly make this unit test an
outlier in the number of checks, but I'm less worried about that since
this is testing system-provided functions that we don't expect to change
regularly.
Additionally, the elimination of a level of macro indirection makes this
more readable IMO.
^ permalink raw reply
* Re: [GSoC][RFC] Replace use of atoi() with strtol_i(), as a microproject
From: Mohit Marathe @ 2024-01-17 5:28 UTC (permalink / raw)
To: Junio C Hamano
Cc: Christian Couder, git@vger.kernel.org, britton.kerin@gmail.com,
peff@peff.net
In-Reply-To: <xmqqa5pdav04.fsf@gitster.g>
> A corrupt patch may be getting a nonsense patch-ID with the current
> code and hopefully is not matching other patches that are not
> corrupt, but with such a change, a corrupt patch may not be getting
> any patch-ID and a loop that computes patch-ID for many files and
> try to match them up might need to be rewritten to take the new
> failure case into account.
Are you talking about the loop in `get_one_patchid()`? And how should
the failure case be handled? Should it give a warning or an error?
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2024, #01; Tue, 2)
From: Junio C Hamano @ 2024-01-16 23:42 UTC (permalink / raw)
To: Taylor Blau; +Cc: SZEDER Gábor, git
In-Reply-To: <ZacRx1rbESvYiVgN@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
>> A big red button solution to avoid this would be to uprev the
>> repository format version once you start writing v2 Bloom filters
>> anywhere in the layers. That way, existing Git clients would not be
>> able to touch it. I do not know if the cure is more severe than the
>> disease in that case, though.
>
> I tend to think that in this case the cure is probably worse than the
> disease. I expect it to be extremely rare that a user would upgrade to a
> modern version of Git, write commit-graphs, then downgrade, and try to
> write more commit-graphs.
But then the big red button solution would rarely misfire for users
because they will not downgrade (and see "gee, I now need to stick
to the newer version"), no?
I am not seriously suggesting to do this, but I am not sure if
documenting "don't do this because you'll break your repository"
is sufficient.
>> In any case, at least, we should be able to prepare the code that we
>> teach to grok v2 today so that they do not trigger the same segfault
>> when they see a commit graph layer containing v3 Bloom filters (or
>> later). Then we won't have to have the same conversation when we
>> somehow need to update Bloom filters again.
>
> This series should accomplish that by loading the Bloom chunk
> unconditionally, and only reading its filters when they match the
> given hash_version.
Good.
^ permalink raw reply
* Re: [RFC PATCH 2/4] test-tool run-command testsuite: support unit tests
From: Junio C Hamano @ 2024-01-16 23:40 UTC (permalink / raw)
To: Josh Steadmon; +Cc: git, johannes.schindelin, peff, phillip.wood
In-Reply-To: <xmqqv87sx3y2.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
> Josh Steadmon <steadmon@google.com> writes:
>
>> Teach the testsuite runner in `test-tool run-command testsuite` how to
>> run unit tests, by adding two new flags:
>>
>> First, "--(no-)run-in-shell" allows the test-tool to exec the unit-test
>> binaries directly, rather than trying to interpret them as shell
>> scripts.
>
> Makes perfect sense.
This may be a stupid question, but do we even need the current "push
'sh' to the strvec"? If our executable shell scripts run just fine
without, then this may not have to be conditional.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox