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

Re: Removing useless merge commit with "filter-branch"

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 8, 2012, 23:30 UTC
Message-ID
<7v62eebri3.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAOMFOmWMsXgepY0-ZWFymd9uHSUmbOk66r75qa-Kv5TWx_U=EA@mail.gmail.com>
Anatol Pomozov <anatol.pomozov@gmail.com> writes:
Show 10 quoted lines
> |
> o      - merge commit that previously merged feature X
> |\
> | \
> |  \
> o  |   - real commit
> |   |
> |  /
> |/
> |

It is unclear how many commits are drawn in the above picture and what "feature X" is about in the above picture. Care to redraw the commit DAG to explain what you are trying to do a bit better?

The way I read it is that you start from a history like this (note that when we draw an ascii art history we often write it sideways, time flows from left to right):

    ---A-----B-----M---
        \         /
         C-------D

where a side branch to implement "feature X" that has C and D forked at A, and it was merged at M after somebody else committed B on the mainline. When you filtered out some parts of the tree, it turns out that C and D are totally unintereseting because their changes touch parts outside of your interest, i.e. the history is:

    ---A-----B-----M---
        \         /
         o-------o
where 'o' are now no-op.
Is that what you are talking about?

I think "log --simplify-merges A..M -- path" may already has logic that deals with this, so it may help if you study what it does and how it does what it does.

Previous: Anatol PomozovNext: Anatol Pomozov
Message 2 of 4 in “Removing useless merge commit with "filter-branch"”
  1. Anatol PomozovMar 8, 2012
  2. Junio C HamanoMar 8, 2012
  3. Anatol PomozovMar 13, 2012
  4. Anatol PomozovMar 29, 2012

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.