1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-10-23 17:48:30 +03:00

Move parentHashes and divergence fields before extraInfo in git log format

Like message, extraField can get very long (when there are thousands of tags on
a single commit), so move it to the end; this allows us to truncate overly long
lines in the output and still get all the essential fields.

Co-authored-by: Stefan Haller <stefan@haller-berlin.de>
This commit is contained in:
neo
2025-07-27 18:13:32 +02:00
committed by Stefan Haller
parent 15f8ad31e0
commit c54232e863
2 changed files with 20 additions and 20 deletions

View File

@@ -206,12 +206,12 @@ func (self *CommitLoader) extractCommitFromLine(hashPool *utils.StringPool, line
unixTimestamp := split[1]
authorName := split[2]
authorEmail := split[3]
extraInfo := strings.TrimSpace(split[4])
parentHashes := split[5]
parentHashes := split[4]
divergence := models.DivergenceNone
if showDivergence {
divergence = lo.Ternary(split[6] == "<", models.DivergenceLeft, models.DivergenceRight)
divergence = lo.Ternary(split[5] == "<", models.DivergenceLeft, models.DivergenceRight)
}
extraInfo := strings.TrimSpace(split[6])
message := split[7]
var tags []string
@@ -614,4 +614,4 @@ func (self *CommitLoader) getLogCmd(opts GetCommitsOptions) *oscommands.CmdObj {
return self.cmd.New(cmdArgs).DontLog()
}
const prettyFormat = `--pretty=format:+%H%x00%at%x00%aN%x00%ae%x00%D%x00%P%x00%m%x00%s`
const prettyFormat = `--pretty=format:+%H%x00%at%x00%aN%x00%ae%x00%P%x00%m%x00%D%x00%s`