Skip to content

Clarify search by changes vs. changed lines #730

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

Closed
borekb opened this issue Apr 30, 2019 · 5 comments
Closed

Clarify search by changes vs. changed lines #730

borekb opened this issue Apr 30, 2019 · 5 comments
Assignees

Comments

@borekb
Copy link

borekb commented Apr 30, 2019

Just from the title / tooltip of the actions, it's not clear what's the difference between the two:

Screenshot 2019-04-30 at 15 13 24

This is what they do:

https://github.com/eamodio/vscode-gitlens/blob/5020fe18f0972f060a247976530b6e91fb97099d/src/git/gitService.ts#L1415-L1420

The harder part is how to explain the difference 😄 This StackOverflow answer is quite nice.

In GitLens' UI, it would at least be useful to add this:

  • or, by changes (-G)
  • or, by changed lines (-S)

Suggestion for respective tooltips:

  • "Show commits whose diffs contain the pattern"
  • "Show commits that add or delete the pattern"
@borekb
Copy link
Author

borekb commented Apr 30, 2019

If there would be way to link to that SO answer or any other similar resource that contains an example, that would be very useful as well. I always have to google it 😄.

@eamodio eamodio self-assigned this Apr 30, 2019
@eamodio eamodio added this to the Soon™ milestone Apr 30, 2019
@eamodio
Copy link
Member

eamodio commented May 1, 2019

@borekb I'm very tempted to just remove the -S variant as having 2 is quite confusing and the -G version is much more likely what people would expect. Also even the git docs say that -S is Intended for the scripter’s use: https://git-scm.com/docs/git-log#Documentation/git-log.txt--Sltstringgt

Thoughts?

@borekb
Copy link
Author

borekb commented May 2, 2019

I generally agree, however, I just had a situation where I needed to look for instances of a string that was removed from code, so "changed lines" is what I needed to use.

Still, I think you're right and that for the most part, having two very similar options is not worth it. If you could think of a way to hint at the other option, maybe hide it in the "..." menu as an advanced option or something, that would probably be best but if that feels too cumbersome, I'm fine with keeping just the -G option.

@borekb
Copy link
Author

borekb commented May 2, 2019

BTW, looking at my original post, is the current code even correct? GitRepoSearchBy.Changes uses '--pickaxe-regex -S while GitRepoSearchBy.ChangedLines uses -G; shouldn't it be the other way around?

@eamodio eamodio closed this as completed in 3e8603b May 6, 2019
@eamodio eamodio removed this from the Soon™ milestone Jul 19, 2019
@github-actions
Copy link

github-actions bot commented Dec 1, 2020

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 Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants