Skip to content

[bin+zsh] dotfiles-search-commits: expand functionality and migrate from alias to standalone script #36

@0xdevalias

Description

@0xdevalias

In our current local WIP state, the dotfiles-search-commits helper has evolved well beyond its original form as a simple alias for grepping commit logs. It now supports multiple modes (log, log-recent, code) with aliases, regex options (basic/extended/perl), structured help/error handling, implicit fallbacks for common cases, and clearer usage examples.

While this expansion significantly improves usability, it also introduces complexity around return vs exit behavior when defined as a shell function inside aliases.zsh. Sourcing functions that use exit can inadvertently terminate the entire interactive shell session. At this stage, it’s more sustainable to promote this into a proper bin/ script so that it behaves like a standalone CLI tool without these caveats.

Remaining TODOs / Known Issues:

  • Migrate implementation from zsh/aliases.zsh into bin/dotfiles-search-commits (or bin/dotfiles-history? which should be the name and which the alias?) for safer execution.
    • Update aliases to correctly point to the new bin/ script (if they are still needed)
  • Cleanup:
    • Remove temporary debug scaffolding (inner_function_test).
    • Remove return_or_exit and similar hacks once promoted to a proper script.
  • Broader testing before committing/pushing:
    • Verify consistent handling of exit codes across environments (zsh, bash).
    • Review error handling and edge cases (missing patterns, invalid regex mode).

See Also

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions