Skip to content

Instantly share code, notes, and snippets.

@ulidtko
Created August 13, 2014 17:54
Show Gist options
  • Save ulidtko/a7eaabe927aea28a0995 to your computer and use it in GitHub Desktop.
Save ulidtko/a7eaabe927aea28a0995 to your computer and use it in GitHub Desktop.
External Git command for autotagging Debian package repos via debian/changelog blaming
#!/bin/sh
pkgname=$(dpkg-parsechangelog | sed -n 's/^Source: //p')
git blame -ltf debian/changelog \
| awk '/^[0-9a-f]+ .+ (\([^)]*\)) '$pkgname'/{gsub("[()]", "", $8); print $8, $1}' \
| head -n 50 | xargs -l1 git tag -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment