notify-webhook icon indicating copy to clipboard operation
notify-webhook copied to clipboard

Fix commit data; author, missing file changes.

Open ferringb opened this issue 3 months ago • 0 comments

Review this after #29 lands. It's directly built on top of that.

See issue #28 ; the commit "added, removed" etc data wasn't coming through, and author name and email parsing was generally horked. Both were regex issues which I either replaced or rewrote.

For the name and email parsing, this is obvious; check the commit in this PR.

Note there is a subtle fix in here- for the first file mutation data, diff-tree will not properly reference the parent since there is no parent. IE, it gives back no changed files even if obviously the first commit adds files. The solution is to force it to diff against the hardcoded SHA for repository initialization.

Don't ask me how I know of this gotcha, but it's bit me in the ass before, thus I noticed it.

Other points of note:

  • -M was added so renames are actually detected.
  • the git function was allowing non-zero exit code from git- bad calls. This is why the ref deletion event was exploding further down the stack for example. I changed this to explode if a git call fails.
  • added warnings for diff-tree results that should be impossible for this code usage.

ferringb avatar Nov 11 '25 21:11 ferringb