Skip to content

Commit

Permalink
fixup! Expose {{.SelectedCommitRange}} to custom commands
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaller committed Jan 25, 2025
1 parent 0531dde commit 9e57418
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Custom_Command_Keybindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ CheckedOutBranch

To see what fields are available on e.g. the `SelectedFile`, see [here](https://github.com/jesseduffield/lazygit/blob/master/pkg/gui/services/custom_commands/models.go) (all the modelling lives in the same file).

We don't support accessing all elements of a range selection yet; the properties above only give you the moving end of the range. We might add this in the future, but as a special case you can access the range of selected commits by using `SelectedCommitRange`, which has two properties `.To` and `.From` which are the hashes of the bottom and top selected commits, respectively. This is useful for passing them to a git command that operates on a range of commits. For example, to create patches for all selected commits, you might use
We don't support accessing all elements of a range selection yet. We might add this in the future, but as a special case you can access the range of selected commits by using `SelectedCommitRange`, which has two properties `.To` and `.From` which are the hashes of the bottom and top selected commits, respectively. This is useful for passing them to a git command that operates on a range of commits. For example, to create patches for all selected commits, you might use
```yml
command: "git format-patch {{.SelectedCommitRange.From}}^..{{.SelectedCommitRange.To}}"
```
Expand Down

0 comments on commit 9e57418

Please sign in to comment.