* Running pre-commit hook
@ 2015-07-31 14:57 Ed Avis
0 siblings, 0 replies; only message in thread
From: Ed Avis @ 2015-07-31 14:57 UTC (permalink / raw
To: git
Currently, git commit --dry-run does not run any hooks, not even pre-commit:
% mkdir test
% cd test
% git init
Initialized empty Git repository in /home/eda/test/.git/
% ln -s /bin/false .git/hooks/pre-commit
% touch a
% git add a
% git commit --dry-run -m. a >/dev/null && echo yes
yes
% git commit -m. a && echo yes
(fails)
It would sometimes be useful to run the pre-commit hook without committing,
for example to get some initial checks done before prompting the user to enter
a log message. (git commit itself works this way, of course, but I am
thinking of development environments and editors that interface to git.)
Is there a way to do a dry run commit that also runs some of the hooks?
--
Ed Avis <eda@waniasset.com>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-31 14:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31 14:57 Running pre-commit hook Ed Avis
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).