From: "Philip Oakley" <philipoakley@iee.org>
To: "Git List" <git@vger.kernel.org>,
"Thomas Braun" <thomas.braun@virtuell-zuhause.de>
Cc: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: Idea: Add a filter option to 'git rebase'
Date: Sat, 21 Jan 2017 23:18:11 -0000 [thread overview]
Message-ID: <7EEBBEA4046743C9AE04AE50EE30D72A@PhilipOakley> (raw)
In-Reply-To: 0bd00cda-65d0-eeba-d8b9-a839e76d8e88@virtuell-zuhause.de
From: "Thomas Braun" Friday, January 20, 2017 11:35 PM
> Am 20.01.2017 um 23:28 schrieb Philip Oakley:
>> 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?
>
I had been more thinking of a process that passed single sha1's to the
filter on each pass through the rebase list, so that the coding was simpler,
plus the --interactive could be used, if required, for final refinement
(gitk being handy for that).
However, a mention in the man pages would be zero code cost, and could help.
--
Philip
next prev parent reply other threads:[~2017-01-21 23:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 22:28 Idea: Add a filter option to 'git rebase' Philip Oakley
2017-01-20 23:35 ` Thomas Braun
2017-01-21 23:18 ` Philip Oakley [this message]
2017-01-23 11:57 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7EEBBEA4046743C9AE04AE50EE30D72A@PhilipOakley \
--to=philipoakley@iee.org \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=thomas.braun@virtuell-zuhause.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox