Can not suport git revision version contains '-' #1896

Closed
opened 2025-11-02 04:17:07 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @duffiye on GitHub (Jun 8, 2018).

  • Gitea version (or commit ref): v1.4

  • Git version: 2.18.0-rc1

  • Operating system: centos 6

  • 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:

       2018/06/08 03:57:01 [...s/setting/setting.go:890 NewContext()] [E] Error parsing git revision version: strconv.ParseUint: parsing "0-rc1": invalid syntax
    

Description

Can not suport git revision version contains '-' ;

 	revisionVersion, err := strconv.ParseUint(splitVersion[2], 10, 64)
	if err != nil {
		log.Fatal(4, "Error parsing git revision version: %v", err)
	}

maybe can do it like this:

     revisionVersion, err := strconv.ParseUint(strings.SplitN(splitVersion[2], "-", 1), 10, 64)

Screenshots

Originally created by @duffiye on GitHub (Jun 8, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): v1.4 - Git version: 2.18.0-rc1 - Operating system: centos 6 - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x] No - [ ] Not relevant - Log gist: 2018/06/08 03:57:01 [...s/setting/setting.go:890 NewContext()] [E] Error parsing git revision version: strconv.ParseUint: parsing "0-rc1": invalid syntax ## Description Can not suport git revision version contains '-' ; revisionVersion, err := strconv.ParseUint(splitVersion[2], 10, 64) if err != nil { log.Fatal(4, "Error parsing git revision version: %v", err) } maybe can do it like this: revisionVersion, err := strconv.ParseUint(strings.SplitN(splitVersion[2], "-", 1), 10, 64) ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 04:17:07 -06:00
Author
Owner

@duffiye commented on GitHub (Jun 8, 2018):

            rv := strings.SplitN(splitVersion[2], "-", 2)
            log.Info(rv[0])
            revisionVersion, err := strconv.ParseUint(rv[0], 10, 64)
@duffiye commented on GitHub (Jun 8, 2018): rv := strings.SplitN(splitVersion[2], "-", 2) log.Info(rv[0]) revisionVersion, err := strconv.ParseUint(rv[0], 10, 64)
Author
Owner

@stale[bot] commented on GitHub (Jan 24, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Jan 24, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@stale[bot] commented on GitHub (Feb 18, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Feb 18, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Author
Owner

@6543 commented on GitHub (Sep 17, 2020):

should be the case now, feel free to ask for reopen if you have still issues with it

@6543 commented on GitHub (Sep 17, 2020): should be the case now, feel free to ask for reopen if you have still issues with it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1896