I'm not sure when this started happening, about 4 months ago I guess. It's 
a little complicated to explain, I'll try using an example:

Let's say we have a repository with 3 branches:
- master: matches the current production release
- develop: master + changes already approved for the next minor release
- developMajor: develop + changes already approved for the next major 

Critical fixes are applied to master, develop and developMajor.
Minor fixes and features for the next minor release are applied to develop 
and developMajor.
Features for the next major release are applied only to developMajor.
The branch developMajor is not necessarily backwards compatible with the 
previous releases.

Let's say we have a Java class with a field declared as Object, but for 
some reason we decided it should actually be an int[], so we changed it on 
the developMajor branch only.
Six months later I spotted a minor bug in this class and we decided it 
should only be addressed on the next minor release.
I created a new branch from the develop and after fixing and testing the 
new branch, it was time to merge it back to the develop branch.
Thanks to a rather silly conflict, I spotted something odd using a 3-way 
merge tool: the field was declared as int[] instead of Object!
Someone must have screwed up and merged the wrong branch to develop, right? 
So I checked the history and there was nothing wrong. There was no 
suspicious merge, so what happened?
After checking every commit that changed the file I finally got to that 
commit we made six months ago only to developMajor, and now it says it was 
applied to both developMajor and develop! There's no way this could go 
unnoticed for 6 months!

I checked with my co-workers and one of them that hasn't been working on 
this particular project last updated his repo about 3 months ago. So I 
checked out his version of the develop branch and the damned field is 
declared as Object, as it should be. The history also says that commit made 
6 months ago was applied only to the developMajor branch.

I don't know how this happened, but apparenly this commit leaked from one 
branch to the other in the past 3 months. Should that even be possible?

This example is actually pretty similar to the last problem we spotted 
during a merge, but this happened a few times already in the past months 
and so far we have always assumed someone had screwed up and manually 
fixed. But now we are worried about what else could have "leaked" that we 
may have not noticed.

Is there a way to find out when and how this happened and fix it?
Is it possible that one of our copies of the repo got somehow broken and 
the central repo got screwed up after a regular push (not forced)?

Thanks in advance.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to