gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Flag to automatically open at file

Open JulianoCaldo opened this issue 11 months ago • 5 comments

Is your feature request related to a problem? Please describe. I like to use gitui integrated on my neovim environment, so it makes easier to manage stuff. Even tough neovim has others plugin to manage file chnge history, gitui is simply better. However, navigating until the file to check for the history every time gitui is opened is kinda annoying, if there was an automatic way to invoke it everything would be a lot better.

Describe the solution you'd like Add a flag "--file [path]" and gitui will be automatically invoked on the File Tab focusing the filepath.

JulianoCaldo avatar Feb 07 '25 17:02 JulianoCaldo

Do you want it to just go to the file-tab or even open up that files history directly?

extrawurst avatar Feb 07 '25 19:02 extrawurst

When writing I was thinking mostly about the file-tab, cuz over there is always massive at my work.

JulianoCaldo avatar Feb 14 '25 04:02 JulianoCaldo

File list and history view was the main reason for me to move to gitui! So replacement for gitk filename.ext would be really nice.

miikalaaksonen avatar Mar 20 '25 11:03 miikalaaksonen

File list and history view was the main reason for me to move to gitui! So replacement for gitk filename.ext would be really nice.

This would be similar behavior as git log filename.txt, right? man gitk says:

       <path>...
           Limit commits to the ones touching files in the given paths. Note, to
           avoid ambiguity with respect to revision names use "--" to separate the
           paths from any preceding options.

man git log says:

      [--] <path>...
           Show only commits that are enough to explain how the files that match
           the specified paths came to be. See History Simplification below for
           details and other simplification modes.

           Paths may need to be prefixed with -- to separate them from options or
           the revision range, when confusion arises.

naseschwarz avatar Mar 20 '25 11:03 naseschwarz

This would be similar behavior as git log filename.txt, right? man gitk says:

Yes and no. The whole point of using gitk is that you can scroll through history and see diffs while you press up and down like in gitui history view.

miikalaaksonen avatar Mar 20 '25 12:03 miikalaaksonen

@extrawurst

Do you want it to just go to the file-tab or even open up that files history directly?

Just going to the file tab with the file selected would be great! Then you can use Blame etc. as well.

I'm working on a PR.

laktak avatar Oct 23 '25 14:10 laktak