Skip to content

[FEATURE] Workspace specific configuration #602

Closed

Description

@Masgalor

I would like to have the option to automatically change the global git-config depending on the active workspace.

Ideally sourcegit would store the global preferences in independent files for each available workspace and overwrite the global ~/.gitconfig with the content corresponding to the active workspace.

An alternative (I think easier) implementation would be to give the user the option to specify a config file in the workspace settings that can be included at the end of the global config. That way one could craft a file by hand and have it activated automatically.
I think this approach wouldn't be that hard to implement, we could add an entry like this to the end of the global config and simply update the path if another workspace is initiated.

[include]
	path = <workprofile-specific-path> ;

Activity

  1. dougcunha commented on Oct 25, 2024

    @dougcunha
    Contributor

    If I understood your proposal correctly, I'll raise a potential issue. What happens if more than one instance of SourceGit is open at the same time? Editing a file on disk when switching workspaces doesn’t seem feasible to me.

  2. self-assigned this
    on Oct 28, 2024
  3. love-linger commented on Oct 28, 2024

    @love-linger
    Collaborator

    The GIT page of Preference window is designed to provide the ability to modify commonly used global GIT configurations in GUI way.

  4. Masgalor commented on Oct 28, 2024

    @Masgalor
    ContributorAuthor

    Just to clarify.
    I am aware, that the global GIT configuration can be changed that way, I want different global configurations for different workspaces. But I understand that this is out of scope.

    Could we do something like run a user-specified command after switching to another workspace?
    Like after switching to this workspace run this command.

  5. dougcunha commented on Oct 28, 2024

    @dougcunha
    Contributor

    @love-linger I'm not sure if this has been discussed yet or if it's too early to consider. Has the possibility of SourceGit supporting plugins been explored? It seems like it would be a great way to make SourceGit more open to community contributions and prevent the product from becoming cluttered with too many features in the main package, distracting from its primary goal of being a fast and efficient Git client.

  6. love-linger commented on Oct 29, 2024

    @love-linger
    Collaborator

    PS: You can use includeIf in git configuration file. For example:

    [includeIf "gitdir:D:/Repos/Mine/**"]
      path = CONFIG_OF_MINE_REPO_FILE_PATH
    [incluedIf "gitdir:D:/Repos/Work/**"]
      path = CONFIG_OF_WORK_REPO_FILE_PATH
  7. love-linger commented on Oct 30, 2024

    @love-linger
    Collaborator

    Currently, we have no plan to do this.

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

Metadata

Metadata

Assignees

Labels

not-plannedIt's not planned in the future

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions