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

run git config -l in temp dir when looking up system config #1523

Merged
merged 2 commits into from
Aug 15, 2024

Commits on Aug 15, 2024

  1. run git config -l in temp dir when looking up system config

    Commit a9a3545 made `gix::config::File::from_globals()` try to
    find the system config (typically `/etc/config`) by subprocessing to
    `git config -l --show-origin`. That command takes about 500 ms when
    run in certain directories in our VFS at Google. Since we don't need
    anything but the system config, let's run the command in the system's
    temporary directory instead.
    
    I also added `--system` for good measure. I've confirmed that just
    adding `--system` is not enough, however - `git config -l --system
    --show-origin` is still slow in our VFS.
    martinvonz committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    20ef4e9 View commit details
    Browse the repository at this point in the history
  2. remove --system from git config call as it fails on MacOS

    ```
    ❯ which git
    /usr/bin/git
    
    gitbutler ( missing-project) [$] via 
    ❯ git --version
    git version 2.39.3 (Apple Git-146)
    
    gitbutler ( missing-project) [$] via 
    ❯ git config -l --system --show-origin
    fatal: unable to read config file '/etc/gitconfig': No such file or directory
    ```
    Byron committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    6b1c243 View commit details
    Browse the repository at this point in the history