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

use .lfsconfig (with fallback to .gitconfig) #837

Merged
merged 7 commits into from Nov 18, 2015

Conversation

Projects
None yet
3 participants
@technoweenie
Copy link
Member

technoweenie commented Nov 16, 2015

This changes Git LFS to read committed lfs config settings from .lfsconfig instead of .gitconfig. This makes it more clear what settings should go in that file. It does continue to check for .gitconfig but only IF .lfsconfig does not exist. This is meant as a way for projects to gradually rename this file on their own. By Git LFS v2.0, we'll remove support completely.

This also makes a few other changes:

  • ListFromFile() doesn't run os.Stat anymore. The new readGitConfigFromFiles() function minimizes os.Stat calls.
  • The config order was tweaked slightly, reducing the number of git config calls. No need to call git config --list AND git config --file .git/config --list. Now it only calls git config --file .lfsconfig --list and git config --list.

Fixes #780

@technoweenie technoweenie added the review label Nov 16, 2015

@technoweenie technoweenie referenced this pull request Nov 16, 2015

Closed

Git LFS v1.1 #755

7 of 13 tasks complete

@technoweenie technoweenie referenced this pull request Nov 16, 2015

Merged

Auth fix for #687 #690

fileOutput, err := git.Config.ListFromFile(configFile)
if err != nil {
panic(fmt.Errorf("Error listing git config from %s: %s", configFile, err))
// TODO: remove .gitconfig support for Git LFS v2.0

This comment has been minimized.

@WillHipschman

WillHipschman Nov 16, 2015

Contributor

Add the issue # tracking this work so that when we complete the work we know to remove the TODO.

@technoweenie technoweenie referenced this pull request Nov 16, 2015

Closed

Git LFS v2.0 deprecations #839

2 of 2 tasks complete

technoweenie added a commit that referenced this pull request Nov 18, 2015

Merge pull request #837 from github/use-lfsconfig
use .lfsconfig (with fallback to .gitconfig)

@technoweenie technoweenie merged commit 14aeecc into master Nov 18, 2015

3 checks passed

GitHub CLA @technoweenie has accepted the GitHub Contributor License Agreement.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@technoweenie technoweenie deleted the use-lfsconfig branch Nov 18, 2015

@@ -280,9 +280,6 @@ func (c *gitConfig) List() (string, error) {

// ListFromFile lists all of the git config values in the given config file
func (c *gitConfig) ListFromFile(f string) (string, error) {
if _, err := os.Stat(f); os.IsNotExist(err) {
return "", nil
}
return simpleExec("git", "config", "-l", "-f", f)

This comment has been minimized.

@khorshedalam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment