- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 638
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Sometimes I want to look at something specific, like a file blame or a branch view. Currently this means starting gitui
and navigating to that state. This is redundant, especially when having to navigate to a file and open the blame view, instead of opening a blame from the terminal directly.
Describe the solution you'd like
Some tig-like cli arguments:
blame <file_path>
to directly open gitui in a file blame view<refspec>
to start with a log view at that refspecstash
to start with the stashes view
Describe alternatives you've considered
Manually doing the navigation after opening gitui
.
ShamrockLee and ilyagr
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
[-]TIg-like command line arguments for startup mode[/-][+]Tig-like command line arguments for startup mode[/+]extrawurst commentedon Oct 7, 2022
Current master at least remembers the current tab. This functionality could be extended to remember more state of the current view
chrisant996 commentedon Oct 24, 2022
This is a great tool. I would love to use it fulltime instead of
gitk
, especially for viewing file logs.The startup friction is prohibitive, though, due to not yet having a command line interface for providing startup context.
I can type
gitk somefile
orgitk somecommit -- somefile
.Or press Up to a command history entry containing
somefile
and then replacesomeprogram
withgitk
.Or launch them via an editor macro, etc.
From my editor, it's two keystrokes to launch
gitk
on the current file.There's no in-built way to accomplish that with
gitui
.I haven't looked at the code yet, but the UI makes it look like the internals are probably modular and probably wouldn't take much effort to initialize the UI state based on command line args, instead of manual input within the program.
Unfortunately, I haven't dabbled in Rust yet, so this isn't something I'll be able to contribute to soon.
stale commentedon May 21, 2023
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.
ShamrockLee commentedon May 21, 2023
This is definitely the feature set I would need the most.
chrisant996 commentedon Jan 27, 2025
@extrawurst I have a prototype change that introduces the following subcommands (see patch below):
gitui status
starts in the Status tab, overriding the saved tab.gitui log
starts in Log tab, overriding the saved tab.gitui files
starts in Files tab, etc.gitui stashing
starts in Stashing tab, etc.gitui stashes
starts in Stashes tab, etc.I'm happy to publish a PR for review.
I intend to extend the subcommands to accept args, e.g.
gitui log <file-path>
, but I haven't implemented them yet.Before I go further, I think it would be helpful to discuss subcommands in general for
gitui
:blame
and etc subcommands.quit_state
loop? My prototype passes optional state intorun_app
, and then clears the optional state so it doesn't affect subsequent calls. It feels a little messy to pass in an optional state, butApp
is created insiderun_app
so passing in optional state seems the most direct approach without some refactoring.Here's a patch, for reference: