Skip to main content
deletethis.net A photo of me wearing a white button up shirt standing in front of generic office building windows.

Code Search Comparison: GitHub, Azure DevOps, and Chromium

Before working in Chromium I had been using our internal project's Azure DevOps (ADO) code search feature, and occassionally using Chromium Code Search or GitHub's code search. It seemed like Chromium Code Search or GitHub code search would only sometimes work with my queries. Sitting down to compare the syntax of them led me to figure out why and the power of Chromium Code Search:

Comparison Table #

Feature ADO Chromium GitHub
Wildcard syntax Full glob match (*) Partial regex match (uses regular expressions, e.g. .*) Paths use partial glob, everything else is partial literal match, or partial regex with slashes
Search for method/class definition/declaration Def:Name / decl:Name Class:Name / Func:Name Symbol:Name
Negation logic operator NOT - NOT
Includes generated files
Documentation Functional code search - Azure Repos | Microsoft Learn Syntax reference | Code Search | Google for Developers Understanding GitHub Code Search syntax

The biggest difference is learning that Chromium is using partial regular expressions matching, ADO is using full glob matching, and GitHub is using partial literal matching unless you use /.../ to explicitly ask for regular expressions. So TLDR: * in ADO should be .* in Chromium, and /.*/ in GitHub.

Example Comparison #

Searching for the kTopLevel symbol in the Chromium codebase, excluding tests and mojom files, and only looking in a service path:

ADO query:

kTopLevel NOT path:*test* NOT ext:mojom path:*service*

cs.chromium query:

\bkTopLevel\b -path:test -path:\.mojom$ -path:^out/ path:service

GitHub query:

repo:chromium/chromium /\bkTopLevel\b/ NOT path:test NOT path:*.mojom PATH:service

Notable Differences: #

kTopLevel #

NOT path:*test* #

NOT ext:mojom #

-path:^out/ #