Re: Logical bug during MERGE or REBASE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04-Jul-2021, at 11:42, Bagas Sanjaya <bagasdotme@xxxxxxxxx> wrote:
> 
> On 03/07/21 14.57, Atharva Raykar wrote:
>> Let's look at the diffs (I have annotated this with arrows):
>> $ # common ancestor, ie, the first commit
>> $ initial=$(git merge-base master dev)
>> $ git diff $initial master
>> diff --git a/program.cs b/program.cs
>> index 8bc1a4d..93f872f 100644
>> --- a/program.cs
>> +++ b/program.cs
>> @@ -1,4 +1,6 @@
>>  {
>>   Console.Writeline("1");
>> + Console.Writeline("2");
>> + Console.Readline();
>>   Console.Readline();     <--- X
>>  }
>> $ git diff $initial dev
>> diff --git a/program.cs b/program.cs
>> index 8bc1a4d..eb91c97 100644
>> --- a/program.cs
>> +++ b/program.cs
>> @@ -1,4 +1,6 @@
>>  {
>>   Console.Writeline("1");
>>   Console.Readline();     <--- X
>> + Console.Readline();
>> + Console.Readline();
>>  }
>> As you can tell, on the master branch, Git sees the changes as
>> "lines were added above the line labeled X",
>> and on the dev branch, Git sees the changes as
>> "lines were added below the line labeled X".
> 
> What's the purpose of "X-labeled line" above?

It was just something I manually annotated on the output to keep a track
of which 'Console.Readline()' line I was referring to.

It is less tedious for to say "line labeled X" than, "the second line in
the code block in the initial commit".

If it has made my explanation a little unclear, I don't mind having a
second attempt at it :)




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux