Skip to content

Git: "-LX,Y:file" and "-- file" are incompatible #1139

@derrickstolee

Description

@derrickstolee

The important issue here is using Git v2.29.x. Please see this Git mailing list discussion for more context.

The basics here is that GitLens is combining two options that should not be allowed:

git log --follow -LX,Y:file -- file

The use of --follow and -- file with -LX,Y:file should not be compatible in Git. So far, Git has not complained and worked correctly. In v2.29.[0-2], Git changed logic slightly such that this results in a segfault!

The plan of record is for Git to ship a new version that fixes the segfault. However, this might not be the end of the fix. Likely, such use will lead to a failed Git command with a warning message over stderr.

Possibly the logic here needs to change:

		if (startLine == null || renames) {
			// Don't specify a file spec when using a line number (so say the git docs), unless it is a follow
			params.push('--', file);
		}

That is, the || renames is probably invalid here. We don't want to combine -- file with -LX,Y:file. In general Git would interpret those as two separate requests for history limitation that are incompatible.

To assist GitLens users who are on a buggy version of Git and to future-proof GitLens against a possibly disruptive change in a later version of Git, it might be best to change this logic now.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions