Git Commands to Run Before Reading Any Code

Via Hacker News today was The Git Commands I Run Before Reading Any Code. I made a git-rep.sh script based on these:

#!/bin/bash

# 2026-04-09 jj5 - SEE: https://piechowski.io/post/git-commands-before-reading-code/

main() {

  set -euo pipefail;

  report 'What Changes the Most';
  git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20;

  report 'Who Built This';
  git shortlog -sn --no-merges;

  report 'Where Do Bugs Cluster';
  git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20;

  report 'Is This Project Accelerating or Dying';
  git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c;

  report 'How Often Is the Team Firefighting';
  git log --oneline --since="1 year ago" | grep -iE 'revert|hotfix|emergency|rollback';

}

report() {

  echo;
  echo "$1":
  echo;

}

main "$@";

Subversion @ GitHub

I wanted to use Subversion to checkout one of my GitHub repo branches, because an svn checkout only downloads the files it needs, not a full copy of every file ever added. But I discovered that GitHub sunset Subversion integration earlier this year. Sad face. Still, I suppose the economics justify that decision. As a consequence of my research, which was a bit sketchy because there is still heaps of documentation out there referring to the GitHub features which no longer exist, I did happen to learn about:

My use case for git submodules

I have been chatting on IRC about how I’m learning git so I can use submodules and my friend @indigo wants to know my use case, so this post makes some effort to explain that with reference to one specific example.

I have a web framework/toolkit I am experimenting with called Mudball which is here: https://github.com/jj5/mudball

I use Mudball in (some of) my web projects, for example: https://github.com/jj5/www.jjlab.net

In the main project (in this case www.jjlab.net) I have a copy of Mudball in the ext/mudball directory. At the moment ext/mudball is setup as a git submodule.

I open the main project in my IDE (or text editor) and I want to be able to work on both the main application and the web framework/toolkit at the same time. Then when I’m done with some changes I want to run my `gui` script (it stands for “git update interactive”, not “graphical user interface”) which will increment my version numbers in inc/version.php and ext/mudball/inc/version.php and then add/commit/push any changes in both the main project and the web framework/toolkit.

The code for the `gui` command is here: kickass-libexec/bin/lx-gui.sh, it mostly just defers to lx_vcs_sync() which is here: kickass-libexec/src/2-module/vcs/vcs.sh.

The code which updates the version numbers is here: kickass-libexec/bin/lx-version-increment-patch.sh, it mostly just defers to other modules which are here: kickass-libexec/bin/libexec/version-increment-patch.php and here: kickass-libexec/bin/libexec/inc/version.php.

I have been using a similar setup for a long time with Subversion which uses the svn:externals facility (in place of git submodules) and I have a few scripts which help me manage that. My main tooling for this is known as svnman which is a bunch of scripts I wrote myself: Svnman.

gnutls_handshake failed using git

Today I ran into this error:

jj5@mercy:~/public-git$ git push origin master
error: gnutls_handshake() failed: A TLS warning alert has been received. while accessing https://demo@demo.personalserver.com/public/git/info/refs 

The solution, of all things, was to add a ServerName spec into my Apache configuration file /etc/apache2/sites-enabled/default-ssl.conf, e.g.:

ServerName demo.personalserver.com

Bug fixed!!