Gitea: A new branch raise an error even if the job is done

Created on 3 Apr 2018  路  8Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.4.0 (final release) (issue initially got on 1.4.0rc3)
  • Git version: 2.1.4
  • Operating system:
  • Database (use [x]):

    • [ ] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [x] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [x] No

    • [ ] Not relevant

  • Log gist:

Description

Done on any repo (test made on a fresh new repo, after the initial commit)

  1. I'm creating a "new file" (named test.md) in a "new branch" (a banch named test) with a commit message test
  2. I got the following error message, with a HL on the filename (like a bad file name)
PushUpdate: newCommit.CommitsBeforeLimit: exit status 129 - error: unknown option `contains' usage: git for-each-ref [options] [] -s, --shell quote placeholders suitably for shells -p, --perl quote placeholders suitably for perl --python quote placeholders suitably for python --tcl quote placeholders suitably for tcl --count show only matched refs --format format to use for the output --sort field name to sort on
  1. in fact the branch test successfully is created.

It seems a "post-*" hook issue.

Screenshots

  1. and 2. create a new file in a new branch

  2. the-branch-is-created

kinbug

Most helpful comment

I tried with the build from master (would be 1.5.0) and it works fine now!

All 8 comments

Getting this with pushes to repo, any idea how it could be fixed?

This in the logs:

2018/06/04 23:40:27 [T] PushUpdate: http://0.0.0.0:3000/api/internal/push/update
2018/06/04 23:40:27 [...io/gitea/cmd/hook.go:212 runHookPostReceive()] [E] Update: Failed to update public key: newCommit.CommitsBeforeLimit: exit status 129 - error: unknown option `contains'
usage: git for-each-ref [options] [<pattern>]

    -s, --shell           quote placeholders suitably for shells
    -p, --perl            quote placeholders suitably for perl
    --python              quote placeholders suitably for python
    --tcl                 quote placeholders suitably for tcl

    --count <n>           show only <n> matched refs
    --format <format>     format to use for the output
    --sort <key>          field name to sort on

@berkus What version of Gitea are you using (and also what version of Git are you using)?

Can you please check if 1.4.2 has fixed this issue?

Yes I confirmed : 1.4.1 = bug ; 1.4.2 = FIXED
(FYI I still have git version 2.1.4)

Do you know what is changed to fix the issue ?

We had a bug in our git package that used --contains option which isn't available in older git version.
It was fixed by implementing a fallback solution for versions not supporting it.

I tried with the build from master (would be 1.5.0) and it works fine now!

Closing issue as fixed, please reopen if issue persists in latest version

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

kolargol picture kolargol  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

flozz picture flozz  路  3Comments

cookiengineer picture cookiengineer  路  3Comments