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

Re: Dropping a merge from history -- rebase or filter-branch or ...?

From
Andrew Ardill <andrew.ardill@gmail.com>
Date
Jul 12, 2017, 02:06 UTC
Message-ID
<CAH5451mGTkVVoNJS44Y1AMwvHVeuYNZv5Tp89LDp0skx8ZNeYQ@mail.gmail.com>
In-Reply-To
<CACPiFC+Lc+ewmPe6u=dUo4rJRcgLqRfG-EG+vudg8mapnH-d9w@mail.gmail.com>
Hi Martin,

From the sound of it you really just want to revert the merge of the pull requests. A really good description of options for this is at https://git-scm.com/blog/2010/03/02/undoing-merges.html

There is also a section there about bringing the changes back in at a future date, depending on how you do the revert.

Does that page describe what you're trying to do?
Regards,
Andrew Ardill
On 8 July 2017 at 07:07, Martin Langhoff <martin.langhoff@gmail.com> wrote:
Show 42 quoted lines
> Hi git-folk!
>
> long time no see! I'm trying to do one of those "actually, please
> don't" things that turn out to be needed in the field.
>
> I need to open our next "for release" development branch from our
> master, but without a couple of disruptive feature branches, which
> have been merged into master already. We develop in github, so I'll
> call them Pull Requests (PRs) as gh does.
>
> So I'd like to run a filter-branch or git-rebase --interactive
> --preserve-merges that drops some PRs. Problem is, they don't work!
>
> filter-branch --commit-filter is fantastic, and gives me all the
> control I want... except that it will "skip the commit", but still use
> the trees in the later commits, so the code changes brought in by
> those commits I wanted to avoid will be there. I think the docs/help
> that discuss  "skip commit" should have a big warning there!
>
> rebase --interactive --preserve-merges  --keep-empty made a complete
> hash of things. Nonsense conflicts all over on the merge commits; I
> think it re-ran the merge without picking up the conflict resolutions
> we had applied.
>
> The changes we want to avoid are fairly localized -- a specific module
> got refactored in 3 stages. The rest of the history should replay
> cleanly. I don't want to delete the module.
>
> My fallback is a manually constructed revert. While still an option, I
> think it's better to have a clean stat without sizable feature-branch
> reverts.
>
> cheers,
>
>
>
> m
> --
>  martin.langhoff@gmail.com
>  - ask interesting questions  ~  http://linkedin.com/in/martinlanghoff
>  - don't be distracted        ~  http://github.com/martin-langhoff
>    by shiny stuff
Previous: Martin Langhoff
Message 2 of 2 in “Dropping a merge from history -- rebase or filter-branch or ...?”
  1. Martin LanghoffJul 7, 2017
  2. Andrew ArdillJul 12, 2017

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.