Vscode-git-graph: Add text box for searching logs

Created on 13 Mar 2019  路  7Comments  路  Source: mhutchie/vscode-git-graph

I think we should add the text box on the right side of Branch dropdown. We can input some keywords to searching for logs by commit message, commit ID... The results will be displayed in a table which likes the current table that we have. I think this feature will very helpful for anyone!

feature request

Most helpful comment

This will be available in v1.9.0. Thanks everyone for your interest in this feature request!

If you'd like to use it before the next release, you can download v1.9.0-beta.2, and install it following the instructions provided here.

FYI: @huukimit, @paradoXp, @ArturoRis, @t-gehring

All 7 comments

Thanks for the suggestion!

Thanks everyone for your interest in this feature request! This will definitely be coming soon to the extension.

Just to give you all an update on its progress:

I've been working on searching/filtering the commits in the Git Graph view for some time now, in the background of other development for this extension. I'm trying to come up with a really nice way of incorporating it visually in the extension. I'm pretty happy with how it's coming along, and since after 1.8.0 (being released tomorrow) all higher priority feature requests will be done, this will become the next main feature that I'll be focused on implementing.

This will be available in v1.9.0. Thanks everyone for your interest in this feature request!

If you'd like to use it before the next release, you can download v1.9.0-beta.2, and install it following the instructions provided here.

FYI: @huukimit, @paradoXp, @ArturoRis, @t-gehring

The current implementation is a nice start, but it would be really great if the commits could be filtered to just the find results, instead of having the full graph (though I realise this would be trickier to implement).

Toggleable regex and case-matching support would also be a nice plus, to match the functionality of the main editor find widget.

One small issue is that when the find widget is visible, it covers the fetch and refresh buttons, so they can't be used. There's a lot of free space in the top bar currently - might it make sense to have the find widget integrated with the top bar, instead of popping over it?

@t-gehring:

Originally I was wanting to filter the commits themselves, however it would be an unjustifiable amount of work to implement it for now, given there are other features waiting to be implemented.

I've just released v1.9.0-beta.1 which adds case matching support since you asked for it.

I don't think regex patterns are necessary given the semantics of the text being shown. I can't think of a useful regex pattern that could be used to search on the commit hash, or the unstructured text of author, date & commit message. Some regex patterns are possible if the user has a standardised pattern for naming branches / tags, although I think this wouldn't be frequently used over what is currently available, which I think should suffice for now. Typically regex searches are provided when the data is: structured, inherently case sensitive (like code), or editable. (none of which is true in this case)

I tried adjusting the position of the find widget so that it didn't cover the control buttons when I initially implemented it, however I decided not to as:

  • It meant that it changed its position depending on which buttons are visible (fetch is only visible if remotes exist on the repo).
  • Although it may better to mover it further left with decent resolution monitors (or width VS Code editor panels), on lower widths it then covered up the repo / branches dropdowns or show remotes instead (arguably more important). I also thought that most users wouldn't be wanting to fetch or manually refresh (without the keystroke), while also finding - the two tasks don't have a common overlap.
  • By fixing it to where I currently have it, it is exactly the same position as the editor find widget.

The reason I asked about regexes is that my repo has commits with a message of "bXXXX" to mark an increased build number. Simply searching for "b" would give too many false positives, and without regexes there's no way to find "b followed by several digits". It's also useful if you're looking for commits dealing with a particular issue, but you're unsure how it's worded.

Javascript has built-in support for regexes, so it shouldn't be too difficult to add, and in fact the non-regex matching could be implemented by escaping the input and using that as the regex. The special case of only matching the start of a commit hash can be done by prepending ^ to the regex pattern.

I agree that a lot of the time, a single text search will suffice, but occasionally regexes can be extremely handy, and while commit messages aren't _inherently_ structured, they can gain structure through a project's internal standards. Given that it should hopefully be a minor change to the code, I really hope you consider it.

As far as the position of the find widget, I see your issues. I mainly use a fairly wide monitor with VS Code full-screen, so I hadn't considered how my suggestion would be problematic with a narrower window. The consistency with the editor find widget is also a good reason to keep it as it is.

@t-gehring:

I've just released v1.9.0-beta.2 which adds regex support.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kanlukasz picture kanlukasz  路  3Comments

fsteinmetz picture fsteinmetz  路  5Comments

Wosi picture Wosi  路  5Comments

Kevinwuu picture Kevinwuu  路  3Comments

bboehmke picture bboehmke  路  6Comments