git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Atharva Raykar <raykar.ath@gmail.com>
To: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: skottkuk@wp.pl, Git List <git@vger.kernel.org>
Subject: Re: Logical bug during MERGE or REBASE
Date: Sun, 4 Jul 2021 12:00:59 +0530	[thread overview]
Message-ID: <928F285A-4F5B-48BA-A817-EE809FD16E16@gmail.com> (raw)
In-Reply-To: <3f09d890-e9b7-0e54-0d03-2ed7609cb448@gmail.com>

On 04-Jul-2021, at 11:42, Bagas Sanjaya <bagasdotme@gmail.com> 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 :)


  reply	other threads:[~2021-07-04  6:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 16:25 Logical bug during MERGE or REBASE skottkuk
2021-07-03  7:57 ` Atharva Raykar
2021-07-04  6:12   ` Bagas Sanjaya
2021-07-04  6:30     ` Atharva Raykar [this message]
2021-07-03  9:07 ` martin
2021-07-03 11:03 ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=928F285A-4F5B-48BA-A817-EE809FD16E16@gmail.com \
    --to=raykar.ath@gmail.com \
    --cc=bagasdotme@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=skottkuk@wp.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).