Skip to content

Commit

Permalink
Merge pull request #508 from desktop/custom-gitconfig
Browse files Browse the repository at this point in the history
Add a custom "system level" gitconfig
  • Loading branch information
niik authored May 22, 2024
2 parents 77001e5 + aa944b5 commit 9e9adcc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 6 deletions.
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
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

0 comments on commit 9e9adcc

Please sign in to comment.