Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #4867

Closed
Open
Created Aug 23, 2013 by Administrator@rootOwner

Commit with none file changed may cause graphs failed

Created by: sugarmo

Summary

If a repostory has none-file-changed commit, graph will not working on it.

Steps to reproduce

  1. Add a commit with no file changed into repostory. (Usually it's a submodule update)
  2. See how is it in graphs.

Expected behavior

See a beautiful graph

Observed behavior

It give me such a confusing graph:

qq20130823-1

Output of checks

There is my git log with the same args with grit used:

qq20130823-4

This commit's log does not have 5 but only 3 lines, because it had no file changed.

Then convert to JSON, it go wrong:

qq20130823-3

If there is a null in converted JSON:

qq20130823-2

Graphs will directly run into fail. (Appears "load graphs failed", as I said in #4218 (closed))

The implement in log_parser.rb has such a piece of code:

log.each_slice(5) do |slice|
  entry = {}
  entry[:author_name] = slice[0]
  entry[:author_email] = slice[1]
  entry[:date] = slice[2]

  if slice[4]
    changes = slice[4].split(",")
    entry[:additions] = changes[1].to_i unless changes[1].nil?
    entry[:deletions] = changes[2].to_i unless changes[2].nil?
  end

  collection.push(entry)
end

As we know now, there is no guarantee for that each commit has 5 lines log.

Assignee
Assign to
Time tracking