lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Multiline description is cut off

Open UrbanCMC opened this issue 2 years ago • 2 comments

Describe the bug When writing a commit with a multiline description, anything after the first linebreak is cut off and not included in the created commit.

To Reproduce Steps to reproduce the behavior:

  1. Stage a changed file
  2. Create a new commit with c
  3. Write a commit message
  4. Press Tab, write multiple lines of commit description, using Enter to create linebreaks
  5. Press Tab to go back to commit message
  6. Press Enter to create commit
  7. Look at created commit in the Commits panel

Expected behavior The created commit should have multiple lines of description. In the example below, the expected output would be:

Example message

Example description
spanning multiple
lines

Screenshots image

Version info: commit=5149b24ab3dfad3860e2300519c7c583dcc8c9ff, build date=2023-05-03T08:00:22Z, build source=binaryRelease, version=0.38.2, os=windows, arch=amd64, git version=2.40.0.windows.1

UrbanCMC avatar May 04 '23 12:05 UrbanCMC

That's odd, cannot reproduce it.

Could you post your config.yml and gitconfig? Or try it without the config.yml to rule that out.

mark2185 avatar May 04 '23 12:05 mark2185

Removing the config.yml didn't change anything. My gitconfig (combining both local and global):

[merge]
	tool = winmerge
	guitool = vscode
[mergetool "kdiff3"]
	path = C:/Program Files (x86)/KDiff3/kdiff3.exe
[diff]
	guitool = vscode
	tool = kdiff3
[difftool "kdiff3"]
	path = C:/Program Files (x86)/KDiff3/kdiff3.exe
[core]
    autocrlf = true
    excludesfile = ~/.gitignore
	repositoryformatversion = 0
	filemode = false
	bare = false
	logallrefupdates = true
	ignorecase = true
[credential]
	helper = wincred
[alias]
	ai = add --patch
	co = checkout
	cob = checkout -b
	ci = commit
	df = diff
	dfs = diff --cached
	lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
	lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
	lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
	st = status
	uc = reset --soft HEAD~1
	uch = reset --hard HEAD~1
	why-ignore = check-ignore -v --no-index
[push]
	default = simple
[pull]
	rebase = false
[fetch]
	prune = false
[rebase]
	autoStash = false
[difftool "vscode"]
	cmd = \"C:/Users/UrbanCMC/AppData/Local/Programs/Microsoft VS Code/Code.exe\" --wait --diff \"$LOCAL\" \"$REMOTE\"
	path = C:/Users/UrbanCMC/AppData/Local/Programs/Microsoft VS Code/Code.exe
[mergetool "vscode"]
	cmd = \"C:/Users/UrbanCMC/AppData/Local/Programs/Microsoft VS Code/Code.exe\" --wait -m \"$REMOTE\" \"$LOCAL\" \"$BASE\" \"$MERGED\"
	path = C:/Users/UrbanCMC/AppData/Local/Programs/Microsoft VS Code/Code.exe
[filter "lfs"]
	clean = git-lfs clean -- %f
	smudge = git-lfs smudge -- %f
	process = git-lfs filter-process
	required = true

Interestingly, I noticed that multiline descriptions work fine when I reword an existing commit. Not sure what could be different there.

UrbanCMC avatar May 04 '23 12:05 UrbanCMC

This was a windows-specific issue that is now fixed on master

jesseduffield avatar May 23 '23 13:05 jesseduffield

Can you confirm the fix @UrbanCMC ?

jesseduffield avatar May 23 '23 13:05 jesseduffield

Yes, it works just fine with the current master branch. Thank you for your work!

UrbanCMC avatar May 23 '23 15:05 UrbanCMC