Commit Graph

30 Commits

Author SHA1 Message Date
Luben Tuikov
9a1ae9ab03 sample commit-msg hook: no silent exit on duplicate Signed-off-by lines
git-commit would silently exit if duplicate Signed-off-by
lines were found.  Users of git-commit would not know it,
unless they checked '$?'.  This patch makes git-commit
actually print out a message that nothing was commited
since duplicate Signed-off-lines were found.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-13 01:46:28 -07:00
Luben Tuikov
e77235ea38 Fix regex pattern in commit-msg
Between the count and the line output, some
uniq(1) versions put a TAB character, not a space.
Make sure both are handled.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-13 01:46:28 -07:00
Ramsay Allan Jones
7ffe7098dc Fix installation of templates on ancient systems.
Do not use $(call) for 'shell quoting' paths, and pass DESTDIR down
to the templates makefile.

[jc: we have fixed the main Makefile long time ago, but somehow
 forgot to apply the same fix to templates Makefile.]

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 00:27:18 -07:00
Eric Wong
3a895e0268 templates/hooks--update: replace diffstat calls with git diff --stat
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-08 03:11:16 -07:00
Junio C Hamano
61c2bcbd11 pre-commit hook: complain about conflict markers.
Several <<< or === or >>> characters at the beginning of a line
is very likely to be leftover conflict markers from a failed
automerge the user resolved incorrectly, so detect them.

As usual, this can be defeated with "git commit --no-verify" if
you really do want to have those files, just like changes that
introduce trailing whitespaces.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-19 15:37:40 -07:00
Junio C Hamano
ac5f7c62c2 Merge branch 'maint'
* maint:
  sample hooks template.
2006-02-26 15:25:52 -08:00
Junio C Hamano
a204756a45 sample hooks template.
These two sample hooks try to detect and use the corresponding
commit hook from the same repository.  However, they forgot to
set up GIT_DIR for their own use, so was not in effect.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:16:41 -08:00
Junio C Hamano
9a111c91b0 rebase: allow a hook to refuse rebasing.
This lets a hook to interfere a rebase and help prevent certain
branches from being rebased by mistake.  A sample hook to show
how to prevent a topic branch that has already been merged into
publish branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-13 00:17:33 -08:00
Junio C Hamano
36b5b3c659 Merge fixes up to GIT 1.1.6 2006-01-29 17:56:45 -08:00
Junio C Hamano
d37fd03222 [PATCH] pre-commit sample hook: do not barf on the initial import
The example hook barfs on the initial import.  Ideally it should
produce a diff from an empty tree, but for now let's stop at
squelching the bogus error message.  Often an initial import
involves tons of badly formatted files from foreign SCM, so not
complaining about them like this patch does might actually be a
better idea than enforcing the "Perfect Patch" format on them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-29 14:52:16 -08:00
Junio C Hamano
41e79c9559 sample update-hook: sanely handle a new branch head.
Instead of showing all the history since the beginning of time
leading to the the branch head, show only the changes this new
branch brings to the world.

This originally came from Linus and tested by Andreas Ericsson.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-24 17:38:06 -08:00
Andreas Ericsson
8a3ee7c314 update-hook: Major overhaul (handling tags, mainly).
This is the update hook we use in all our git-repos.

It has some improvements over the original version, namely:
* Don't send every commit since dawn of time when adding a new tag.
* When updating an annotated tag, just send the diffs since the last tag.
* Add diffstat output for 'normal' commits (top) and annotated tags (bottom).
* Block un-annotated tags in shared repos.

I'm a bit uncertain about that last one, but it demonstrates how to
disallow updates of a ref which we use, so I kept it.

Note that git-describe is needed for the "changes since last annotated tag"
thing to work.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-24 17:27:33 -08:00
Junio C Hamano
60abce3c0f Fix hooks/update template.
Make the example address RFC2606 (aka BCP0032) compliant.  Also
fix a couple of shell script errors.

Noted and fixed by Matthew Wilcox and Andreas Ericsson.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-21 12:21:06 -08:00
Junio C Hamano
f8d294f0a4 Clean build annoyance.
As Pasky pointed out, building in templates directory showed
list of built template files which was unneeded.  This commit
also fixes another build annoyance I recently left in by
accident.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-08 08:58:52 -08:00
Tom Prince
01eea6f355 Add new programs and stamp file to .gitignore.
Signed-off-by: Tom Prince <tom.prince@ualberta.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-14 17:13:49 -07:00
Junio C Hamano
4769948afe Deal with $(bindir) and friends with whitespaces.
... using HPA's shellquote macro.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-10 13:51:52 -07:00
Junio C Hamano
8c51242873 Make sure 'make install' does not have to rebuild templates.
The dependency rule in templates directory forced 'make install'
that immediately followed 'make all' to rebuild boilerplates.
This was problematic for a workflow that built first as yourself
and then installed as root, from a working tree that is on an
NFS mounted filesystem that is unwritable by root.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-09 02:58:35 -07:00
Junio C Hamano
229a7ed7ab Solaris: give a bit more built-in defaults.
Taking the make command line Peter Eriksen uses, give defaults
to SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-24 11:26:22 -07:00
Junio C Hamano
215a7ad1ef Big tool rename.
As promised, this is the "big tool rename" patch.  The primary differences
since 0.99.6 are:

  (1) git-*-script are no more.  The commands installed do not
      have any such suffix so users do not have to remember if
      something is implemented as a shell script or not.

  (2) Many command names with 'cache' in them are renamed with
      'index' if that is what they mean.

