Skip to content

Conversation

@xdavidwu
Copy link
Contributor

Fix when /bin/sh is not bash, or XDG_CONFIG_HOME is set

This Makefile uses brace expansion ({foo,bar}), which is bash-specific.
To avoid `git config --global ...` in setup catching user configuration
file.
@xdavidwu xdavidwu requested a review from a team as a code owner October 14, 2024 07:32
@chrisd8088
Copy link
Member

Thanks for these changes! I think they seem reasonable, on a first look.

I was initially going to suggest that we could avoid setting the Makefile's SHELL variable if we just expanded the two places where we use braces to list the two relevant files, test_count and test_count.lock.

Then it occurred to me that if we do set SHELL = bash as you've done, we might instead be able to simplify our primary target's recipe, which has needed an explicit bash -c "..." shell command since commit 4f23722 in PR #3125.

Would you be amenable to trying that in this PR? I can push a small commit to your branch, if you're willing to grant me permission to do that; otherwise, would you be able to try a patch like this?

--- a/t/Makefile
+++ b/t/Makefile
@@ -46,9 +46,9 @@ test-commands : $(TEST_CMDS)
 
 test : test-commands
        $(RM) -r remote test_count{,.lock}
-       @bash -c ". ./testenv.sh && setup && cd t && \
+       @ . ./testenv.sh && setup && cd t && \
                RM_GIT_LFS_TEST_DIR=no $(PROVE) $(PROVE_EXTRA_ARGS) t-*.sh && \
-               shutdown"
+               shutdown

Also. just a note re the CI builds—it appears GitHub Actions have upgraded their default runners to Ubuntu 24.04, and we'll have to adjust one of our build scripts for that change, so for now, just ignore those CI failures. I'll get a patch up to deal with the CI breakage shortly.

Copy link
Member

@chrisd8088 chrisd8088 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

Thanks again for the contributions.

Comment on lines -48 to +51
@bash -c ". ./testenv.sh && setup && cd t && \
@. ./testenv.sh && setup && cd t && \
RM_GIT_LFS_TEST_DIR=no $(PROVE) $(PROVE_EXTRA_ARGS) t-*.sh && \
shutdown"
shutdown
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for adding this change! It's great to be able to take advantage of the fixed shell environment here.

@chrisd8088 chrisd8088 merged commit a577e33 into git-lfs:main Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants