Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fail_if_collaborato…
Browse files Browse the repository at this point in the history
…r_already_exists
  • Loading branch information
adelowo committed Aug 6, 2018
2 parents 618dabd + 9ea327f commit b174273
Show file tree
Hide file tree
Showing 51 changed files with 2,319 additions and 198 deletions.
2 changes: 2 additions & 0 deletions custom/conf/app.ini.sample
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ ISSUE_PAGING_NUM = 10
FEED_MAX_COMMIT_NUM = 5
; Number of maximum commits displayed in commit graph.
GRAPH_MAX_COMMIT_NUM = 100
; Number of line of codes shown for a code comment
CODE_COMMENT_LINES = 4
; Value of `theme-color` meta tag, used by Android >= 5.0
; An invalid color like "none" or "disable" will have the default style
; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
Expand Down
4 changes: 2 additions & 2 deletions docs/content/doc/features/comparison.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ _Symbols used in table:_
| Pull/Merge requests ||||||||
| Squash merging ||||||||
| Rebase merging ||||||||
| Pull/Merge request inline comments | |||||||
| Pull/Merge request approval | |||||||
| Pull/Merge request inline comments | |||||||
| Pull/Merge request approval | |||||||
| Merge conflict resolution ||||||||
| Restrict push and merge access to certain users ||||||||
| Revert specific commits or a merge request ||||||||
Expand Down
36 changes: 36 additions & 0 deletions docs/content/doc/installation/from-binary.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ cp gitea /usr/local/bin/gitea

See how to create [Linux service]({{< relref "run-as-service-in-ubuntu.en-us.md" >}})

## Updating to a new version

You can update to a new version of gitea by stopping gitea, replacing the binary at `/usr/local/bin/gitea` and restarting the instance.
The binary file name should not be changed during the update to avoid problems
in existing repositories.

It is recommended you do a [backup]({{< relref "doc/usage/backup-and-restore.en-us.md" >}}) before updating your installation.

If you have carried out the installation steps as described above, the binary should
have the generic name `gitea`. Do not change this, i.e. to include the version number.

See below for troubleshooting instructions to repair broken repositories after
an update of your gitea version.

## Troubleshooting

### Old glibc versions
Expand All @@ -107,3 +121,25 @@ For errors like `702 runWeb()] [E] Failed to start server: listen tcp 0.0.0.0:30
bind: address already in use` gitea needs to be started on another free port. This
is possible using `./gitea web -p $PORT`. It's possible another instance of gitea
is already running.

### Git error after updating to a new version of gitea

If the binary file name has been changed during the update to a new version of gitea,
git hooks in existing repositories will not work any more. In that case, a git
error will be displayed when pushing to the repository.

```
remote: ./hooks/pre-receive.d/gitea: line 2: [...]: No such file or directory
```

The `[...]` part of the error message will contain the path to your previous gitea
binary.

To solve this, go to the admin options and run the task `Resynchronize pre-receive,
update and post-receive hooks of all repositories` to update all hooks to contain
the new binary path. Please note that this overwrite all git hooks including ones
with customizations made.

If you aren't using the built-in to Gitea ssh server you will also need to re-write
the authorized key file by running the `Update the '.ssh/authorized_keys' file with
Gitea SSH keys.` task in the admin options.
22 changes: 22 additions & 0 deletions models/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -1344,3 +1344,25 @@ func IsErrUnknownDependencyType(err error) bool {
func (err ErrUnknownDependencyType) Error() string {
return fmt.Sprintf("unknown dependency type [type: %d]", err.Type)
}

// __________ .__
// \______ \ _______ _|__| ______ _ __
// | _// __ \ \/ / |/ __ \ \/ \/ /
// | | \ ___/\ /| \ ___/\ /
// |____|_ /\___ >\_/ |__|\___ >\/\_/
// \/ \/ \/

// ErrReviewNotExist represents a "ReviewNotExist" kind of error.
type ErrReviewNotExist struct {
ID int64
}

// IsErrReviewNotExist checks if an error is a ErrReviewNotExist.
func IsErrReviewNotExist(err error) bool {
_, ok := err.(ErrReviewNotExist)
return ok
}

func (err ErrReviewNotExist) Error() string {
return fmt.Sprintf("review does not exist [id: %d]", err.ID)
}
21 changes: 21 additions & 0 deletions models/fixtures/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,24 @@
issue_id: 1 # in repo_id 1
content: "meh..."
created_unix: 946684812
-
id: 4
type: 21 # code comment
poster_id: 1
issue_id: 2
content: "meh..."
review_id: 4
line: 4
tree_path: "README.md"
created_unix: 946684812
invalidated: false
-
id: 5
type: 21 # code comment
poster_id: 1
issue_id: 2
content: "meh..."
line: -4
tree_path: "README.md"
created_unix: 946684812
invalidated: false
32 changes: 32 additions & 0 deletions models/fixtures/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-
id: 1
type: 1
reviewer_id: 1
issue_id: 2
content: "Demo Review"
updated_unix: 946684810
created_unix: 946684810
-
id: 2
type: 1
reviewer_id: 534543
issue_id: 534543
content: "Invalid Review #1"
updated_unix: 946684810
created_unix: 946684810
-
id: 3
type: 1
reviewer_id: 1
issue_id: 343545
content: "Invalid Review #2"
updated_unix: 946684810
created_unix: 946684810
-
id: 4
type: 0 # Pending review
reviewer_id: 1
issue_id: 2
content: "Pending Review"
updated_unix: 946684810
created_unix: 946684810
Loading

0 comments on commit b174273

Please sign in to comment.