Results for “search history”
Small, practical examples. Search by task or narrow things down below.
Branch on whether a pattern exists
Linux Commands: Use grep -q in a conditional so an ordinary no-match result is not an unhandled failure.
Linux Commands✓ Tested
Check what kind of Git object a revision names
Git: cat-file -t distinguishes a commit, tree, blob, or annotated tag.
Git✓ Tested
Count commits reachable from a revision
Git: rev-list --count counts reachable commits without printing commit identifiers.
Git✓ Tested
Count matching lines
Linux Commands: Use grep -c to count matching lines rather than individual occurrences.
Linux Commands✓ Tested
Exclude matching lines
Linux Commands: Use grep -v to retain lines that do not start with a comment marker.
Linux Commands✓ Tested
Find a commit that changed the count of a text string
Git: The pickaxe -S option finds commits that add or remove occurrences of a literal string.
Git✓ Tested
Find a value in a small lookup table
Arduino / C: A linear scan is simple and predictable for a small fixed array.
Arduino / C✓ Tested
Find an item’s index
Find an item’s index using a complete Go program with explicit sample inputs.
Go✓ Tested
Find the commit responsible for a line
Inspect line attribution in a stable machine-readable format.
blame✓ Tested
List all files stored in a commit
Git: ls-tree inspects the committed tree without relying on working files.
Git✓ Tested
List files changed by the current commit
Git: diff-tree exposes the paths changed between a commit and its parent.
Git✓ Tested
List files containing a match
Linux Commands: Use grep -l when only the matching filenames are needed.
Linux Commands✓ Tested