Skip to content

Hunk staging / unstaging / reset does not work for number of context lines != 3 #1746

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

Closed
raphCode opened this issue Jul 5, 2023 · 0 comments · Fixed by #1803
Closed

Hunk staging / unstaging / reset does not work for number of context lines != 3 #1746

raphCode opened this issue Jul 5, 2023 · 0 comments · Fixed by #1803
Labels
bug Something isn't working
Milestone

Comments

@raphCode
Copy link

raphCode commented Jul 5, 2023

Describe the bug
In the options, the number of context lines must be set to exactly 3, otherwise hunk management does not work at all.
That is, staging / unstaging / resetting of whole hunks.

To Reproduce
Steps to reproduce the behavior:

  1. Have multiple unstaged changes scattered across a file, e.g. in line 1 and line 10
  2. Open gitui in the first Tab (Status)
  3. Press O
  4. Set the option Context lines to any other number than 3
  5. Try to stage a single hunk by selecting it and pressing Enter (nothing happens)
  6. Stage the whole file
  7. Try to unstage a single hunk by selecting it and pressing Enter (error: hunk not found)
  8. Unstage the whole file
  9. Try to reset a hunk by selecting it and pressing Shift D (crash: hunk not found)

Expected behavior
Staging, unstaging and resetting works like with number of context lines = 3

Context (please complete the following information):

  • OS: Arch
  • GitUI Version 0.23.0

Related issues:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants