threads / discuss / 28772

git merge successfully however this is still issue from logical perspective

Subject: git merge successfully however this is still issue from logical perspective

## tl;dr

4 messages between Oct 26, 2011 and Oct 26, 2011.

replies: 3people: 2as markdown or json

Lynn Lin· Oct 26, 2011, 12:08 UTC · lore
Hi all,
   Do this case can happen? When I do merge from one branch to master
branch,merge successfully however from code logical perspective it
fails and It cause code compile (our project is using C++ language)

Thanks Lynn

Thomas Rast· Oct 26, 2011, 12:27 UTC · re: Lynn Lin · lore

Re: git merge successfully however this is still issue from logical perspective

Lynn Lin wrote:
> Hi all,
>    Do this case can happen? When I do merge from one branch to master
> branch,merge successfully however from code logical perspective it
> fails and It cause code compile (our project is using C++ language)

Sure. The easiest example is when one side of a merge renames foo() to bar(), while the other side introduces another call to foo() in an unrelated part of the code.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Lynn Lin· Oct 26, 2011, 12:29 UTC · re: Thomas Rast · lore

Re: git merge successfully however this is still issue from logical perspective

On Wed, Oct 26, 2011 at 8:27 PM, Thomas Rast <trast@student.ethz.ch> wrote:
Show 9 quoted lines
> Lynn Lin wrote:
>> Hi all,
>>    Do this case can happen? When I do merge from one branch to master
>> branch,merge successfully however from code logical perspective it
>> fails and It cause code compile (our project is using C++ language)
>
> Sure.  The easiest example is when one side of a merge renames foo()
> to bar(), while the other side introduces another call to foo() in an
> unrelated part of the code.
Does this mean we shouldn't trust merge result  ?
Show 5 quoted lines
>
> --
> Thomas Rast
> trast@{inf,student}.ethz.ch
>
Thomas Rast· Oct 26, 2011, 12:39 UTC · re: Lynn Lin · lore

Re: git merge successfully however this is still issue from logical perspective

Lynn Lin wrote:
Show 11 quoted lines
> On Wed, Oct 26, 2011 at 8:27 PM, Thomas Rast <trast@student.ethz.ch> wrote:
> > Lynn Lin wrote:
> >> Hi all,
> >>    Do this case can happen? When I do merge from one branch to master
> >> branch,merge successfully however from code logical perspective it
> >> fails and It cause code compile (our project is using C++ language)
> >
> > Sure.  The easiest example is when one side of a merge renames foo()
> > to bar(), while the other side introduces another call to foo() in an
> > unrelated part of the code.
> Does this mean we shouldn't trust merge result  ?
Depends what you mean by "trust".

If you expected a merge to understand what the changes on each side were about, and then patch the code accordingly, no it can't do that.[*] You are in no way guaranteed that the result of a merge is correct or even compiles even if both sides of the merge were.

But after all git-merge is just a tool doing a well-defined operation: textually merging the changes from both sides. AFAIK it could so far always be trusted with doing *that* correctly.

[*] darcs can go half of the way by having more expressive "changesets", but this can also fail. I think the general problem is AI-complete.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

← back to recent threads