This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc.git: hook to prohibit pushing "bad-merge" commits


Petr Baudis wrote:
> On Thu, Jun 04, 2009 at 09:05:50AM +0200, Jim Meyering wrote:
>> > By default, that hook script has an independent setting to prohibit
>> > pushing a commit that adds trailing blanks.  If committers don't want
>> > that, let me know and I'll turn it off.  However, I suggest that you
>> > leave it enabled and, if necessary, add '.gitattributes' entries to allow
>> > whatever violations you deem appropriate.
>
>   Can you help me out here, please? I'm probably doing something obvious
> mistake...
>
>   I have trouble pushing out current release/2.11/master, since it
> requires me to add a trailing blank line at the bottom of INSTALL.
> (Ulrich removed it, but make dist complains if INSTALL does not
> match makeinfo's manual/install.texi 1:1.) I added .gitattributes
> entry INSTALL -whitespace in the same commit, but the hook still
> complains:
>
> 	remote: INSTALL:464: new blank line at EOF.
> 	remote: error: hook declined to update refs/heads/release/2.11/master
>
>   You can find the branch I'm trying to push at
>
> 	git://repo.or.cz/glibc/pb-stable.git release/2.11/master

Hi Petr,

I've temporarily done this on the server,

  GIT_DIR=/git/glibc.git git config --bool hooks.allowbadwhitespace true

so you should be able to push.
Let me know when you're done and I'll reset it.

I'm not sure if this is exactly the script in glibc's repository,
but it's close.  If you're interested, I can make it so you can use the
mechanism described in comments to flip this flag yourself:

  http://git.et.redhat.com/?p=ovirt-server.git;a=blob_plain;f=git-hook/update;hb=refs/heads/vcs-admin

# ---------------------------------------------------------------------
# Allow people to change server-side git config in very specific ways.
# To enable this, on the server, you must do something like the following,
#
# git config hooks.server.config-changing.valid-commands \
# 'git config hooks.allowbadwhitespace true
# git config hooks.allowbadwhitespace false
# git config hooks.denypush.branch.master master-branch-owner@example.com
# git config --unset hooks.denypush.branch.master'
#
# where the git config variable, hooks.server.config-changing.valid-commands,
# contains the list of commands that are allowed, one per line.
#
# CAUTION: nothing about this hook code enforces the restriction that
# only "git config ..." commands be run automatically.
# That restriction comes solely from the list above.
#
# Then, when someone with a cloned repository wants to make the hook
# run one of those commands *on* *the* *server*, that user must push
# a tag whose name starts with "git-control-" and whose one-line message
# matches exactly one of the listed commands.
#
# For example, to temporarily allow someone to push a bad-whitespace
# commit, with the settings implied above, you might do this:
#
#   first_commit=$(git log --reverse --pretty=%H |head -1)
#   git tag -m 'git config hooks.allowbadwhitespace true' \
#     git-control-$(date +%F-%H-%M-%S.%N) $first_commit
#
# Note that we're not tagging HEAD, but rather the very first commit
# in the repository, in an attempt not to clutter up gitk/gitweb
# displays with these rarely-interesting tag names.
#
# Then, to reenable that hook, do this (nearly the same, except s/true/false/):
#
#   first_commit=$(git log --reverse --pretty=%H |head -1)
#   git tag -m 'git config hooks.allowbadwhitespace false' \
#     git-control-$(date +%F-%H-%M-%S.%N) $first_commit
# ---------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]