sublime_merge icon indicating copy to clipboard operation
sublime_merge copied to clipboard

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

Open Devenec opened this issue 1 year ago • 2 comments

Version info

  • OS: Windows 10 19044.3086
  • Build: 2092

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 = [email protected]

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

C:/Work/.gitconfig:

[user]
	name = bar
	email = [email protected]

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 <[email protected]>.

Expected behavior

After editing the message, the commit author (or committer) should be bar <[email protected]>.

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.

Devenec avatar Jan 04 '24 08:01 Devenec

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

themilkman avatar Jan 09 '24 12:01 themilkman

see also: #1314

srbs avatar Mar 03 '24 21:03 srbs