There are backward compatibility symblic links so that you and
Porcelains can keep using the old names, but the backward
compatibility support  is expected to be removed in the near
future.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 17:45:20 -07:00
Junio C Hamano
86b13da46c scripts: equality test '==' is not portable.
On NetBSD 3 we trigger an error:

    [: ==: unexpected operator

Double-equal is accepted by bash built-in '[' and bash(1) suggests
using '=' for strict POSIX compliance (test(1) from coreutils does not
mention '==').  Eradicate their uses everywhere.

[jc: Somebody with a pseudonym kindly sent a message to let
 me know about the problem privately; I do not have access to a NetBSD
 box.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-02 10:53:15 -07:00
Tommi Virtanen
c68e10b197 [PATCH] git bugfixes and cleanups, mainly Debian things
Ignore generated files.

Signed-off-by: Tommi Virtanen <tv@debian.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-26 12:54:27 -07:00
Junio C Hamano
6687f8fea2 [PATCH] Use .git/remote/origin, not .git/branches/origin.
Now multi-head fetch is complete, let's migrate the
default configuration for new repositories created with
the "git clone" command.

The original $GIT_DIR/branches is not deprecated yet, but create
remotes directory by default from the templates as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-24 16:50:52 -07:00
Marco Costalba
b909a15ede [PATCH] Fix git-commit-script to output on stderr when -v fails
When git-commit-script is called with -v option and
verify test fails result is print on stdout
instead of stderr.

[jc: The original patch from Marco updated git-commit-script that
still had the piece of code in question, which has been moved to
an example hook script on its own, so I transplanted the patch to
that new file instead.]

Signed-off-by: Marco Costalba <mcostalba@yahoo.it>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-20 10:54:27 -07:00
Junio C Hamano
b779dd5ee3 Make sample pre-commit hook output Emacs friendly.
Use the common error message format, "filename:lineno: body";
this way, problematic lines can be jumped to from the Emacs
compilation buffer by C-x `.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-20 01:05:12 -07:00
Junio C Hamano
4426ac70a1 Add hooks to tools/git-applypatch.
This teachs git-applypatch, which is used from git-applymbox, three
hooks, similar to what git-commit-script uses.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-19 16:23:31 -07:00
Junio C Hamano
89e2c5f17b Add commit hook and make the verification customizable.
There are three hooks:

    - 'pre-commit' is given an opportunity to inspect what is
      being committed, before we invoke the EDITOR for the
      commit message;

    - 'commit-msg' is invoked on the commit log message after
      the user prepares it;

    - 'post-commit' is run after a successful commit is made.

The first two can interfere to stop the commit.  The last one is
for after-the-fact notification.

The earlier built-in commit checker is now moved to pre-commit.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-19 16:23:31 -07:00
Josef Weidendorfer
c65a9470fb [PATCH] Fixed/Extended example for update hook
Add sample code to distinguish --force rebased head and simple
fast-forward.  At the same time fixes a real bug; the "new ref"
path was using a wrong parameter.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-15 03:00:21 -07:00
Petr Baudis
a682ef9f06 [PATCH] Use $DESTDIR instead of $dest
$DESTDIR is more usual during the build than $dest and is what
is usually used in the makefiles, so let's use it too.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-12 10:38:23 -07:00
Junio C Hamano
d3af621b14 Redo the templates generation and installation.
Per discussion with people interested in binary packaging,
change the default template location from /etc/git-core to
/usr/share/git-core hierarchy.  If a user wants to run git
before installing for whatever reason, in addition to adding
$src to the PATH environment variable, git-init-db can be run
with --template=$src/templates/blt/ parameter.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-06 13:49:26 -07:00
Junio C Hamano
8d5afef0f9 Install sample hooks
A template mechanism to populate newly initialized repository
with default set of files is introduced.  Use it to ship example
hooks that can be used for update and post update checks, as
Josef Weidendorfer suggests.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-03 16:27:38 -07:00