git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Logical bug during MERGE or REBASE

From
Bagas Sanjaya <bagasdotme@gmail.com>
Date
Jul 4, 2021, 06:12 UTC
Message-ID
<3f09d890-e9b7-0e54-0d03-2ed7609cb448@gmail.com>
In-Reply-To
<3CD890FA-7A99-4DDC-9691-80D1ED6BD51B@gmail.com>
On 03/07/21 14.57, Atharva Raykar wrote:
Show 37 quoted lines
> 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?
-- 
An old man doll... just what I always wanted! - Clara
Previous: Atharva RaykarNext: Atharva Raykar
Message 3 of 6 in “Logical bug during MERGE or REBASE”
  1. skottkuk@wp.plJul 2, 2021
  2. Atharva RaykarJul 3, 2021
  3. Bagas SanjayaJul 4, 2021
  4. Atharva RaykarJul 4, 2021
  5. Ævar Arnfjörð BjarmasonJul 3, 2021
  6. martinJul 3, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.