Random things of a random world

Sami's Page

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Github and Commit History

Github says they have two ways of checking commits: either by branch for the whole repository or a single file's commits. I ran into an issue with the latter.

I have a file that naturally is in several branches. I edit one branch and another developer edits another. I add a piece of code into a method. Everything's fine. It's there. I merge the other developer's branch (which is the parent of my branch), everything's still fine. Code is nice. Git does what it's supposed to.

Then later I go into Github and check the history of the file. I view the file after my commit. It's fine, all my code is there. Then I click to view the file after the other dev's commit. What the heck, my code is missing? Did the dev remove it? Checking the diff... No, they didn't. They just added their own. Strange...

Let's check my next commit on the list. Yes, my code is there. All is fine. Hmm...

It seems that the Browse the repository at this point in the history shows you the file in another branch! It doesn't show my branch after I merged their changes. It shows their branch after it. Which has a different result.

This should be at least clearly explained, or rather, show the file as it is in my branch after I merged those changes. That shouldn't be a problem.

And if it happens to show commits in any branch, it's even worse since it doesn't explain this anywhere and no commit has any branch information.

No idea if other people have ran into this, a quick search didn't show any results. Have to contact Github and ask.

 

Add comment

Loading