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

Support for .gitconfig conditional includes #30

Closed
markashleybell opened this issue Sep 30, 2018 · 7 comments
Closed

Support for .gitconfig conditional includes #30

markashleybell opened this issue Sep 30, 2018 · 7 comments
Labels
enhancement New feature or request

Comments

@markashleybell
Copy link

Problem description

I use conditional includes to separate my personal projects from work for my employer. Because of this, my .gitconfig doesn't directly contain a [user] section; it's included dynamically based on the folder I'm working in:

In .gitconfig

[includeIf "gitdir:Work/"]
    path = .gitconfig-work
[includeIf "gitdir:Personal/"]
    path = .gitconfig-personal

.gitconfig-work

[user]
    name = Mark Bell
    email = [MY WORK EMAIL]

.gitconfig-personal

[user]
    name = Mark Bell
    email = [MY PERSONAL EMAIL]

However, this results in Sublime Merge asking me to enter my name and email address when I commit to any repository, presumably because it can't find them in .gitconfig and isn't parsing the conditionals.

As a result, I can't currently use SM at all, unless I re-specify my credentials for every repository I work on and persist them to the settings for the individual working copy.

Preferred solution

Sublime Merge should be able to figure out that the current repository is using conditionally included user info. I realise mine is a fairly niche use case, but it would be great to get support for this, as it is an established Git feature.

@IlikePepsi
Copy link

I'm also using several git configs and would appreciate if sublime merge could evaluate conditional includes to show the right git identity based on the working directory.

At the moment when you put a [user] section and some include directives into your .gitconfig sublime merge will use that identity in the UI but when issuing a commit the identity configured for the specific directory will be used.

@voltechs
Copy link

Please support this! (I came to file a ticket, but searched first like a responsible developer 😉)

Today I set up conditional includes to manage different identities under me ~/Workspace/... It's beautiful and works great! I was about to finally ditch Sourcetree (they don't support it either, FTR) but sadly Sublime Merge doesn't either.

This should be relatively straight-forward. I'm not sure how SM is currently getting settings, but it probably shouldn't be much more than git config user.email and git config user.name on repo load. :)

@pasnox
Copy link

pasnox commented May 22, 2019

Please support this! (I came to file a ticket, but searched first like a responsible developer )

No more words needed.

@jskinner
Copy link
Member

Support for conditional includes was added in build 1103

@pasnox
Copy link

pasnox commented May 23, 2019

Hu ? I'm using Sublime Merge on Linux (Stable Channel, Build 1107) and it's clearly not there, or not working at all :)
Is there something to enable / configure ?

@jskinner
Copy link
Member

If it's not working for you, please file a new issue, and include the output of the Help/Debug Information menu item (removing any confidential parts first).

@pasnox
Copy link

pasnox commented May 23, 2019

Done @ #502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants