git-nomad icon indicating copy to clipboard operation
git-nomad copied to clipboard

Delegate to git machinery for `git nomad ls`

Open rraval opened this issue 2 years ago • 1 comments

We currently hand roll our own printing.

It would be nice to reuse git log --oneline -1 refs/nomad/<host>/<branch> to have git format each ref. Ideas:


The %S format specifier in --pretty to print the ref name exactly as it was passed in the command line.


--decorate-refs looks like it works well:

$ git log --decorate-refs='refs/nomad/*' --oneline -1 refs/nomad/apollo/master
0a96fd2a (refs/nomad/apollo/master) Bump anyhow from 1.0.61 to 1.0.62

--source with explicit ref names:

$ git log --source --oneline -1 refs/nomad/apollo/master
0a96fd2a        refs/nomad/apollo/master Bump anyhow from 1.0.61 to 1.0.62

rraval avatar Jun 20 '23 20:06 rraval

This is ideal:

$ git show --decorate-refs='refs/nomad/*' --oneline --no-patch refs/nomad/apollo/master refs/nomad/boreas/master refs/nomad/boreas/ref
0a96fd2a (refs/nomad/apollo/master) Bump anyhow from 1.0.61 to 1.0.62
4e2973c0 (refs/nomad/boreas/master) Simplify all lifetimes
e8894ec2 (refs/nomad/boreas/ref) cp

Combine with a CLI option that plumbs to --pretty for ultimate flexibility.

rraval avatar Jun 23 '23 15:06 rraval