Commit Graph

7 Commits

Author SHA1 Message Date
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
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
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
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
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