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

A blank removed line is not shown as changed when it is replaced by another line #1359

Closed
marcbull opened this issue Sep 27, 2022 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@marcbull
Copy link

A blank removed line is not shown as changed when it is replaced by another line.

To Reproduce

Execute the following block to setup the example:

export TEST_REPO=/tmp/test-repo
mkdir -p ${TEST_REPO}
pushd ${TEST_REPO}
git init
printf "###\n\naaa\n\n\n###\n" > example.txt
git add .
git commit -a -m "initial commit"
printf "###\n\naaa\nbbb\n\n###\n" > example.txt
git diff

The git diff shows how it should look like.

Now execute gitui to see the wrong diff view for example.txt.

The gitui doesn't show the removed line as changed before the new bbb line

Expected behavior

The diff of gitui and git diff should be identical.

Thank you very much for this awesome tool.

Software version

gitui 0.21.0

Operating system

macOS 12.6 (Darwin 21.6.0)

Compile time information

  • Profile: release
  • Target triple: aarch64-apple-darwin
  • Family: unix
  • OS: macos
  • Architecture: aarch64
  • Pointer width: 64
  • Endian: little
  • CPU features: aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh
  • Host: aarch64-apple-darwin

Environment variables

SHELL=/bin/zsh
EDITOR=<not set>
GIT_EDITOR=<not set>
VISUAL=<not set>

Command-line

gitui --bugreport
@marcbull marcbull added the bug Something isn't working label Sep 27, 2022
@stale
Copy link

stale bot commented May 21, 2023

This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the dormant Marked by stale bot on close label May 21, 2023
@marcbull
Copy link
Author

Ping

@stale stale bot removed the dormant Marked by stale bot on close label May 22, 2023
@conor-byrne
Copy link

Would just like to second this issue with another example:

git diff:

diff --git a/controller/DC10/Lib/Rabbit4000/RS232.LIB b/controller/DC10/Lib/Rabbit4000/RS232.LIB
index cab9f5d..bba9dc1 100644
--- a/controller/DC10/Lib/Rabbit4000/RS232.LIB
+++ b/controller/DC10/Lib/Rabbit4000/RS232.LIB
@@ -4891,12 +4891,11 @@ spx_isr::
                ld              hl, lxpc
                push    hl

-
+#if defined(SER_INSTRUMENT)
       ld hl, (ser_isrs)
       inc hl
       ld (ser_isrs), hl
-
-
+#endif

                ; IX = serXdata, IY = SxDR
 ioi    ld              a, (iy+SxSR_OFS)

gitui:
image

Software version

gitui 0.22.1 (234e7cb)

Operating system

Windows 6.2.9200

Compile time information

  • Profile: release
  • Target triple: x86_64-pc-windows-msvc
  • Family: windows
  • OS: windows
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2
  • Host: x86_64-pc-windows-msvc

Environment variables

SHELL=<not set>
EDITOR=<not set>
GIT_EDITOR=<not set>
VISUAL=<not set>

Command-line

"C:\Program Files\gitui\bin\gitui.exe" --bugreport newlines

Using powershell 7 in windows terminal

@extrawurst
Copy link
Owner

We could also fill in a minus-char to visualize the empty line being removed 👍

@extrawurst extrawurst added this to the v0.24 milestone Aug 10, 2023
@extrawurst extrawurst added the good first issue Good for newcomers label Aug 11, 2023
@extrawurst
Copy link
Owner

Screenshot 2023-08-11 at 16 42 16

extrawurst added a commit that referenced this issue Aug 12, 2023
extrawurst added a commit that referenced this issue Aug 12, 2023
Revert "visualize empty line in diff better (closes #1359)"

This reverts commit 6576c7e.
extrawurst added a commit that referenced this issue Aug 14, 2023
Revert "visualize empty line in diff better (closes #1359)"

This reverts commit 6576c7e.
extrawurst added a commit that referenced this issue Aug 16, 2023
Revert "visualize empty line in diff better (closes #1359)"

This reverts commit 6576c7e.
IndianBoy42 pushed a commit to IndianBoy42/gitui that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants