Skip to content

File quick history shows many irrelevant merge commits #2104

@ian-h-chamberlain

Description

@ian-h-chamberlain

GitLens Version

v12.1.2

VS Code Version

Version: 1.69.2
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Date: 2022-07-18T16:12:57.074Z
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Darwin x64 21.5.0

Git Version

git version 2.37.0

Description

There appears to be a regression from #259 – I am not sure in what version the behavior changed, but I am once again seeing lots of irrelevant merge commits in the "quick file history".

This is my Gitlens-related config:

Details
{
    "gitlens.advanced.fileHistoryFollowsRenames": true,
    "gitlens.advanced.messages": {
        "suppressCommitHasNoPreviousCommitWarning": false,
        "suppressCommitNotFoundWarning": false,
        "suppressFileNotUnderSourceControlWarning": false,
        "suppressGitVersionWarning": false,
        "suppressLineUncommittedWarning": false,
        "suppressNoRepositoryWarning": false,
    },
    "gitlens.blame.avatars": false,
    "gitlens.blame.highlight.locations": [
        "gutter",
        "line",
        "overview"
    ],
    "gitlens.codeLens.authors.enabled": false,
    "gitlens.codeLens.enabled": false,
    "gitlens.codeLens.recentChange.enabled": false,
    "gitlens.currentLine.enabled": true,
    "gitlens.hovers.currentLine.enabled": true,
    "gitlens.hovers.currentLine.over": "annotation",
    "gitlens.keymap": "alternate",
    "gitlens.menus": {
        "editor": {
            "blame": true,
            "clipboard": true,
            "compare": true,
            "details": true,
            "history": true,
            "remote": true,
        },
        "editorGroup": {
            "blame": true,
            "compare": true,
        },
        "editorTab": {
            "clipboard": true,
            "compare": true,
            "history": true,
            "remote": true,
        },
        "explorer": {
            "clipboard": true,
            "compare": true,
            "history": true,
            "remote": true,
        },
        "scmGroup": {
            "compare": true,
            "openClose": true,
            "stash": true,
            "stashInline": true,
        },
        "scmItem": {
            "clipboard": true,
            "compare": true,
            "history": true,
            "remote": true,
            "stash": true,
        }
    },
    "gitlens.mode.active": "review",
    "gitlens.mode.statusBar.enabled": false,
    "gitlens.plusFeatures.enabled": false,
    "gitlens.statusBar.enabled": false,
    "gitlens.views.repositories.autoRefresh": false,
}

Toggling gitlens.advanced.fileHistoryFollowsRenames, as described in that issue, seems to have no effect.

Logs, Screenshots, Screen Captures, etc

The git command that appears to be running, when I turned on debug logging, for fileHistoryFollowsRenames false (reformatted for readability):

 git log --format=%x3c%x2ff%x3e%n%x3cr%x3e%x20%H%n%x3ca%x3e%x20%aN%n%x3ce%x3e%x20%aE%n%x3cd%x3e%x20%at%n%x3cn%x3e%x20%cN%n%x3cm%x3e%x20%cE%n%x3cc%x3e%x20%ct%n%x3cp%x3e%x20%P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e \
	-n201 -m --numstat --summary $branch -- go.mod 

And, for fileHistoryFollowsRenames = true:

git log --format=%x3c%x2ff%x3e%n%x3cr%x3e%x20%H%n%x3ca%x3e%x20%aN%n%x3ce%x3e%x20%aE%n%x3cd%x3e%x20%at%n%x3cn%x3e%x20%cN%n%x3cm%x3e%x20%cE%n%x3cc%x3e%x20%ct%n%x3cp%x3e%x20%P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e \
	-n201 --follow --first-parent -m --numstat --summary $branch -- go.mod 

As mentioned in this comment (#259 (comment)), the -m --first-parent seems to be part of the problem here. I get the best output (closest to what I would like in the file history view) when I run (with or without --follow):

git log -n7 --follow  --oneline --summary $branch -- go.mod

Maybe it would makes sense to have a configuration value for whether -m is used at all in the command?

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions