Skip to content

Git-Hook for update does not get the refname, oldrev, newrev as parameter #2090

@TomFreudenberg

Description

@TomFreudenberg
  • Gitea version (or commit ref): v1.1
  • Git version: 2.10.1 (Apple Git-78)
  • Operating system: OSX/Ubuntu
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Hi, I have tested some simple scripts from here:

https://git-scm.com/book/uz/v2/Customizing-Git-An-Example-Git-Enforced-Policy

and put that as update-hook via Git-Hooks->update

#!/usr/bin/env ruby

$refname = ARGV[0]
$oldrev  = ARGV[1]
$newrev  = ARGV[2]
$user    = ENV['USER']

puts "Enforcing Policies..."
puts "(#{$refname}) (#{$oldrev[0,6]}) (#{$newrev[0,6]})"

But it seems that the ARGV is empty.

Also a very simple

#!/bin/bash
echo "$1 $2 $3"

doesn't print out anything.

From where in the "hook call" of gitea I will be able to read the refs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions