jesseduffield / lazygit

simple terminal UI for git commands
MIT License
53.49k stars 1.86k forks source link

add ability to run `lazygit origin/other-branch` #1106

Open teto opened 3 years ago

teto commented 3 years ago

Is your feature request related to a problem? Please describe. A feature I like in tig is that I can quickly check other branches with tig origin/other-branch. I would like to start lazygit similarly with lazygit origin/other-branch and have it use the specific branch.

jesseduffield commented 3 years ago

Would you want it to open with that branch selected in the branches panel, and with the branches panel maximised? That sounds simple enough to me. Although I would use an arg like lazygit -b origin/other-branch

teto commented 3 years ago

I would like to see the commits of that branch. But I didn't know you could maximize the branch-panel, how do you do that ? it might be more interesting, I need to try first. I think it's ok to have a flag if you want to reserve posiitional args for future usage.

jesseduffield commented 3 years ago

In pkg/gui/gui.go we use a half screen for when you pass the -f flag for filtering commits based on file:

    initialContext := contexts.Files
    if filterPath != "" {
        screenMode = SCREEN_HALF
        initialContext = contexts.BranchCommits
    }

Within the app you can also maximise a window with + and -

teto commented 3 years ago

ho cool indeed ! I tmay make sense to maximize the window or at least put it half screen. If there is a flag to control this, then it's not necessary. I am a very basic user of lazygit, I use it mostly to git add (-p) files when I think it will be faster than the terminal's. I prefer to use tig to navigate at commits, out of habits so that's not an informed decision :)

jesseduffield commented 3 years ago

Yeah tig is better with viewing commits at the moment, but soon enough we will overtake it and achieve world domination!