Branch: Tag:


2023-01-30 11:40:40 by Henrik Grubbström (Grubba) <>

Allow space indentation if the linefeed was escaped mk II.

2023-01-30 09:32:38 by Henrik Grubbström (Grubba) <>

Allow space indentation if the linefeed was escaped.


2022-12-23 12:05:57 by Henrik Grubbström (Grubba) <>

Some minor adjustments.

2022-12-23 11:59:31 by Henrik Grubbström (Grubba) <>

Plugins: Added flag to check_commit() to inhibit changes.

The check_commit() plugin hook is now called also from


2022-12-09 14:16:09 by Henrik Grubbström (Grubba) <>

Do not use get_staged_file() directly from check_blocker_attributes().

Also: Restructured the indent checks a bit to reduce duplicated code.

2022-12-09 12:36:18 by Henrik Grubbström (Grubba) <>

Complain if more mixed indentations are added.

2022-12-09 10:50:34 by Henrik Grubbström (Grubba) <>

Add support for the attributes {mixed,space,tab}_indent.


2022-09-02 09:19:34 by Henrik Grubbström (Grubba) <>

Make run_git() and run_git_ex() available to plugins.

Also makes git_run_ex() always return "" on failure (some git commands
have some output on stdout also on failure (eg git-rev-parse)).


2020-04-03 14:20:43 by Henrik Grubbström (Grubba) <>

Add support for use with worktrees.

Move get_git_dir() to the global scope, and add get_git_commondir().

Update the installer and access-control to use the above.

Fixes #10025.


2020-03-22 15:04:48 by Henrik Grubbström (Grubba) <>

Plugins: Default the plugin to pike-gitlab.

2020-03-22 15:04:20 by Henrik Grubbström (Grubba) <>

Plugins: Support selecting a plugin via environment variable.


2020-03-21 15:13:07 by Henrik Grubbström (Grubba) <>

Fixed typo in error message.

2020-03-21 15:11:58 by Henrik Grubbström (Grubba) <>

Added plugin api.

2020-03-21 15:08:47 by Henrik Grubbström (Grubba) <>

Install the githelper-plugins symlink.

2020-03-21 15:08:47 by Henrik Grubbström (Grubba) <>

Moved check_commit_msg() into CommitHookUtilsRepo.

This is in preparation for adding support for plugins.


2018-04-24 10:50:31 by Henrik Grubbström (Grubba) <>

Improved error message.

Show the arguments given to the git binary in the
git failure message.

2018-04-24 10:49:12 by Henrik Grubbström (Grubba) <>

Support committing on a detached HEAD.

This fixes failures to amend commits during interactive rebase.


2018-04-12 12:05:24 by Marcus Comstedt <>

Handle pushing of orphan commits


2017-04-13 10:21:44 by Henrik Grubbström (Grubba) <>

Added support for tracking branches.

These are a class of branches that essentially behave as movable tags.


2016-12-07 10:30:06 by Henrik Grubbström (Grubba) <>

Improved compatibility with *old* versions of Pike.

2016-12-07 10:25:35 by Henrik Grubbström (Grubba) <>

Added access level ACCESS_GROUP.

This is to simplify detection of access to group-level tags and branches.

Allow ordinary group members to create group tags and branches.

Use symbolic names for all access_level checks.

2016-12-07 10:24:38 by Henrik Grubbström (Grubba) <>

Users should always have full permissions to their own group.

2016-12-07 10:21:24 by Henrik Grubbström (Grubba) <>

Added some startup debug code.

