Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1957 - Fix forwarding stdin to pre/post-receive scripts #1975

Closed
wants to merge 1 commit into from

Conversation

olivier-mauras
Copy link

Fix #1957
Ensure stdin is forwarded for pre/post-receive hooks

Copy link
Member

@lafriks lafriks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be as new migration step as otherwise scripts won't be updated for anyone using 1.1+ version

@olivier-mauras
Copy link
Author

Oh now I have to get a grasp of those migration steps ^^

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 15, 2017
@lunny lunny added this to the 1.2.0 milestone Jun 18, 2017
@lunny lunny added the type/bug label Jun 18, 2017
@lunny
Copy link
Member

lunny commented Jun 18, 2017

And maybe some integration test? There are many examples in integrations directory.

@@ -31,9 +31,9 @@ func generateAndMigrateWikiGitHooks(x *xorm.Engine) (err error) {
var (
hookNames = []string{"pre-receive", "update", "post-receive"}
hookTpls = []string{
fmt.Sprintf("#!/usr/bin/env %s\nORI_DIR=`pwd`\nSHELL_FOLDER=$(cd \"$(dirname \"$0\")\";pwd)\ncd \"$ORI_DIR\"\nfor i in `ls \"$SHELL_FOLDER/pre-receive.d\"`; do\n sh \"$SHELL_FOLDER/pre-receive.d/$i\"\ndone", setting.ScriptType),
fmt.Sprintf("#!/usr/bin/env %s\nORI_DIR=`pwd`\nSHELL_FOLDER=$(cd \"$(dirname \"$0\")\";pwd)\nread STDIN\ncd \"$ORI_DIR\"\nfor i in `ls \"$SHELL_FOLDER/pre-receive.d\"`; do\n echo \"$STDIN\" | sh \"$SHELL_FOLDER/pre-receive.d/$i\"\ndone", setting.ScriptType),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this need a new migration since this has already been ran...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree for already migrated instances, but not on instances still on gogs that will migrate to gitea...
Or you mean that it's pointless anyway cause it needs its own migration step anyway that will happen in both cases ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For instances migrating from Gogs, they will have to go through all migrations. The latest migration to touch a file "wins" 🙂

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood. I'll remove the modification from there and add it in its own migration step then.

@lafriks
Copy link
Member

lafriks commented Jul 1, 2017

This issue is actually already resolved in commit fe94032 and this PR just fixes older migrations that will be overridden by migration v26 anyway

@lafriks lafriks closed this Jul 1, 2017
@lunny lunny removed this from the 1.2.0 milestone Jul 2, 2017
@lunny lunny added the issue/duplicate The issue has already been reported. label Jul 2, 2017
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported. lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No information is given on stdin for pre/post-receive
5 participants