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

Re: --first-parent plus path limiting

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 29, 2008, 08:47 UTC
Message-ID
<7vk5ltow61.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<479EE405.1010001@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 6 quoted lines
> While trying to find out when builtin-fetch.c was merged into master, I
> noticed that this:
>
> $ git log --first-parent --pretty=oneline -- builtin-fetch.c
>
> lists b888d61c (Make fetch a builtin), which I did not expect.
Why didn't you?
> This one
> doesn't list it, as expected:
>
> $ git log --first-parent --pretty=oneline

Why did you expect that? This tells "follow only the first parent chain, ignoring all merges".

As most everything that is nontrivial is developed on a topic branch in git.git, "Make fetch a builtin" will not be on the first parent chain of the "master".

The former is about "First simplify the history with respect to builtin-fetch.c, and then follow the first-parent of the simplified history.

As the builtin-fetch topic was worked on for some time on its own topic, like this:

 ---o---o---o---...---o---A---M--- master
     \                       /
      o---o---X---...---o---B

So if a commit M has two parents A and B, and the file in M is the same as the file in B, the history simplifies commit A and the side branch that leads to it away. Perhaps commit A was the first parent and B was the last commit of the fetch-pack series, and "Make fetch a builtin" was an ancestor of B, like X above.

$ gitk b888d61c^..v1.5.4-rc5 -- builtin-fetch.c
is somewhat interesting to view.
Previous: Johannes SixtNext: Johannes Sixt
Message 2 of 6 in “--first-parent plus path limiting”
  1. Johannes SixtJan 29, 2008
  2. Junio C HamanoJan 29, 2008
  3. Johannes SixtJan 29, 2008
  4. Junio C HamanoJan 29, 2008
  5. Johannes SixtJan 29, 2008
  6. Junio C HamanoJan 29, 2008

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.