Skip to content

Enable configuration in gh (gh config) #622

Description

@billygriffin

Describe the feature or problem you’d like to solve

A couple things have risen to the level of things where we feel like adding the ability to configure a set of preferences for gh would be appropriate.

Proposed solution

Create a gh config command (open to other ideas on the naming, but this is what we were thinking).

Initially, this will include two preferences:

  • SSH vs https default remote preference
  • Default editor for use with gh

Our thinking is to have a config file, probably a yaml file, that contains these preferences and is where we read from when they use the tool. However, we'd also like a simpler and less error-prone way to change a particular preference, so we were thinking of:

gh config <key> <value>

For example, to change your default editor, you could: gh config editor vim (I don't know if this is exactly what the command would be, but that's the idea).

Additional context

This is directly related to #546 and #308.

Activity

  1. eddumelendez commented on Mar 10, 2020

    @eddumelendez
    Contributor

    can we include aliases support?

  2. billygriffin commented on Mar 10, 2020

    @billygriffin
    ContributorAuthor

    @eddumelendez That's being tracked separately in #294.

  3. self-assigned this
    on Mar 23, 2020
  4. thefotios commented on Apr 1, 2020

    @thefotios

    @billygriffin does it warrant having a separate config for this? For instance, ghq does something similar by using a namespace within git-config.

    If this were able to leverage that, then you'd also get everything else around it for free like having a hierarchy of global, user, per-directory settings as well as conditional includes.

    To access the configs, gh would could dump and parse git config --list --includes, use git config --get ... on individual items, or use something like libgit to access the config programatically.

  5. vilmibm commented on Apr 6, 2020

    @vilmibm
    Contributor

    heya @thefotios . We explored that option and decided against it; in general we're trying to be very light in how we depend on git. Given how far back we'd like to provide git support for and the wide varieties of git versions in the wild, we wanted a config system decoupled from any change in git's config over time. That said, there are times when we do already take advantage of git config when it comes to branch configuration.

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

Metadata

Metadata

Assignees

Labels

enhancementa request to improve CLI

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions