Skip to content

Commit

Permalink
Added text in Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
terminationshock committed Apr 26, 2024
1 parent f70a6be commit 3a14730
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Each commit hash matching the regular expression `[0-9a-f]{7,40}` will be highli
and hit the enter key, the command `git show <commit hash>` will be executed. When this command returns, the list will be shown again allowing you
to select the next line of interest.

The main advantage of *lisst* is its ability to interactively select lines. Often a combination of `grep` and `xargs` can achieve a somewhat similar
effect, but much less convenient. The following command, for example, will also run `git show` for all commits, however, one after the other, which
is typically not very useful:

```bash
git log --oneline | grep -E "[0-9a-f]{7,40}" -o | xargs -L 1 -p git show
```

*lisst* accepts all non-empty output piped into it and splits it on line breaks. Each line is matched against the given regular expression.
The first match within a line is highlighted. The enter key triggers the upstream command only if the selected line contains a match.
An arbitrary number of command line arguments can be added to the command. The highlighted match in the selected line is appended
Expand Down
2 changes: 1 addition & 1 deletion src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func PrintHelp() {
fmt.Println(" --sort-rev Reverse --sort")
fmt.Println(" --help Display this help")
fmt.Println("\nExamples:")
fmt.Println("\n git log --oneline | " + os.Args[0] + " \"\\b[0-9a-z]{7,40}\\b\" git show")
fmt.Println("\n git log --oneline | " + os.Args[0] + " \"\\b[0-9a-f]{7,40}\\b\" git show")
fmt.Println(" or")
fmt.Println(" git log --oneline | " + os.Args[0] + " --git-commit-hash git show")
fmt.Println(" will display all commits, highlight all commit hashes, and")
Expand Down

0 comments on commit 3a14730

Please sign in to comment.