-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
add a way to remove from ignore file without opening .gitignore file in editor #1402
Comments
maybe I am missing something with your use case, every time I add something to the gitignore by accident this appears as a diff in the status that I can easily revert before committing? |
may I ask how you do that revert? there is a "Reset" with shift+D shortcut (modifiers are shown in weird symbols by the way) and it also seems to be prone to accidents. it reverted gitignore file but then I have just removed that test file too (gone forever). is this what you are referring to? |
Hi @extrawurst , you closed the request but my intention for the request still holds open: "add a way to remove from ignore file" Resetting hunk is valid only when you want to discard all changes from last commit. But it does not offer a solution for "accidental" addition to the ignore file. Let me extend with another example situation: you do not have a wildcard option to ignore files, so you are selecting them by hand. there are many file you are trying to ignore and you want to remove few among other. the ones you want to remove might just slipped by, or you decided not to ignore, or even some old ones you want to un-ignore. Resetting the changes/hunks is not suitable for this purpose, and opening an editor means leaving the gitui interface and is annoying. meanwhile, I see a "reset lines [d]" and "stage lines [s]" commands that seemingly not doing anything while unstaged, and "unstages line [s]" for staged file that is close to what I describe, but moving between staged and unstaged is confusing. as this is a feature request post, its implementation may even take 1-2 years. or you may mark it with some "not implementing" message. I hope you reconsider your decision to close. PS: what are these "reset lines [d]" and "stage lines [s]" commands and why I could not make them work? bug maybe? |
you are right, the granular lines based ops do not support reverting lines that are unstaged. see #582 - this makes this issue a duplicate |
conceptually gitui is not intended to be a substitute for your editor, that's why couples edits to the commit message send you to an editor. for any complex ignore file changes I apply the same. but yea #582 will solve your particular use case |
Alright, for the moment I will try this partial staging. from your linked issue, I followed jumped to an older one. #59 (comment) that comment of yours shows them working, and later you merged a commit, but "reset/stage lines" do not work for me on v0.22.1 for windows. shall I open a new bug report, |
for sure, with a repro, that would be ideal |
I was thinkering about how to make a video to show you the reset/stage lines, and have found an interesting solution to the main problem of this discussion.
PS: "d" key works this way but "s" is still doing nothing while file is under unstaged changes. video-convert-1677001847037.webm |
scratch that. this "stage lines [s]" works under the conditions that:
are the ones in my post above and this sequence here something you had in mind when you implemented these functions? (I will not post a new issue for the moment about this) video-convert-1677002938368.webm |
Is your feature request related to a problem? Please describe.
I am new to gitui and wanted to give it a try. it is pretty nice but "ignoring" a file by accident has become a pain and seems to be so until you add this feature.
while trying it in a fresh folder with a single file in it, accidentally pressed
i
and new.gitignore
file is created with that file's name in it. none of the actions has anything to revert this incident and editing needs an editor (namely nano for default settings which is not installed).Describe the solution you'd like
I can think of 2 possible solutions:
Describe alternatives you've considered
an alternative would be trying to play with settings which would take more learning/remembering
Additional context
...
The text was updated successfully, but these errors were encountered: