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

Re: ancestor and descendant ~ clarification needed

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 23, 2015, 16:56 UTC
Message-ID
<xmqqsi51plpz.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAAF+z6H+wwCOhPCU-_Uh-Odc=411N+G+d_iE_AKX+JxVMDtsMQ@mail.gmail.com>
Xue Fuqiao <xfq.free@gmail.com> writes:
Show 21 quoted lines
> Hi Junio,
>
> On Fri, Oct 23, 2015 at 4:22 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> Yeah, that is the other way around.
>>
>>  (1) If the current branch is a descendant of the other--so every
>>      commit present in the other branch is already contained in the
>>      current branch--then merging the other branch into the current
>>      branch is a no-op "Already up-to-date!".
>>
>>  (2) If the current branch is an ancestor of the other--so every
>>      commit present in the current branch is already contained in
>>      the other branch--then merging the other branch into the
>>      current branch can be fast-forwarded, by moving the tip of the
>>      current branch to point at the commit at the tip of the other
>>      branch, and by default Git does so, instead of creating an
>>      unnecessary merge.
>
> I see.  Thank you.  What do you think about the following minor patch
> for user-manual.txt?

While the updated text is more correct than the original, I do not know if that is sufficient, or we would also want to mention the "Already up-to-date!" case here while at it.

Show 11 quoted lines
> -However, if the current branch is a descendant of the other--so every
> -commit present in the one is already contained in the other--then Git
> -just performs a "fast-forward"; the head of the current branch is moved
> -forward to point at the head of the merged-in branch, without any new
> -commits being created.
> +However, if the current branch is an ancestor of the other--so every commit
> +present in the current branch is already contained in the other
> branch--then Git
> +just performs a "fast-forward"; the head of the current branch is moved forward
> +to point at the head of the merged-in branch, without any new commits being
> +created.
Previous: Xue FuqiaoNext: Xue Fuqiao
Message 5 of 7 in “ancestor and descendant ~ clarification needed”
  1. Xue FuqiaoOct 22, 2015
  2. Etienne GirardOct 22, 2015
  3. Junio C HamanoOct 22, 2015
  4. Xue FuqiaoOct 23, 2015
  5. Junio C HamanoOct 23, 2015
  6. Xue FuqiaoOct 23, 2015
  7. Junio C HamanoOct 24, 2015

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.