7

This is weird to my understanding and I am sure I am missing something here...

Also, GitKraken is splitting/showing commits of same branch as 2 different branches.

Here an example:

Note: numbers represents chronological order when commits were created. All commits in below picture are from master branch. Commit 7 parent is commit 6.

enter image description here

  1. Why GitKraken moved commits 5 and 6?
  2. Why GitKraken splits commits of same branch in two different "branches"? (actually only one exists, master)

In GitHub and gitk I see only one branch with all commits in chronological order.

Edit with gitk --all: (sorry for trimming message info). As I said, in github commits also are shown in chronological "expected" order.

enter image description here

cjuroz
  • 153
  • 1
  • 7
  • Seems like a bug to me... would you post an image of `gitk --all`? – ErniBrown Aug 27 '18 at 07:10
  • @ErniBrown updated post with `gitk --all` – cjuroz Aug 27 '18 at 07:17
  • 3
    pretty sure this is is a bug and you should report it to gitkraken team. – ErniBrown Aug 27 '18 at 07:20
  • 2
    I think @ErniBrown has it right, looks like a bug, especially since there is no branch info for commit 6 and it's just dangling there. I had similar issues after rebasing; committing something else and restarting GK usually fixed this for me. Did you recently perform a `rebase` or changed commits otherwise? – kowsky Aug 27 '18 at 08:45
  • Thanks both, I just reported this possible bug to them. Regarding this repo/issue, those commits are not recent and I just cloned it to my computer. – cjuroz Aug 27 '18 at 09:07
  • Encountering same issue, commit times are not chronological. – Tarps Oct 03 '18 at 11:30
  • I am experiencing the same issue. – Myridium Dec 02 '18 at 08:25
  • Same issue here, but in Git GUI I noticed in the lower pane that the date-time stamp for "Author" and "Committer" are different, and they are sorted by Author date, not Committer. That explained the out-of-order issue in my case. – Ian W Jan 22 '19 at 15:16

2 Answers2

4

I asked GitKraken support about this a while ago. Their response:

The graph behavior you noted below is a known issue that is currently with our team for review. GitKraken only looks at the commit timestamp when drawing the graph, so when those commits are not in chronological order, the result is the orphaned commit seemingly on a separate branch. I'll give that existing item a +1 to note your additional interest in a fix for that issue.

Jorn
  • 20,612
  • 18
  • 79
  • 126
1

From what I can tell if your dates seem chronological in GitKraken and you're still getting this it's because GitKraken only displays the author date while using the committer date to sort the commits, meaning the two of em have somehow gotten out of sync.

You could, of course, fix this with an interactive rebase but that'll flatten any development branches you have down the line from the issue, definitely not ideal. The far better solution seems to be to run the following:

git filter-branch --env-filter "export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"" -- --all

[taken from jphx, I just swapped out the quotes to get it to work across more shells]

Good luck!

Fraser
  • 290
  • 3
  • 11
  • I don't recommend messing with Git history this far back, especially if you have more than a few developers – Jorn Jul 24 '19 at 20:40
  • Yes, filter-branch can be a powerful tool to re-write history, but in this case we're not targeting any specific commit (just unifying info across all commits) so it's probably fine. In the worst case scenario you can always make a backup of the repo first (probably a good idea anyways) and force push it over the broken one. – Fraser Jul 25 '19 at 03:49
  • All your developers will still have to do a clean checkout, and move all their uncommitted / unpushed work to the new repo. That's going to take a lot of time. – Jorn Jul 25 '19 at 07:29