GitSense Insight: Enhanced Search and Code Change Analytics for GitHub and GitLab

If you are learning about GitSense for the first time, you can think of it, as a supercharger for GitHub and GitLab.  And with it, you can do all of the following, without ever having to leave your favorite Git hosting solution.

  • Search for code, commits and diffs on any branch, from any repo, and in any combination.
  • Analyze code changes on any branch, from any repo, and in any combination.

In a nutshell, GitSense provides always relevant search and analytics.  And it does this through a Chrome extension, which we call GitSense Insight, which lets us integrate directly on top of GitHub and GitLab. 

The source for GitSense Insight is freely available under the MIT License and can be installed manually or through the Chrome webstore

&

Why should you use GitSense Insight?

Without exaggerating, it significantly improves search and code change analytics in GitHub and GitLab, and here's how:

  1. Seamless Code, Commits, and Diffs Search
  2. Enhanced Search Capability
  3. Group/Organizations Insight
  4. Actionable Code Contribution Metrics

and to see it in action, you can search and analyze the repos from these popular GitHub orgs and GitLab groups.

1. Seamless Code, Commits, and Diffs Search

Search as you normally would, and GitSense Insight will take care of the rest.  Whenever you execute a search in GitHub or GitLab, GitSense Insight, will automatically execute a GitSense code, commits and diffs search.  And as you can see in the GIF below, with case-sensitivity on and camelCase matching off, the matching code results, become significantly more manageble.

2. Enhanced Search Capability

  1. Search for commits by title and message. Only applicable for GitHub, since GitLab supports commits search.
  2. Search forked repos. Only applicable for GitHub, since GitLab supports searching forked repos.
  3. Search by full or partial commit shas.
  4. Search one or more branches for code, commits and diffs. 
  5. Search for code by wildcards, case-sensitivity and camelCase settings.
  6. Rapidly filter search results by dates, languages, authors, files/directories and more.

3. Group and Org Level Insight

Just select "Insight", when browsing a group or org, to search and analyze any combination of branches, from any repo.  It's really that simple, and it's really that powerful.

4. Actionable Code Contribution Metrics

Knowing how frequently somebody commits is interesting; knowing what changed is actionable.  With GitSense Insight, you get more than pretty charts, you get insight.

So as you can see, browsing with GitSense Insight, just makes sense, pun intended.  So if you haven't already done so, you can install it manually or through the Chrome webstore

Code Tree Browsing in Bitbucket Server with GitSense

If you do a lot of code reading in Bitbucket Server, you maybe painfully aware that, reading code with a tree, is currently not an option and judging by BSERV-3926, won't be one for a while.  If you are like me and believe tree browsing, to be a must have, for efficient code browsing, you'll be happy to hear, GitSense now makes this possible.  With our uniquely GitSense changes tree, you now have the option to browse your code, without having to jump from one page to another. 

If you would like to install GitSense for Bitbucket Server, you can download both the GitSense Server and Bitbucket addon-on for free.  And if would like to play around with the add-on, you can do so at http://bitbucket-server-demo.gitsense.com.  If you are learning about GitSense for the first time, we recommend you read our previous blog posts, to learn more.

Enable Code Browsing

To enable code browsing, switch to the "Changes tree" tab and then click the code icon. 

And from then on, you can browse the changes tree, like a regular source code tree.  And because this is still a GitSense tree, you can also use it to dig into your codes history, which is something GitLab and GiHub users can't do with Octotree.

If you are looking for a smarter way to browse your code, GitSense for Bitbucket Server, may be the solution you are looking for. 

Relevant Code Searches, Wildcard/Case-sensitive Searches, and More with GitSense for Bitbucket Server

If you have never thought about creating a scaleable code search solution before, i.e. not something built around grep; it may not be obvious, but it's really difficult.  If you have a basic understanding of combinatorics, you can understand why.  Given current technology, if you want to create a scalable code search solution, you can only optimize it, to do one of the following, but not both.

  • Provide "search discovery", where you can search all your repos at once, but not all your code.
  • Provide "search relevance", where you can search all of your code, but not all of them at once.

