sublimehq / sublime_merge

Issue tracker for Sublime Merge
https://www.sublimemerge.com
274 stars 14 forks source link

Overridden username and email are not used when editing a commit message #1858

Open Devenec opened 9 months ago

Devenec commented 9 months ago

Version info

Description

When a username and an email are overridden with includeIf in Git config, editing a commit message applies the non-overridden username and email to the commit.

User directory .gitconfig:

[user]
    name = foo
    email = foo@personal.com

[includeIf "gitdir:C:/Work"]
    path = "C:/Work/.gitconfig"

C:/Work/.gitconfig:

[user]
    name = bar
    email = bar@work.com

Steps to reproduce

Steps to reproduce the behavior:

  1. Override the username and the email as described above.
  2. For a repository in C:/Work, edit the message of a commit: right-click a commit, select Edit Commit, select Edit Commit Message, edit the message and select Save.
  3. Notice that the author (or committer) of the commit changes to foo <foo@personal.com>.

Expected behavior

After editing the message, the commit author (or committer) should be bar <bar@work.com>.

Debug Information

sublime-merge-debug.txt

Notes

When perfoming a normal commit, Sublime Merge incorrectly displays the non-overridden username and email below the commit message edit box, but upon commit correctly applies the overridden username and email to the commit.

themilkman commented 8 months ago

Also just noticed this, quite unexpected and annoying to see it happened when discovering it much later in your repo.

srbs commented 7 months ago

see also: #1314