Le Mon, Oct 31, 2022 at 01:40:22PM +0100, Stefan Sperling a écrit :
> Today, landry@ asked about a 'git commit -v' style feature as well.
> We rehashed the above discussion in person, and came up with another idea
> to implement something like this. With the patch below, a temporary file
> which contains the diff will be created by 'got commit' while collecting
> changes to include in the commit (meaning the extra overhead is minimal,
> since we avoid a second status crawl to gather changed files for diffing).
> In the log message buffer we add a comment below the list of changed paths
> which displays the path to this file:
> # changes to be committed on branch main:
> # M alpha
> # D beta
> # detailed changes can be viewed in /tmp/got-diff-YOHkcUe0
> This way, users can load the diff into a separate editor buffer to review
> their changes, without risk of cluttering the log message buffer and
> potentially ending up with diff text in their log message.
> The file is deleted automatically once the log message editor exits.
> If needed, a new commit -n flag disables this behaviour. This could
> be useful when the diff to be committed is very large, for example.
as a heavy user of git commit -v, i like this, i just need to highlight
the tmpfile path with the mouse and :s <insert><enter> in vim to view the
diff i'm about to write a large commit message about it. tested working