Bitbucket Server, along with GitLab and GitHub, optimized their search solutions for "search discovery", while GitSense, optimized for "search relevance".  Both approaches, has their pros and cons, and in this blog, we'll quickly highlight how GitSense, brings "search relevance" to Bitbucket Server, along with other, uniquely GitSense, search enhancements. 

If you would like to install GitSense for Bitbucket Server, you can download both the GitSense Server and Bitbucket addon-on for free.  And if would like to play around with the add-on, you can do so at http://bitbucket-server-demo.gitsense.com.  If you are learning about GitSense for the first time, we recommend you read our previous blog posts, to learn more.

How GitSense Makes Code Searching Better

  1. Relevant Code Searches
  2. Predictable Matches
  3. Wildcard, Case-sensitive and CamelCase Searches
  4. Commit Traceable
  5. Code Tree

1. Relevant Code Searches

When you search for code with Bitbucket Server and by extension GitLab and GitHub, you can only ever match, what exists on the repos default branch.  This means, any matches found may or may not be relevant to what you are looking for.  This is why, you might get no matches, when you know the code exists.  Or why the results returned, was not what you were expecting.

With GitSense, search relevance is never an issue, since you can search any branch, from any repo, and in any combination.  However, search relevance does have its downside, as it's not designed for searching millions of repos at once.  For the best code searching experience, you'll probably want to search with both GitSense and Bitbucket Server, since they are both optimized, for two different use cases.

2. Predictable Matches

When it comes to queries, GitSense tries to its best, to honour what you are looking for.  For example, if you click on the following links, a code search for "target.present", will be executed with both GitSense and Bitbucket Server.

GitSense
http://bitbucket-server-demo.gitsense.com/plugins/servlet/gitsense/ACME/gitlab-ee#b=bitbucket-server:ACME/gitlab-ee:master&q=target.present&t=code

Bitbucket Server
http://bitbucket-server-demo.gitsense.com/plugins/servlet/search?q=project%3AACME%20repo%3Agitlab-ee%20target.present

And as you can tell by the results, there is a big difference with how GitSense and Bitbucket, both treat the query.  With GitSense, it knows you want to find something that best matches "target", followed by a "dot", then followed by "present".  And it constructs a query that best represents this, which is why only 2 matches were returned.

With Bitbucket, it translated the query to "target AND present", which is why 77 matches were returned.  If you want to match "target.present" with Bitbucket, you'll have to quote it, like such:

http://bitbucket-server-demo.gitsense.com/plugins/servlet/search?q=project%3AACME%20repo%3Agitlab-ee%20%22target.present%22

which can be inconvenient, since a common use case for code searching, is to cut and paste search queries.  This means if you paste "target.present", you will have to manually quote it, to get the desired result.

Another example of how GitSense and Bitbucket, differ in their approach to code searching, is it doesn't match camelCase words by default.  For example, if you click on the following links, a code search for "max", will be executed with both GitSense and Bitbucket Server.

GitSense
http://bitbucket-server-demo.gitsense.com/plugins/servlet/gitsense/BIG/go#b=bitbucket-server:BIG/go:master&q=max&t=code

Bitbucket Server
http://bitbucket-server-demo.gitsense.com/plugins/servlet/search?q=project%3ABIG%20repo%3Ago%20max

And as you can tell by the results, GitSense doesn't match "max" in camelCase words.  With GitSense, we try not to make assumptions about what you want to match, which is why camelCase words with "max", are not matched by default.  If you want to match "max" in a camelCase word, you can easily do so, by enabling camelCase matching, as shown in the screen shot below.

3. Wildcard, Case-sensitive, and CamelCase Searches

If you don't quite know exactly what to search for, or if you need to further refine or broaden your search scope, GitSense provides the following handy search options.

Trailing Wildcard Matches

To perform a trailing wildcard search, add an asterisk (*) to your search term.  For example:

foo* => will match foobar, foot, etc.

However, the asterisk must be preceeded by 3 characters.

fo* => too short
f*  => too short

Case-sensitive

