Re: [PATCH v3 0/4] clean up some code around editors
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 12, 2025, 17:35 UTC
- Message-ID
- <xmqq1ppgv3wg.fsf@gitster.g>
- In-Reply-To
- <CAPig+cTpMFfg8iTncgekq6wyfHOPidhHposLi11D3fXyfnNQRw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 15 quoted lines
> On Mon, Aug 11, 2025 at 6:59 PM Ben Knoble <ben.knoble@gmail.com> wrote:
>> > Le 11 août 2025 à 18:17, D. Ben Knoble <ben.knoble+github@gmail.com> a écrit :
>> > Changes from v2:
>> > - shuffle setup code and use more helpers in 1/4
>> > - insert 2/4 to stop abusing --exec-path
>> > - improve environment-cleansing idioms in {2 => 3}/4
>>
>> Some of this shuffling turned out to be unportable, which CI caught (but running the test locally didn’t??). Fortunately it pointed me at test_env and I’ll either use it or go back to the subshells.
>
> To catch it locally, you can run:
>
> make test-lint-shell-syntax
>
> in the "t" directory. Alternatively, `make test-lint`, `make test` or
> `make prove` would also have caught the problem.Among these three `make test` can be run from the top-level. The other two cannot.
"make test" is a bit too heavy-weight to use as an initial sanity check for tests that are being newly developed, and I am wondering if something like this can be added as a first-line sanity checking tool. The idea is a simple "make" to build, while DEVELOPER=Yes is set, would trigger the common linting any developer who is working on new things needs to pay attention to.
Makefile | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git c/Makefile w/Makefile index e11340c1ae..7f21afeaf9 100644 --- c/Makefile +++ w/Makefile @@ -1471,6 +1471,7 @@ include config.mak.uname ifdef DEVELOPER include config.mak.dev +all:: check-developer endif GIT-VERSION-FILE: FORCE @@ -3350,6 +3351,10 @@ check: exit 1; \ fi +# We may want to take over 'make check' for this, but for now... +.PHONY: check-developer +check-developer: check-docs check-tests check-builtins check-headers + COCCI_GEN_ALL = .build/contrib/coccinelle/ALL.cocci COCCI_GLOB = $(wildcard contrib/coccinelle/*.cocci) COCCI_RULES_TRACKED = $(COCCI_GLOB:%=.build/%) @@ -3942,6 +3947,10 @@ build-unit-tests: $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG) unit-tests: $(UNIT_TEST_PROGS) $(CLAR_TEST_PROG) t/helper/test-tool$X $(MAKE) -C t/ unit-tests +.PHONY: check-tests +check-tests: + $(MAKE) -C t/ test-lint + .PHONY: libgit-sys libgit-rs libgit-sys libgit-rs: $(QUIET)(\