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
  • #8744

Closed
Open
Created Feb 06, 2015 by Administrator@rootOwner

Network graph shows incorrect merge history when merge parent timestamps are later than merge

Created by: Hooksie

When a merge commit is performed that references a merge parent with a timestamp that is later than the merge commit itself, the network graph displays that the merge parent is the latest commit on the parents branch that occurs before the merge commit, which is incorrect.

This can occur when a client has a system clock set in the future, relative to the Gitlab server, and a commit is made to a branch shortly before it is merged in (either through a merge request or by another user) AND when the source branch still exists at the last commit in the branch.

Incorrect behavior: The network graph marks 49945e4 as one of 19eda68's parents.

Example: gitlabnetwork

commit 19eda6824321d5dbf1d75e52fa1943850d34ae93 Merge: 16ca233 660c6db Author: *** Date: Thu Feb 5 18:12:26 2015 -0500 ...

commit 660c6db94e234d7f3f3f786fc24103029984ee9f Author: *** Date: Thu Feb 5 18:14:38 2015 -0500 ...

commit 49945e44f26b8dc270f287b162e59519b48cadc5 Author: *** Date: Thu Feb 5 18:09:51 2015 -0500 ...

Proper behavior: The merge arrow from branch b1 should occur after 660c6db.

You can recreate this problem in a fresh repository by:

  1. git init
  2. touch file1; git add -A; git commit -m "Initial commit"
  3. git checkout -b branch1
  4. touch file2; git add -A; git commit -m "Commit on branch1"
  5. touch file3; git add -A; git commit -m "Incorrect system time commit"
  6. GIT_COMMITTER_DATE="$((git log -1 --pretty=format:%at` + 3600))" git commit --amend --no-edit --date="$((git log -1 --pretty=format:%at + 3600))"` (Alter the previous commit to occur one hour in the future)
  7. git checkout master
  8. touch file4; git add -A; git commit -m "Correct system time commit"
  9. git merge branch1
  10. Add your Gitlab remotes and push master, THEN push branch1. Notice that after pushing master the network graph is correct, but after pushing branch1 the network graph is incorrect, as below:

After pushing master (correct): image

After pushing branch1 (incorrect): image

Found on 7.7.1.

Assignee
Assign to
Time tracking