Skip to content

Expose selected commit ranges to custom commands #4184

Closed
@Mic92

Description

Is your feature request related to a problem? Please describe.

Currently we can access a single selected commit via {{.SelectedCommit.Sha}}.
However using the v key it's also possible to select multiple commits.
I.e. this allows to create a pull request from a range of commits or doing other types of automation that require access to multiple commits.

Describe the solution you'd like

A potential API could look like thi
s:
{{.SelectedCommits.StartSha}} {{.SelectedCommits.EndSha}}

Describe alternatives you've considered

Can't think of a different way

From my understanding this needs to extend

https://github.com/jesseduffield/lazygit/blob/master/pkg/gui/services/custom_commands/session_state_loader.go#L203

The only thing that is unclear to me is what should happen if the user has not selected anything?

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions