Results for “compare”
Small, practical examples. Search by task or narrow things down below.
List only staged filenames
Git: The cached diff compares the index with HEAD rather than comparing working files with the index.
Git✓ Tested
List paths changed on a feature branch since its merge base
Git: A three-dot diff compares the branch tip with the common ancestor.
Git✓ Tested
Preserve equal-key order while sorting records
C++: stable_sort retains encounter order for records whose selected sort keys compare equal.
C++✓ Tested
Sort and deduplicate values
Produce an ordered list without duplicates.
Sort-Object✓ Tested
Sort timestamp strings by their parsed instants
JavaScript: Compare epoch values explicitly when date strings may contain different offsets.
JavaScript✓ Tested
Sort timestamp strings by their parsed instants
TypeScript: Compare epoch values explicitly when date strings may contain different offsets.
TypeScript✓ Tested
Sort version-like labels naturally
Linux Commands: Use GNU version sort to compare embedded digit runs numerically.
Linux Commands✓ Tested
Test whether an array contains a value
PowerShell: The contains operator compares complete items rather than matching substrings.
PowerShell✓ Tested