-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
e
in commits view should git show
#3902
Comments
The current behavior of If anything, what bothers me about it is that often the line numbers are off if there are further changes to the file later in the branch. It would (theoretically) be possible to fix this by working out how the line numbers change in the later commits, but that's a lot of work and probably slow. (And doesn't always work, if the hunk that you are looking at has been deleted by a later commit.) What you suggest would be a different command; it's a bit unclear to me how it would be implemented, because the file would have to be saved to a temp file, but when would it be cleaned up? Never? Anyway, you can approximate the behavior with a custom command similar to this one (if you are using VS Code):
|
Interesting! works oppositely in my brain, it makes more sense for me to go back to my editor and search for the file, because subconsciously I assume the file view in commits shows "old files" and I would be wanting to change the file at its current state. I would love to hear if anyone else has opinions on this.
After the editor exits? I assumed that while you have the editor open from lazygit, it holds the thread (because it's being used by the editor), rather than being async. But I guess that wouldn't be the case with vscode, but I'm also even more surprised that there are people who use both vscode and lazygit.
Thank you! I appreciate you making the command for me! However I more so started this issue to discuss whether the default behavior makes sense, rather than get the feature for just myself. So would be lovely to keep this issue open for some more time to see what other people's opinions on this are. Maybe I'm the minority? |
I think "e" keypress in the commit pane is good as it is. I do not find myself editing previous commits so often (most often I only edit the previous commit using git amend).
This is an issue that might affect some people tbh. Worth exploring for a fix. |
@stefanhaller today I learned that |
It turns out that it's not that hard to fix this. Here's a PR: #4119. |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
In the commits view, after you press enter on a commit, you can then press
e
to edit each individual file.Unfortunately, you go and edit the actual file, while it would be a lot more useful to edit the file at that commit. \
Describe the solution you'd like
A clear and concise description of what you want to happen.
git show hash:path
can be used for this! :)The reasoning for the idea, is that you can already press
e
to edit files as they actually are, when in the status view; there doesn't seem to be a convenient way to open a file at some certain commit (you don't always want to checkout)Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: