Logging (l*) ​
Logging commands in Hug provide powerful ways to view, search, and inspect commit history. Prefixed with l for "log," they enhance Git's log command with intuitive searches by message, code changes, authors, dates, and file-specific histories. File-focused commands (llf*) handle renames via --follow and support limiting to recent commits (e.g., -1 for the most recent).
Quick Reference ​
| Command | Memory Hook | Summary |
|---|---|---|
hug l | Log | Oneline history with graph and decorations |
hug lu | Log after Upstream | Log commits after the last Upstream commit |
hug la | Log All | Oneline log across all branches |
hug ll | Log Long | Detailed log with full messages |
hug llu | Log Long after Upstream | Log commits after the last Upstream commit |
hug lla | Log Long All | Detailed log across all branches |
hug lp | Log Patch | Log with diffs for each commit |
hug lo | Log Outgoing | Quiet preview of commits not yet on upstream |
hug lol | Log Outgoing Long | Full preview of commits not yet on upstream |
hug lf | Log message Filter | Search commit messages |
hug lc | Log Code search | Search diffs for exact term |
hug lcr | Log Code Regex | Search diffs with regex |
hug lau | Log Author | Filter log by author |
hug ld | Log Date | Log commits within a date range |
hug llf | Log Lookup File | File history following renames |
hug llfs | Log Lookup File Stats | File history with change statistics |
hug llfp | Log Lookup File Patch | File history with full patches |
Basic Logging ​
hug l [options]- Description: One-line log with graph visualization and branch decorations for a concise history overview.
- Example:shell
hug l # Current branch history - Safety: Read-only; no repo changes.

hug la [options]- Description: One-line log with graph visualization and branch decorations for a concise history overview for ALL branches.
- Example:shell
hug la # branch history for ALL branches - Safety: Read-only; no repo changes.

hug ll [options]- Description: Detailed log with graph, short date, author, decorations, and full commit message.
- Example:shell
hug ll # Current branch detailed history - Safety: Read-only.

hug lla [options]- Description: Detailed log with graph, short date, author, decorations, and full commit message for ALL branches.
- Example:shell
hug lla # Detailed history for ALL branches - Safety: Read-only.

hug lp [options]- Description: Detailed log including patches/diffs for each commit.
- Example:shell
hug lp # Patches for current branch hug lp -3 # Last 3 commits with patches - Safety: Read-only.

Search by Commit Message ​
hug lf <search-term> [-i] [-p] [--all] [-- [<file>]]- Description: Search commit history by grep on commit messages. Use
--as the last argument for interactive file selection to restrict the search. - Options:
-i: Ignore case.-p: Include patches in results.--all: Search all branches.-- <file>: Restrict search to specific file.--(last arg): Restrict with interactive file selection.
- Usage:shell
hug lf "fix bug" # Search for "fix bug" hug lf "fix bug" -i # Case-insensitive search hug lf "fix bug" --all # Search all branches hug lf "fix bug" -- file.js # Restrict to specific file hug lf "fix bug" -- # Interactive file selection - Safety: Read-only.

