Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a custom "system level" gitconfig #508

Merged
merged 7 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Run ShellCheck
run: |
sudo apt-get install shellcheck
Expand Down Expand Up @@ -82,14 +82,14 @@ jobs:
# Delete the command line tools to make sure they don't get our builds
# messed up with macOS SDK 11 stuff.
sudo rm -rf /Library/Developer/CommandLineTools
- uses: actions/checkout@v2
- uses: actions/checkout@v3
Copy link
Member

@sergiou87 sergiou87 May 21, 2024

Choose a reason for hiding this comment

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

Is there any reason for not using v4 here too?

Suggested change
- uses: actions/checkout@v3
- uses: actions/checkout@v4

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, v4 used node 20 which in turn required glibc 2.28 which we don't have on Linux thanks to our use of the 18.04 docker container. We'll have to take that fight another day but I'm afraid that day might come sooner than we'd like.

with:
submodules: recursive
# Needed for script/package.sh to work
fetch-depth: 0
- name: Install go
if: matrix.targetPlatform == 'macOS'
uses: actions/setup-go@v2
uses: actions/setup-go@v5
- name: Install dependencies
run: npm install
- name: Check formatting
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
TARGET_PLATFORM: ${{ matrix.targetPlatform }}
TARGET_ARCH: ${{ matrix.arch }}
- name: Upload output artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name:
dugite-native-${{ matrix.targetPlatform }}-${{ matrix.arch }}-output
Expand All @@ -161,10 +161,10 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Download all artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
path: './artifacts'

Expand Down
13 changes: 13 additions & 0 deletions resources/posix.gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is dugite's own custom system-wide gitconfig file for macOS and Linux.
# On Windows we ship a contained Git environment (minGit) where we can control
# the system-level configuration but on macOS and Linux /etc/gitconfig is used
# as the system-wide configuration file and we're unable to modify it.
#
# So in order to be able to provide our own sane defaults that can be overriden
# by the user's global and local configuration we'll tell Git that this file
# is the system level config (and import the actual system level config)
[include]
path=/etc/gitconfig

[credential "https://dev.azure.com"]
useHttpPath = true
4 changes: 4 additions & 0 deletions script/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ echo "-- Removing unsupported features"
rm "$DESTINATION/libexec/git-core/git-svn"
rm "$DESTINATION/libexec/git-core/git-p4"

echo "-- Copying dugite custom system gitconfig"
mkdir "$DESTINATION/etc"
cp "$CURRENT_DIR/../resources/posix.gitconfig" "$DESTINATION/etc/gitconfig"

set +eu
4 changes: 4 additions & 0 deletions script/build-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ echo "-- Removing unsupported features"
rm "$DESTINATION/libexec/git-core/git-svn"
rm "$DESTINATION/libexec/git-core/git-p4"

echo "-- Copying dugite custom system gitconfig"
mkdir "$DESTINATION/etc"
cp "$CURRENT_DIR/../resources/posix.gitconfig" "$DESTINATION/etc/gitconfig"

set +eu

echo "-- Static linking research"
Expand Down
1 change: 1 addition & 0 deletions script/build-win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ git config --file "$SYSTEM_CONFIG" core.symlinks "false"
git config --file "$SYSTEM_CONFIG" core.autocrlf "true"
git config --file "$SYSTEM_CONFIG" core.fscache "true"
git config --file "$SYSTEM_CONFIG" http.sslBackend "schannel"
git config --file "$SYSTEM_CONFIG" credential.https://dev.azure.com.useHttpPath "true"

# See https://github.com/desktop/desktop/issues/4817#issuecomment-393241303
# Even though it's not set openssl will auto-discover the one we ship because
Expand Down
Loading