This debug is enabled by starting githelper.pike with /bin/sh
(eg via switching the #! directive at the start of the file
to #!/bin/sh).


2016-11-30 17:25:48 by Henrik Grubbström (Grubba) <>

Preprocessor directives should not be indented.

2016-11-30 17:14:46 by Henrik Grubbström (Grubba) <>

Allow .gitattributes in subdirectories.

2016-11-30 17:08:49 by Henrik Grubbström (Grubba) <>

pre-receive: Don't fail group access check silently.


2016-02-07 00:35:33 by Chris Angelico <>

Support both 8.1 and 7.8


2014-10-24 12:54:50 by Henrik Grubbström (Grubba) <>

Fixed indentation.


2014-08-28 13:30:34 by Henrik Grubbström (Grubba) <>

Fixed warnings about static.

The keyword "static" has been marked deprecated in Pike 8.0.

Thanks to Chris Angelico <> for the report.


2013-08-09 10:15:27 by Henrik Grubbström (Grubba) <>

Add support for group-based access control.

This patch adds support for a group file ".git/info/group"
containing a mapping from group names to member users.

Note that the first listed member of a group gets full
access and the following basic access. Users not listed
get no access. If multiple users need full access, this
can be achieved by having multiple entries for the group.

Also cleans up the access level handling code somewhat
by introducing an enum AccessLevel.


2013-01-23 20:47:08 by Marcus Comstedt <>

Removed broken use of Stdio.is_file(path)

Stdio.is_file(path) should not be used to check if some path is a
file, because it is not whether path is a file or not in the working
tree which is relevant, but rather whether or not it is one in the
commit/stage being investigated. In fact, there might not even be
a working tree since this test is also run on the server.

Instead, use get_file(path,2), which returns the empty string for
directories, which should have the intended effect of not complaining
about foreign_ident being removed from directories.

2013-01-23 20:18:30 by Marcus Comstedt <>

Add a kluge to handle pushes to branches with exactly one commit

When pushing to a branch, githelper checks if the old head of the
branch is reachable from the new head following only first-parents.
As an optimization, no more first-parents are followed once the old
head has been reached, which is to say old^ and its ancestors are
excluded from the rev-list. However, if old does not have a parent,
then rev-list fails to interpret old^. So as a kluge, detect this
case and disable the optimization as needed...


2011-04-25 16:55:30 by Martin Stjernholm <>

Allow removal of bogus foreign_ident entries for nonfiles.

There is one such mistake for /lib/modules/MIME.pmod in
.gitattributes on the main pike branches.

2011-04-25 16:38:10 by Martin Stjernholm <>

Fixed recognition of unterminated idents.


2011-03-19 23:11:58 by Marcus Comstedt <>

Implement access control namespaces

You now get access to tags and branches bases on their name:


Full access (create, delete and rebase/move all allowed, no policy
checking of commits)


No push access, unless the previous rule also matches


Regular access (no delete or rebase/move, names of newly created
branches and tags must contain no slashes, and branch names must not
consist entirely of digits and full stops)


2011-01-23 14:21:35 by Marcus Comstedt <>

Fix problem when changing a file into a directory

Add a second "allow_empty" mode to get_committed_file, which returns
the empty string is the named file is actually a directory. This is
used by the check_ident() function, which is ok since a directory
can't contain any expanded idents, so there is nothing to check.

Note that get_staged_file() ought to support this mode as well.
Currently, running get_staged_file() on a directory actually returns
the contents of the first file in the directory, which is a bug.


2011-01-13 11:02:08 by Marcus Comstedt <>

Check that pushes preserve first-parent ancestry

In addition to checking that a push is fast-forward, make sure
that the old head can be reached through first-parent pointers only.
This prevents tracking branches which have been pulled with merge
instead of rebase from being pushed by mistake.


2010-11-01 22:30:48 by Marcus Comstedt <>

Improve performance of run_git_ex()

Instead of calling Pike.DefaultBackend() until p->status() says tha
the process has terminated, loop until both stdout and stderr have
been closed. This is better because otherwise we may be stuck
inside the backend for up to one second while the process is already
terminated. This change gives a considerable speedup on Solaris.


2010-10-10 19:38:22 by Martin Stjernholm <>

Report all errors instead of stopping at the first one.

2010-10-10 19:23:05 by Martin Stjernholm <>

Improved some error messages.


2010-10-04 22:45:33 by Marcus Comstedt <>

Relax check on removal of foreign_ident

The foreign_ident attribute is now allowed to be removed from a file
which has already been been deprived of its expanded ident string.
This situation can happen when amending rebased commits.

2010-10-04 20:33:30 by Martin Stjernholm <>

Don't fail in check_ident on deleted files.

2010-10-04 14:10:46 by Marcus Comstedt <>

Only check each commit once in the recieve hook.

2010-10-04 10:54:33 by Marcus Comstedt <>

Add a post-rewrite hook to check rebases.

2010-10-04 10:54:32 by Marcus Comstedt <>

Re-run tests in post-commit hook

If amending a commit, the pre-commit hook will only see the
new changes being amended to the commit, not the changes
which were originally in the commit. Therefore, amending
an old broken commit might not show all problems unless
the result is also double checked.


2010-10-03 23:10:58 by Martin Stjernholm <>

Made it to work with 7.6.

To be a bit nicer to folks that have that old version in their paths, as
it's still the stock version coming with many dists.

2010-10-03 12:02:13 by Marcus Comstedt <>

Check also for weird control characters in recoded commit message.

2010-10-03 11:51:23 by Marcus Comstedt <>

Check encoding of commit messages.


2010-10-02 15:11:13 by Marcus Comstedt <>

Check dates of commits.

2010-10-02 15:07:10 by Marcus Comstedt <>

Make sure that git diff understands that .gitattributes is a pathname.


2010-09-27 21:51:57 by Marcus Comstedt <>

Check that tags are not moved and branches only fast-forwarded.

2010-09-27 21:15:03 by Marcus Comstedt <>

Optimized attribute lookup.

2010-09-27 21:07:24 by Marcus Comstedt <>

Added a post commit hook, to re-checkout files with ident.


2010-09-26 21:01:57 by Marcus Comstedt <>

"fe" should have been "fi".

2010-09-26 20:49:35 by Marcus Comstedt <>

Made a convenience function to split with \n and remove last element.

2010-09-26 20:46:29 by Marcus Comstedt <>

Prevent code working with idents from being munged by the ident handling itself...

2010-09-26 20:35:38 by Marcus Comstedt <>

Improve code reuse yet a little more.

2010-09-26 20:15:19 by Marcus Comstedt <>

Improve code reuse a little more.

2010-09-26 20:14:48 by Marcus Comstedt <>

Improve code reuse a little.

2010-09-26 17:24:49 by Marcus Comstedt <>

Pre-reverse attribute arrays for simpler access.


2010-09-25 20:39:18 by Marcus Comstedt <>

Improved attribute checking in server hook.

2010-09-25 20:01:26 by Marcus Comstedt <>

Server side hook.

2010-09-25 17:32:11 by Marcus Comstedt <>

Disable stupid filter.

2010-09-25 17:30:28 by Marcus Comstedt <>

Don't process changes to macro definitions in .gitattributes.

2010-09-25 17:28:29 by Marcus Comstedt <>

Restrict use of .gitattributes to top level dir.

2010-09-25 17:19:32 by Marcus Comstedt <>

Check for removal of lines from .gitattributes.

2010-09-25 14:43:41 by Marcus Comstedt <>

Handle foreign_idents.

2010-09-25 13:48:09 by Marcus Comstedt <>

Check for blocker attributes on commit.

2010-09-25 13:09:17 by Marcus Comstedt <>

Replace PostCheckoutHook with PreCommitHook.


2010-09-05 15:35:05 by Marcus Comstedt <>

Learn how to count... :)

2010-09-05 15:19:58 by Marcus Comstedt <>

Name params to post-checkout hook.

2010-09-05 15:17:27 by Marcus Comstedt <>

No args given to filter functions...

2010-09-05 15:15:04 by Marcus Comstedt <>

Nice, but ultimately useless, ident filter finished...

2010-09-05 14:34:01 by Marcus Comstedt <>

Whitespace fixes, and added a missing error message.

2010-09-05 14:28:50 by Marcus Comstedt <>

Added missing return statement.

2010-09-05 14:09:37 by Marcus Comstedt <>

Initial framework.