Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"Q" stands for "query": Inspired by MJD [1], add my own version. Mine shows symbolic refs like the input by default, but expands to short hashes with `-v`. It also collapses equivalent refs (because `show` does) instead of running a command for each input (which is expensive). Here's hyperfine output: hyperfine --output=pipe 'git q2 HEAD origin/master~{1..1000}' 'git q HEAD origin/master~{1..1000}' Benchmark 1: git q2 HEAD origin/master~{1..1000} Time (mean ± σ): 9.524 s ± 0.012 s [User: 4.540 s, System: 3.397 s] Range (min … max): 9.510 s … 9.547 s 10 runs Benchmark 2: git q HEAD origin/master~{1..1000} Time (mean ± σ): 163.7 ms ± 1.9 ms [User: 99.8 ms, System: 54.8 ms] Range (min … max): 160.8 ms … 168.2 ms 17 runs Summary git q HEAD origin/master~{1..1000} ran 58.18 ± 0.70 times faster than git q2 HEAD origin/master~{1..1000} The 2 commands produce identical output (although q2 used different lengths with -v sometimes), where q2 is the same as q with this patch: 38c38 < exec git show -s --format="$id $query" "$@" --- > for ref; do git show -s --format="$id $query" "$ref"; done [1]: https://blog.plover.com/prog/git-q.html
- Loading branch information