Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
derrickstolee opened this issue Nov 3, 2020 · 4 comments
Closed

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

derrickstolee opened this issue Nov 3, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@derrickstolee
Copy link

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.

@derrickstolee derrickstolee added the potential-bug Seems like something isn't working label Nov 3, 2020
@eamodio
Copy link
Member

eamodio commented Nov 3, 2020

@derrickstolee Thank you for the report! I will update the code and remove the --follow in the line case.

@derrickstolee
Copy link
Author

Thanks, @eamodio. I think that also the issue is the -- file part, so please be sure to avoid that portion in the line case.

@eamodio eamodio closed this as completed in 9985479 Nov 3, 2020
eamodio added a commit that referenced this issue Nov 3, 2020
@eamodio
Copy link
Member

eamodio commented Nov 3, 2020

GitLens 10.2.3 has been published with the fix, and I'll get it fixed in the upcoming v11 release

@eamodio eamodio self-assigned this Nov 3, 2020
@eamodio eamodio added bug Something isn't working and removed potential-bug Seems like something isn't working labels Nov 3, 2020
@eamodio eamodio added this to the Soon™ milestone Nov 3, 2020
eamodio added a commit that referenced this issue Nov 4, 2020
@eamodio eamodio removed this from the Soon™ milestone Dec 2, 2020
@github-actions
Copy link

github-actions bot commented Jan 2, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants