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

Re: Idea: Add a filter option to 'git rebase'

From
Thomas Braun <thomas.braun@virtuell-zuhause.de>
Date
Jan 20, 2017, 23:35 UTC
Message-ID
<0bd00cda-65d0-eeba-d8b9-a839e76d8e88@virtuell-zuhause.de>
In-Reply-To
<8AED6D90D2B64AE3A63C6195CA983FE8@PhilipOakley>
Am 20.01.2017 um 23:28 schrieb Philip Oakley:
Show 14 quoted lines
> A recent question on stackoverflow
> http://stackoverflow.com/questions/41753252/drop-commits-by-commit-message-in-git-rebase
> sought to remove automatically commits that could be identified by
> relevant words in the commit message.
> 
> I had thought that the ubiquitous `git filter-branch` should be able to
> do this sort of thing. I was wrong. (It was pointed out to me that...)
> The man page notes that removing a commit via filter-branch does not
> remove the changes from following commits and directs readers to using
> `git rebase(1)`.
> 
> However the rebase command does not have any filter option to allow the
> automatic population of its TODO list with the appropriate
> pick/edit/drop/etc. values.
Well you can use an arbitrary shell command as editor, so something like
$ GIT_SEQUENCE_EDITOR="sed -i -re 's/^pick /edit /'" git rebase -i master
will change pick to edit of all commits.
Maybe that can be mentioned in the man page of rebase?
Previous: Philip OakleyNext: Philip Oakley
Message 2 of 4 in “Idea: Add a filter option to 'git rebase'”
  1. Philip OakleyJan 20, 2017
  2. Thomas BraunJan 20, 2017
  3. Philip OakleyJan 21, 2017
  4. Johannes SchindelinJan 23, 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.