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

config: make type conversion explicit #357

Merged
merged 2 commits into from
Apr 15, 2014
Merged

Commits on Mar 27, 2014

  1. config: make type conversion explicit

    The type of a config value depends on the tool that interprets
    it. Parsing eagerly can lead to a situation where we return a bool
    instead of a string or a number.
    
    Let the user specify the type themselves by passing in a (str, type)
    tuple into the mapping interface.
    carlosmn committed Mar 27, 2014
    Configuration menu
    Copy the full SHA
    687dc53 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2014

  1. Config: make bool and int parsing explicit via functions

    Passing a tuple to the mapping interface isn't the best of interfaces,
    as the key is only the string.
    
    Instead, expose `Config.get_bool()` and `Config.get_int()` methods to
    parse the values as per the git-config rules before returning the
    appropriate type to the user.
    
    The mapping interface itself returns a string.
    carlosmn committed Apr 14, 2014
    Configuration menu
    Copy the full SHA
    73e9e58 View commit details
    Browse the repository at this point in the history