jesseduffield / jesseduffield/lazygit

Could we make .SelectedLocalCommit.Sha support index?

Open
#1,773 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Is your feature request related to a problem?**
I'm afraid the .SelectedLocalCommit.Sha doesn't support index.

**Describe the solution you'd like**
I tried to add a custom command **git diff --name-only sha1^..sha2**
However, .SelectedLocalCommit.Sha doesn't support index like {{index .PromptResponses 0}}
I have to use an alter solution
Here is my snippets:
```
customCommands:
- key: ''
description: 'list files changed from parent commit'
command: "git diff --name-only {{.SelectedLocalCommit.Sha}}^"
context: 'commits'
subprocess: true
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.