extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.56k stars 573 forks source link

edit cmd misleading when focusing commit msg in inspect view #1645

Open aktdaaaa opened 1 year ago

aktdaaaa commented 1 year ago

Describe the bug This is the best git tool, light, simple and visual! However, I have found one that does not work as intended. When in inspect mode on the Log tab, I cannot edit the commit message by clicking shift + i (vim keybinding).

To Reproduce Steps to reproduce the behavior:

  1. Go to Log tab
  2. Click on enter and l(Inspect)
  3. Focus Message block
  4. click shift + i

Expected behavior Able to edit commit messages.

Screenshots If applicable, add screenshots to help explain your problem.

Context (please complete the following information):

Additional context Log of the operation.

14:53:56 [TRACE] (6) mio::poll: [/Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/mio-0.8.5/src/poll.rs:532] registering event source with poller: token=Token(0), interests=READABLE
14:53:56 [TRACE] (1) gitui::watcher: [src/watcher.rs:21] poll watcher: false recommended: Fsevent
14:53:56 [TRACE] (6) mio::poll: [/Users/brew/Library/Caches/Homebrew/cargo_cache/registry/src/github.com-1ecc6299db9ec823/mio-0.8.5/src/poll.rs:532] registering event source with poller: token=Token(1), interests=READABLE
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:119] open repo at: RefCell { value: Path(".") }
14:53:56 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:56 [TRACE] (1) gitui: [src/main.rs:200] app start: 4 ms
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:477] update
14:53:56 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Tags)
14:53:56 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Branches)
14:53:56 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Tags)
14:53:56 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Branches)
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Log)
14:53:56 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:56 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Log)
14:53:56 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:58 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Enter, modifiers: NONE, kind: Press, state: NONE }))
14:53:58 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:58 [TRACE] (1) asyncgit::commit_files: [asyncgit/src/commit_files.rs:83] request: CommitFilesParams { id: CommitId(d37cf315857616304739afcc65155f049347c25f), other: None }
14:53:58 [TRACE] (2) asyncgit::commit_files: [asyncgit/src/commit_files.rs:128] get_commit_files: CommitFilesParams { id: CommitId(d37cf315857616304739afcc65155f049347c25f), other: None } (1)
14:53:58 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(CommitFiles)
14:53:58 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:53:58 [DEBUG] (8) gitui::watcher: notify events: 1
14:53:58 [DEBUG] (8) gitui::watcher: notify [0]: DebouncedEvent { path: "/Users/aktdaaaa/sample/.git/gitui", kind: Any }
14:53:58 [TRACE] (1) gitui::app: [src/app.rs:477] update
14:53:58 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:54:00 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Char('l'), modifiers: NONE, kind: Press, state: NONE }))
14:54:00 [TRACE] (1) asyncgit::commit_files: [asyncgit/src/commit_files.rs:83] request: CommitFilesParams { id: CommitId(d37cf315857616304739afcc65155f049347c25f), other: None }
14:54:00 [TRACE] (1) gitui::app: [src/app.rs:477] update
14:54:00 [TRACE] (2) asyncgit::commit_files: [asyncgit/src/commit_files.rs:128] get_commit_files: CommitFilesParams { id: CommitId(d37cf315857616304739afcc65155f049347c25f), other: None } (1)
14:54:00 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:54:00 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(CommitFiles)
14:54:00 [TRACE] (1) asyncgit::tags: [asyncgit/src/tags.rs:67] request
14:54:00 [TRACE] (1) asyncgit::diff: [asyncgit/src/diff.rs:98] request DiffParams { path: "DataTypes.md", diff_type: Commit(CommitId(d37cf315857616304739afcc65155f049347c25f)), options: DiffOptions { ignore_whitespace: false, context: 3, interhunk_lines: 0 } }
14:54:00 [TRACE] (1) gitui::app: [src/app.rs:496] update_async: Git(Diff)
14:54:01 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Char('k'), modifiers: NONE, kind: Press, state: NONE }))
14:54:03 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Char('I'), modifiers: SHIFT, kind: Press, state: NONE }))
14:54:05 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Char('I'), modifiers: SHIFT, kind: Press, state: NONE }))
14:54:05 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Char('I'), modifiers: SHIFT, kind: Press, state: NONE }))
14:54:07 [TRACE] (1) gitui::app: [src/app.rs:382] event: Input(Key(KeyEvent { code: Char('c'), modifiers: CONTROL, kind: Press, state: NONE }))
extrawurst commented 1 year ago

Go to Log tab Click on enter and l(Inspect) Focus Message block click shift + I

can you show me a screenshot of this status? there is actually no command registered to allow editing a commit message in this view. so I am not sure why you think shift + I should do anything?

aktdaaaa commented 1 year ago

@extrawurst I guess I was mistaken. But if you focus on Message as follows, Edit appears in the footer as an option

image

extrawurst commented 1 year ago

good point. that's a bug. its the edit command to edit a file in the file-tree view

stale[bot] commented 1 year ago

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.

extrawurst commented 8 months ago

we should simply not show this command if no file to edit is selected

ondrej-ivanko commented 5 months ago

This issue seems resolved to me. I couldn't find any occurrence where selecting anything but file allowed file edit. In some cases where it makes sense the edit command is greyed out indicating it can't be used. It's noticeable in file tree view when hovering over directory name.

It makes less sense to show edit cmd when inspecting files changed in single commit. Since you don't expect to edit commit files, just look up the changes, it's bit strange.