Karl Berry wrote:
>     Just pushed a change:
>
> Evidently didn't make it through -- nothing in the gawk-diffs moderation
> queue, nothing in the list archives.
>
> I don't how to set up notifications for git and don't see any info in
> the sv wiki.  Oh, evidently it's something about "cia", judging
> /root/infra/git.txt, but there's too much/not enough info in there for
> me to want to try to guess what the right commands are.  So I can only
> hope that someone who does know (Sylvain, Jim?) make it happen.

I've done the equivalent of running this script,
which has a few corrections to the procedure in git.txt.

---------------------------
#!/bin/sh

ME=`basename "$0"`
warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
die() { warn "$*"; exit 1; }

case $# in
  0) die missing project name;;
  1) ;;
  *) die too many arguments;;
esac

project=$1
export GIT_DIR=/srv/git/$project.git

test -d $GIT_DIR || die "no such dir: $GIT_DIR"

chattr -i $GIT_DIR/hooks

mkdir -m 755 $GIT_DIR/hooks/post-receive.d
ln -s /usr/src/git/contrib/hooks/post-receive-email \
  $GIT_DIR/hooks/post-receive.d/
git config hooks.showrev \
 "t=%s; echo http://git.sv.gnu.org/cgit/$project.git/commit/?id=\$t; echo; 
echo; git show -C \$t; echo"
git config hooks.mailinglist [email protected]

cat <<'EOF' > $GIT_DIR/hooks/post-receive
#!/bin/bash
exec run-parts hooks/post-receive.d
EOF
chmod 755 $GIT_DIR/hooks/post-receive

chattr +i $GIT_DIR/hooks
---------------------------

Then I realized that gawk's list has a non-conforming name,
(normally it's $project-commit; Arnold requested gawk-diffs)
so I manually did this to accommodate:

  git config hooks.mailinglist [email protected]

So the above script probably needed a new, optional parameter
by which to specify a non-default commit mailing list address.
Here's the still-untested script:

-----------------------------------------
#!/bin/sh

ME=`basename "$0"`
warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
die() { warn "$*"; exit 1; }

case $# in
  0) warn "Usage: $ME project [commit-email-addr]"; die missing project name;;
  1) project=$1; [email protected];;
  2) project=$1; commit_list_address=$2;;
  *) die too many arguments;;
esac

case $commit_list_address in
  *@gnu.org) ;;
  *@nongnu.org) ;;
  *) die "invalid email address $commit_list_address";;
esac

export GIT_DIR=/srv/git/$project.git

test -d $GIT_DIR || die "no such dir: $GIT_DIR"

chattr -i $GIT_DIR/hooks

mkdir -m 755 $GIT_DIR/hooks/post-receive.d
ln -s /usr/src/git/contrib/hooks/post-receive-email \
  $GIT_DIR/hooks/post-receive.d/
git config hooks.showrev \
 "t=%s; echo http://git.sv.gnu.org/cgit/$project.git/commit/?id=\$t; echo; 
echo; git show -C \$t; echo"
git config hooks.mailinglist $commit_list_address

cat <<'EOF' > $GIT_DIR/hooks/post-receive
#!/bin/bash
exec run-parts hooks/post-receive.d
EOF
chmod 755 $GIT_DIR/hooks/post-receive

chattr +i $GIT_DIR/hooks

Reply via email to