By default, code searches are case-insensitive.  To enable case-sensitive searches, click the checkbox beside the "Case-sensitive" option, as shown below.

CamelCase Matching

As explained in the previous section, GitSense doesn't match compounded camelCase words by defaut, and we do this to reduce search noise.  For when you do want to search camelCase words, you can easily do so, by enabling it, as shown below.

4. Commit Traceable

As the screenshots above shows, both Bitbucket (left) and GitSense (right), can both tell you what files were matched and on what line, but only GitSense can tell you, who touched the matching file last and when.  Mapping search results, not only to a file, but to a commit as well, is unique to GitSense and can come in handy, if you need to sift through a lot of matches.

For example, if you know the code you are looking for, was updated by a certain user, you could filter the search results, to only include their changes.  Or if you know the code hasn't been touched for a long time, you could use the date information to further filter the list.  And so on. 

GitSense is all about improving developer productivity, and although this additional information will probably not be used, very often; it is one of those things, that can come in handy, when it is needed.

5. Code Tree

Finding that needle in a haystack, just got a whole lot easier.  With the GitSense "code tree", you'll be able to quickly and easily find that piece of code you know exists, but just can't quite remember where.  With this tree, you can quickly and easily drill into your search results by programming language, directory and file.

The End

Well this brings us to an end of another blog post, and as usual, we hope it was informative.  And as you can see, with GitSense, code searching in Bitbucket Server, just got a whole lot better.  And it's worth noting, we are just getting started, as we have other search improvements in the pipeline, so tuned to learn more.

Tracing and Analyzing Renamed/Copied Files in Bitbucket Server with GitSense

In our previous blog post, we quickly went over how GitSense, makes diffing in Bitbucket Server better.  In this blog post, we'll continue our theme of making Bitbucket Server better, by quickly highlighting how it can be used to trace and analyze renamed and copied files.

If you would like to install GitSense for Bitbucket Server, you can download both the GitSense Server and Bitbucket addon-on for free.  And if would like to play around with the add-on, you can do so at http://bitbucket-server-demo.gitsense.com.  If you are learning about GitSense for the first time, we recommend you read our previous blog posts, to learn more.

Making GitSense of Renamed and Copied Files

In the screenshot below, you can see an example, of what a renamed file looks like in Bitbucket Server.

If you are familiar with Bitbucket Cloud, GitHub, or GitLab, you may also notice, there is no previous file information ... well, other than in the commit comment.  It is kind of perculiar, that this information was left out.  Luckily, GitSense can help with that.  With GitSense, it can tell you what the previous file was, and much more.

So as you can see, with GitSense, it provides more than just the previous filename, it provides a smarter way to look at your codes history.  If you want to try what was shown in video above, you can use the following link, to view the commit in question.

http://bitbucket-server-demo.gitsense.com/plugins/servlet/gitsense/ACME/chakracore#b=bitbucket-server:ACME/chakracore:master&q=commit:afb1b86acc

Well this brings us to end of this blog post and usual, we hope it was informative.  With GitSense, we are constantly thinking of different ways to increase developer productivity, so stay tuned for future blog posts.

Viewing Large Diffs, Diffing Arbitrary Commits, and More with GitSense for Bitbucket Server

Now that GitSense for Bitbucket Server is available for download and because diffing plays a critical role in the software development lifecycle; we'll use this blog post, to quickly highlight some of the ways, GitSense can be used, to enhance the diffing experience in Bitbucket Server.

If you would like to install GitSense for Bitbucket Server, you can download both the GitSense Server and Bitbucket addon-on for free.  And if would like to play around with the add-on, you can do so at http://bitbucket-server-demo.gitsense.com.  If you are learning about GitSense for the first time, we recommend you read our previous blog posts, to learn more.

How GitSense Makes Diffing Better

  1. Viewing Large Diffs
  2. Diffing Arbitrary Commits
  3. Bulk Diffs Browsing
  4. Putting Diffs into Context

1. Viewing Large Diffs

If you have ever needed to review a large diff in Bitbucket, you'll recognize the following:

There is a way to increase the number of files to show, but it also comes with a disclaimer.  In Bitbucket's defence, you would also see this type of warning in GitLab and GitHub as well.  And that's because, they all rely on server-side logic, for rendering.

With GitSense, the rendering is done on the client-side, which means there is really no limit, to how many diffs it can handle.  If viewing large diffs, is a must have for you, your team, or your company; GitSense for Bitbucket Server, can help with that.

55,493 is the number of diffs in the tree.

2. Diffing Arbitrary Commits

Right now there is no easy way to diff arbitrary commits in Bitbucket Server.  In BSERV-2550, Atlassian suggests some workarounds, but for some, the workarounds are neither practical nor viable.  With GitSense, diffing arbitrary commits, is as easy, as it can get. 

3. Bulk Diffs Browsing

A common complaint that people often have, with browsing diffs via a tree, is it can be cumbersome.  Compared to the flat diffs layout that is offered by Bitbucket Cloud, GitHub and GitLab, this is understandable.  However, the problem with the flat layout, is it's not scalable.

To browse large diffs, a tree is a must, for organizing and navigating; but we also agree, a tree can slow you down, which is why GitSense supports bulk diffs browsing.  With bulk diffs browsing, you can quickly iterate through the diffs in a tree, without having to navigate the tree.  And if that was clear as mud, the following video should clear things up for you.

4. Putting Diffs into Context

When it comes to putting diffs into context, Bitbucket Server does a good job of this.  When viewing a diff in unified/inline mode, you can use Git blame, to see who last touched a diff line.  However, as useful as blame is, it isn't without its limitations.  Since blame is based on who touched a line last, it won't catch multiple contributors, to the same line.  And it can't be used, to tell you who deleted or renamed a file, as the screenshots below shows.

Blame can only show you what the file looked like, before if was deleted.
Blame can't be used at all, to see who renamed a file.

If you want to see who renamed, deleted or contributed to a file, you could iterate through all the commits in the diff, but there is a much better way.  With GitSense, seeing who did what and when, is usually just a click or two away.

So as you can see, with GitSense, diffing in Bitbucket Server, just got a whole lot better.  And if you want to try what was shown in this blog, you can play around with the GitSense add-on at http://bitbucket-server-demo.gitsense.com

Well this brings us to end of this blog post and usual, we hope it was informative.  With GitSense, we are constantly thinking of different ways to increase developer productivity, so stay tuned for future blog posts.

A Smarter Approach to Commits Browsing with GitSense for Bitbucket Server

Right now, if you want to review multiple commits with Bitbucket, GitHub or GitLab, you'll have to review them, one by one.  There is nothing inherently wrong with this approach, but there is a much better way.  And in this blog post, we'll show you how GitSense for Bitbucket Server, can do just that.

Having to review multiple commits, to answer questions like:

  • What changed in project X, in the last few days?
  • What was changed by Jira issues X, Y and Z?
  • What was changed by developers X and Y?

and so on, are typical day to day enterprise questions, and if you can only answer:

"What was changed by this commit?"

as opposed to

"What was changed by these commits?"

making sense of what has changed, can present some challenges.  And that's because, it can be difficult, to put their collective changes, into context.  However, with the GitSense add-on for Bitbucket Server, GitSense can put these changes into context for you, and to demonstrate how, we'll use it, to help us answer:

What changed in GitLab CE / EE master, in the last seven days, excluding merge commits?

If you are wondering why GitLab?  Its because their repos are publicly accessible and they best represent, what you would expect to find in most enterprise environments, with:

  • Lots of developers
  • Lots of changes
  • Lots of active releases

so lets get started.  And if you want to try what is shown in the videos belows, you can play around with the GitSense addon at http://bitbucket-server-demo.gitsense.com

Videos

Create the GitSense Changes Tree
Navigating the Tree
Pruning the Tree
Browsing Commits, One by One

Create the GitSense Changes Tree

The secret sauce, for a smarter way to browse multiple commits, is the GitSense "changes tree".  With this tree, you can view every change, from every commit and it only takes seconds to build.

Navigating the Tree

With the tree built, you'll find every file/directory, has a number beside it.  These numbers, lets you know, how many times a file/directory has been changed. 

Pruning the Tree

If the tree is a little too noisy, you can always prune it, so it only show changes, that you are interested in.

Browsing Commits, One by One

If you need or prefer to browse the commits, one by one, GitSense can help you with that as well.  With GitSense context's, you can always be sure, the commits being reviewed, are always relevant.

So as you can see, a little context, can go a long way. 

If you work in enterprise, GitSense for Bitbucket Server, maybe the time saver, you never knew you needed.  Also, expect major updates to the changes tree, as we evolve it, to become the ultimate diffing companion.  With the planned updates, you will be able to quickly and easily diff any two files, from any branch, in any repo, at any point in time, so stay tuned to learn more.

Merge Analytics for Bitbucket, GitHub and GitLab

If you use Bitbucket, GitHub and/or GitLab, you would know that, when viewing a merge commit through their commit's tool, you can easily tell what was changed, like so:

merge commit b2375af33 from atlassian/aui

merge commit 35ceb66a from atom/atom

merge commit c9a4626 from gitlab-org/gitlab-ce

but what they can't tell you, well not with ease, is:

  • who's changes were merged
  • when were these changes made
  • and what were the reasons for these changes

but GitSense can.

With GitSense, you just have to click the merge analysis link,

and it will let you know who's changes were merged and when they were made.

To answer why, click the right arrow, that is located below the contributor's avatar, to view their commit message

To analyze the merged files, switch to the "Change analytics" tab, to see what files were changed and how frequently.

And to see what these changes were, launch the diffs browser

which provides an easy wasy, to iterate through one or a thousand changes.

So as you can see, when it comes to merge commits, GitSense makes it very easy to put these changes into context.  And if you haven't already done so, make sure to checkout our previous blog post, to learn more about how GitSense is reimagining Git browsing.

GitSense Contexts: Code Change Filters for Git

So, what's a GitSense context?

You can think of GitSense contexts, as "code change" filters for Git's history and with them, you can control what parts of Git's history, the context user can see. 

For example, if you wanted to show others, what is changing in your 2.0 release, you can create a GitSense context, that only includes relevant branches and file changes for that release.  And by having others view Git's history through that context, you can ensure the changes that they see, will always be 2.0 relevant.

In a nutshell, GitSense contexts, makes it possible for you to put code changes into context for others.  And in this blog post, we'll highlight some interesting ways, that they can be used, to help reduce information pollution and speed the discovery of information.

Bitbucket, GitHub and GitLab Repos

Need to put repos that are hosted on Bitbucket, GitHub and GitLab into context?  No problem.  You can easily combine repos from Bitbucket Cloud/Server, GitHub/GitHub Enterprise and GitLab Cloud/Server.  And in the near future, you'll be able to include repos from Visual Studio Team Services as well.

Click on the link below, to see how you can combine repos from different sources, with a GitSense context.

https://gitsense.com/insight?c=bitbucket:gitsense/contexts:gs_contexts::default.ccf

Use Cases for GitSense Contexts

Here are some interesting ways, that you can use GitSense contexts, to control the flow of information:

For more examples and to learn to how create your own contexts, please refer to the Quick Introduction to GitSense Contexts Tutorial context.

Deep Integration Support

With Bitbucket Connect, Bitbucket users will soon (early July), be able to create GitSense contexts for their private repos.  And if they want to, search for changes in GitLab and GitHub repos, all from within Bitbucket.

We are also planning on developing deep integration solutions for GitLab and Visual Studio Team Service as well, so stay tuned for blog updates on that front.

And this brings us to the end of this blog.  And as usual, we hope the blog post was informative and that it gave you some ideas on how you can work smarter with GitSense contexts.

General Availability for GitSense Server and Cloud

We are shooting for early July 2016, for general availability for GitSense Server (install on your own infrastructure) and GitSense Cloud (managed by us), so stay tuned for further blog updates.

Blog Posts

© 2016 SDE Solutions, Inc. All rights reserved.