News for hackers. Stuff that matters.
Re:Show HN: Contribution Graph as a Git Command by aaossa on Friday May 27, 2022 @01:20PM (#31532160)
Hi HN!

A while ago I saw a CLI to display the GitHub contribution graph in a console, so I came up with the idea of a custom git command that made the exact same graph but based on the current repository.

If you like it or have any feedback about the tool itself and its code, just leave a comment. Thank you for your attention :)

Re:Show HN: Contribution Graph as a Git Command by isomorphic on Friday May 27, 2022 @03:46PM (#31534036)
Thank you for the utility.

In order to get this to work on macOS, I needed to use Homebrew bash (5.1 instead of macOS' native 3.2) and the GNU date utility from Homebrew's coreutils, since macOS' native date binary uses different arguments.

Essentially, change the shebang to "#!/usr/bin/env bash" and use "gdate" instead of "date" wherever "date" is used.

Re:Show HN: Contribution Graph as a Git Command by metadat on Friday May 27, 2022 @02:15PM (#31532864)
It'd be cool if it could also produce a graph of all contributors along the Y-axis.

Overall I dig it, nice job!

Re:Show HN: Contribution Graph as a Git Command by jph on Friday May 27, 2022 @03:00PM (#31533481)
Great tool! Want to add it to GitAlias?

See the git alias `git-chart` for example.

https://github.com/gitalias/gitalias

Re:Show HN: Contribution Graph as a Git Command by jsrcout on Saturday June 04, 2022 @10:02PM (#31627212)
Thanks, this is a gold mine of useful applications of Git
Re:Show HN: Contribution Graph as a Git Command by dariusj18 on Friday May 27, 2022 @02:33PM (#31533111)
you could also use these characters in a --no-color mode

https://en.wikipedia.org/wiki/Block_Elements

Re:Show HN: Contribution Graph as a Git Command by influx on Friday May 27, 2022 @05:03PM (#31534854)
This was way less code than I expected it to be. Nice!
Re:Show HN: Contribution Graph as a Git Command by floatinglotus on Friday May 27, 2022 @05:07PM (#31534908)
Does anyone know of a way to list number of commits to a project by email domain? Is that even possible?
Re:Show HN: Contribution Graph as a Git Command by csc-- on Friday May 27, 2022 @05:38PM (#31535242)
You could try mergestat (formerly known as askgit) which lets you run SQL queries against a git repo https://github.com/mergestat/mergestat
Re:Show HN: Contribution Graph as a Git Command by woodruffw on Friday May 27, 2022 @05:12PM (#31534965)
I don't see why it wouldn't be possible -- you can use `git log` with a formatting rule (like `--pretty=email`), and then parse the `From:` fields and group them by domain.

The rest is application specific: you'll need to determine whether you want to/should normalize subdomains to their parent, for example.

Re:Show HN: Contribution Graph as a Git Command by mmcclimon on Friday May 27, 2022 @05:40PM (#31535249)
Yeah, `git log --format=%ae | sed s/.*@//` will get you most of the way there, and then it’s down to how you want to deal with the domains themselves, as you say!