Skip to content

Support for .gitconfig conditional includes #5492

@markashleybell

Description

@markashleybell

Do you want to request a feature or report a bug?

I imagine this would be a feature due to the amount of work that's probably involved, although arguably the current behaviour is misleading and could be classed as a bug.

What is the current behavior?

I use conditional includes to separate my personal projects from work for my employer. Because of this, my .gitconfig doesn't 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]

This works in GitExtensions (in that any git operations I perform use the correct credentials), but the settings validator displays an error:

Settings Dialog

And the committer display in the status bar of the commit dialog is always empty:

Committer

As I mentioned, the correct credentials actually are used when you make a commit etc. (presumably because GE is just using the git cli under the hood), but this is a bit disconcerting when you first encounter it!

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

See above.

What is the expected behavior?

The commit dialog committer display should show the correct committer for the current repository folder, taking any conditional includes into account.

For the settings dialog, I'm not even clear what the behaviour should be... perhaps a nested box under the user box? This would also affect the user name and email fields in the Git Config settings.

Environment you encounter the issue:

  • GitExtensions version: 2.51.05
  • GIT version: 2.18
  • OS version: Windows 10
  • .NET version: 4.72

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions