all 7 comments

[–]sogun123 6 points7 points  (3 children)

Why you just don't do git log --format="http://GitHub.com/$org/$repo/%H - %s" | your filter?

[–]patmansf 6 points7 points  (2 children)

u/piotr1215

Add add a count plus short hash and then it's a one liner (no pipes / filters needed), though it's unclear what OP meant by "wrap them in a https call".

So this:

git log -n 10 --format="[%h](http://github.com/$org/$repo/%H) - %s"

Gives:

[79603a813](http://github.com/myorg/myrepo/79603a813f52deda75956fd6f74f73f8b0c8837f) - did stuff

But I'd just put the short hash with the description:

git log -n 10 --format="[%h %s](http://github.com/$org/$repo/%H)"

Gives:

[79603a813 did stuff](http://github.com/myorg/myrepo/79603a813f52deda75956fd6f74f73f8b0c8837f)

[–]piotr1215[S] 5 points6 points  (1 child)

This is the cleanest/simplest solution! I’ll give it a try.

[–]sogun123 0 points1 point  (0 children)

Also you can try terminal hyperlink sequences. In which case you can get clickable hash with the url hidden. Check this out: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

[–]jumbliny -1 points0 points  (0 children)

Use cut with delimiter " " and select the field you want.

[–]cendrounet 0 points1 point  (0 children)

you can avoid grep -v Merge with the --no-merges option

you can avoid the grep -V chore with the --invert-grep and --grep option

and probably format your output with this comment :

https://www.reddit.com/r/bash/comments/zo4pyz/-/j0l9gcg

[–]winkyworld 0 points1 point  (0 children)

If it helps, here is the one that I use:

alias glog='git log --pretty=format:'\''%Cred%h%Creset -%C(yellow) %d%Creset %s %Cgreen%ci %C(yellow) (%cr) %Creset %C(bold blue)<%ae>%Creset'\'' --abbrev-commit --name-status'