From: HUjuice <hujuice@inservibile.org>
To: Gentoo Traduzioni <gentoo-docs-it@lists.gentoo.org>
Subject: [gentoo-docs-it] hook git per il controllo XML
Date: Thu, 5 Apr 2012 13:32:11 +0200 [thread overview]
Message-ID: <CAP6dPAeF8XLwzxeHD=ffHFpwwdCPB6R6e6NnoqJ818FWjCKT+Q@mail.gmail.com> (raw)
Sto usando con soddisfazione un piccolo hook git, nato da un'idea di
Daniele Segato e forchettato rispetto al suo.
Serve a fare un controllo xmllint *prima* di un commit. In altre
parole, se ci sono errori XML il commit fallisce e gli errori vengono
visualizzati.
Invito chi vuole ad usarlo, perché alleggerisce il lavoro di revisione.
.git/hooks/pre-commit
--------------------------------
#!/bin/sh
for i in $(git diff --cached --name-only); do
echo $i
if ! xmllint --valid --noout $i; then
echo "Errori XML nel file $i"
exit 1
fi
done
--------------------------------
Lo sto usando da due mesi e funziona silenziosamente bene.
Al posto di questo, Daniele proponeva uno script più articolato, più
completo e che fa più cose.
Io non lo sto usando perché mi sembra meno KISS, ma chi vuole tornarci
lo troverà in una sua mail del 6 febbraio:
http://archives.gentoo.org/gentoo-docs-it/msg_0fdd5d4ec1bfb2ddb45089890d92add8.xml
Buona pasqua a tutti,
Sergio
HUjuice
mooodcast.net
reply other threads:[~2012-04-05 11:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAP6dPAeF8XLwzxeHD=ffHFpwwdCPB6R6e6NnoqJ818FWjCKT+Q@mail.gmail.com' \
--to=hujuice@inservibile.org \
--cc=gentoo-docs-it@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox