~strahinja/reflow

df515ab8117e28737ffe5e452534a5a156d84f2d — Страхиња Радић a month ago 403114e v0.2.1
Add got(1) support
3 files changed, 46 insertions(+), 12 deletions(-)

M INSTALL
M lib/makedate
M lib/makeversion
M INSTALL => INSTALL +8 -0
@@ 12,6 12,14 @@ Install
	$ su
	# make install

With got[1]:

	$ got clone https://git.sr.ht/~strahinja/reflow
	$ got checkout reflow.git
	$ cd reflow
	$ su
	# make install


Persistent build configuration file
-----------------------------------

M lib/makedate => lib/makedate +23 -6
@@ 1,12 1,29 @@
#!/bin/sh -x
# vim: set ft=bash:
FALLBACKDATE=${FALLBACKDATE:-unknown}
LC_ALL=C
export LC_ALL
user=$(unalias ls >/dev/null 2>&1 || true; \
	command ls -ld . | awk '{print $3}')
e_user=$(id -un)
if [ -d .git ] && command -v git >/dev/null 2>&1; then
case "$(uname -s)" in
	*OpenBSD*)
		DATEARGS='-j +%B,\ %d\ %Y'
		;;
	*)
		DATEARGS='+%B,\ %d\ %Y'
		;;
esac

if [ -d .got ] && command -v got >/dev/null 2>&1; then
	got tag -l |
	awk '
	/^date: / {
		sub(/^date: /,"",$0)
		print strftime("%B %d, %Y")
		exit
	}' >date.new
elif [ -d .git ] && command -v git >/dev/null 2>&1; then
	LC_ALL=C
	export LC_ALL
	user=$(unalias ls >/dev/null 2>&1 || true; \
		command ls -ld . | awk '{print $3}')
	e_user=$(id -un)
	if [ "$e_user" = "$user" ]; then
		git log --format=format:%cd \
			--date=format:"%B %d, %Y" -1 @ >date.new

M lib/makeversion => lib/makeversion +15 -6
@@ 1,12 1,21 @@
#!/bin/sh -x
# vim: set ft=bash:
FALLBACKVER=${FALLBACKVER:-unknown}
LC_ALL=C
export LC_ALL
user=$(unalias ls >/dev/null 2>&1 || true; \
	command ls -ld . | awk '{print $3}')
e_user=$(id -un)
if [ -d .git ] && command -v git >/dev/null 2>&1; then

if [ -d .got ] && command -v got >/dev/null 2>&1; then
	got tag -l |
	awk '
	/^tag/ {
		sub(/^v/,"",$2)
		print $2
		exit
	}' >version.new
elif [ -d .git ] && command -v git >/dev/null 2>&1; then
	LC_ALL=C
	export LC_ALL
	user=$(unalias ls >/dev/null 2>&1 || true; \
		command ls -ld . | awk '{print $3}')
	e_user=$(id -un)
	if [ "$e_user" = "$user" ]; then
		git describe 2>/dev/null | sed 's/^v//' >version.new
	else