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

Re: Bug in log for path in case of identical commit

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 3, 2014, 20:02 UTC
Message-ID
<xmqqwq7cqchw.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAFFOgCUeqcEPdjUyri0bivCj-Ofzp_9GhH3mR7UTzD-8PY9tGw@mail.gmail.com>
Alexandre Garnier <zigarn+git@gmail.com> writes:
> When merging 2 branches with the same modifications on the both sides,
> depending the merge side, one branch disappear from the file history.

Isn't this a basic and fundamental of feature of Git called merge simplification, i.e. if two or more branches did the same thing and did not contribute to the end result, drop all but the one of them to show one simplest explanation of the history?

An option to get messier and fuller history is --full-history, if the above matches what you are seeing.

Show 46 quoted lines
>
> To be more clear, there is a script in attachment to reproduce, but
> here is the result :
> $ git log --graph --oneline --all --decorate --name-status
> *   63c807f (HEAD, master) Merge branch 'branch' into 'master'
> |\
> | * 5dc8785 (branch) Change line 15 on branch
> | | M   file
> | * d9cd3ce Change line 25 on branch
> | | M   file
> * | 7220d52 Change line 15 on master
> |/
> |   M   file
> * 7566672 Initial commit
>   A     file
>
> $ git log --graph --oneline --all --decorate --name-status -- file
> * 5dc8785 (branch) Change line 15 on branch
> | M     file
> * d9cd3ce Change line 25 on branch
> | M     file
> * 7566672 Initial commit
>   A     file
>
> => The commit 7220d52 modified the file but is not shown in file
> history anymore.
> The expected result would be:
> * 5dc8785 (branch) Change line 15 on branch
> | M     file
> * d9cd3ce Change line 25 on branch
> | M     file
> | * 7220d52 Change line 15 on master
> |/
> |   M   file
> * 7566672 Initial commit
>   A     file
>
> The order between the 2 commits on the branch is not important.
> If you do a 'cherry-pick 7220d52' or a 'merge --squash master' instead
> of applying the same modification for commit 5dc8785, you get the same
> result (cherry-picking was my initial use-case).
> If you do not create the commit d9cd3ce, then the file history show all commits.
> If you merge 'master' into 'branch', then the file history show all commits.
>
> Am I missing something or is it really a bug?
> Thanks.
Previous: Alexandre GarnierNext: Phil Hord
Message 2 of 4 in “Bug in log for path in case of identical commit”
  1. Alexandre GarnierOct 31, 2014
  2. Junio C HamanoNov 3, 2014
  3. Phil HordNov 4, 2014
  4. Alexandre GarnierNov 5, 2014

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.