- Description: Search commit history by grep on commit messages. Use
Search by Code Changes ​
hug lc <search-term> [-i] [-p] [--all] [-- [<file>]]- Description: Search commits where the diff (code changes) contains the term (Git's pickaxe search). Use
--as the last argument for interactive file selection to restrict the search. - Options:
-i: Ignore case.-p: Show patches.--all: All branches.-- <file>: Restrict search to specific file.--(last arg): Restrict with interactive file selection.
- Example:shell
hug lc "getUserById" # Search code changes hug lc "getUserById" -- src/users.js # Restrict to specific file hug lc "getUserById" -- # Interactive file selection - Safety: Read-only.

- Description: Search commits where the diff (code changes) contains the term (Git's pickaxe search). Use
hug lcr <regex> [-i] [-p] [--all] [-- [<file>]]- Description: Search commits where the diff matches a regex (more flexible than
lc). Use--as the last argument for interactive file selection to restrict the search. - Options: Same as
lc. - Example:shell
hug lcr "TODO:" # Regex search hug lcr "TODO:" --all # Search across all branches hug lcr "TODO:" -- # Interactive file selection - Safety: Read-only.
- Description: Search commits where the diff matches a regex (more flexible than
Search by Author and Date ​
hug lau <author> [options]- Description: Filter log to commits by a specific author.
- Example:shell
hug lau "John Doe" # Author's commits hug lau "John Doe" -5 # Last 5 by author - Safety: Read-only.

hug ld <since-date> [<until-date>]- Description: Log commits within a date range (until defaults to now).
- Example:shell
hug ld "2023-01-01" # Since date hug ld "2023-01-01" "2023-12-31" # Date range - Safety: Read-only.

File Inspection (llf*) ​
These commands show the history of changes to a specific file, following renames. Use -N to limit to the last N commits (e.g., -1 for most recent). Combine with log options like --stat or -p. When no file is provided, shows an interactive file selection UI (requires gum).
hug llf [<file>] [-N] [log options]- Description: Log commits that modified a file (handles renames). Ideal for finding the most recent change to a file. When no file is provided, shows interactive file selection.
- Example:shell
hug llf # Interactive file selection hug llf file.txt -1 # Most recent commit touching file hug llf file.txt -2 --stat # Last 2 commits with stats - Safety: Read-only.

hug llfs [<file>] [-N] [log options]- Description: File history with change statistics (insertions/deletions). When no file is provided, shows interactive file selection.
- Example:shell
hug llfs # Interactive file selection hug llfs file.txt -1 # Stats for most recent change - Safety: Read-only.
hug llfp [<file>] [-N] [log options]- Description: File history including full patches/diffs. When no file is provided, shows interactive file selection.
- Example:shell
hug llfp # Interactive file selection hug llfp file.txt -1 # Patch of most recent change - Safety: Read-only.
Tips ​
- Most recent commit touching a file:
hug llf <file> -1(handles renames with--follow). - Last N commits for a file:
hug llf <file> -N(e.g.,-2for last 2). Usehug llfs <file> -1for stats orhug llfp <file> -1for patches. - Search history by file changes: Combine with
lforlcfor message/code searches restricted to file touches, e.g.,hug lc "TODO" -- file.txt. - Pipe to pager for long outputs:
hug ll | less. - For line-level inspection (blame), see File Inspection like
hug fblame <file>. - Use
hug laorhug ll --allto search across branches. - Status as a Final Check: Several preview commands, including
hug loandhug lol, conclude with the output ofhug s. This provides a consistent, final overview of your working directory before you decide to act.
Upstream Sync & Pre-push Checks (lo*) ​
These commands help you review what will be pushed to the remote (upstream) branch before you actually push. They are essential for a safe, clean workflow. Run them before hug bpush.
hug lo- Description: A quieter preview of local commits that are not yet on the upstream branch. It shows the essential safety information (
git cherry -v) followed by the output ofhug sfor a final check, but skips the verbose list of outgoing commits. Ideal for a quick check. - Example:shell
hug lo - Safety: Read-only. Exits with an error if the current branch has no configured upstream.

- Description: A quieter preview of local commits that are not yet on the upstream branch. It shows the essential safety information (
hug lol- Description: A comprehensive preview of all local commits that are not yet on the upstream branch. This is the ideal command to run before pushing. It shows:
- A diffstat of changes.
- A detailed list of outgoing commits.
- The exact unique commits that will be pushed (
git cherry -v). - The current repo status (the full output of
hug s).
- Example:shell
hug lol - Safety: Read-only. Exits with an error if the current branch has no configured upstream.

- Description: A comprehensive preview of all local commits that are not yet on the upstream branch. This is the ideal command to run before pushing. It shows:
hug log-outgoing- Description: The underlying script for
hug loandhug lol. You can call it directly for more control. - Options:
--fetch: Fetches the latest changes from the remote before performing the check, ensuring the comparison is up-to-date. Usage:hug log-outgoing --fetch--quiet: Runs in quiet mode, identical tohug lo. Usage:hug log-outgoing --quiet--help: Shows detailed help information.
- Example:shell
hug log-outgoing --fetch
- Description: The underlying script for
Tip: Use hug lo for a quick check or hug lol for a full review. Once you're confident, use hug bpush to push them safely.
Pair logging with Status & Staging to inspect changes, or HEAD Operations to undo based on history.