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

Re: git-kill: rewrite history removing a commit

From
Yann Dirson <ydirson@altern.org>
Date
Jan 31, 2007, 20:22 UTC
Message-ID
<20070131202204.GB5362@nan92-1-81-57-214-146.fbx.proxad.net>
In-Reply-To
<20070131195533.GE21097@mellanox.co.il>
On Wed, Jan 31, 2007 at 09:55:33PM +0200, Michael S. Tsirkin wrote:
Show 6 quoted lines
> Below is a simple script that rewrites history reverting a single commit.
> This differs from git-revert in that a commit is completely removed,
> and is especially useful before one has published a series of
> commits.
> 
> Do you find this useful? Comments?

That may be well when no patch depends on the one you kill. In that case, it surely requires some work to handfix things.

I'd suggest to use stgit to prepare commits before publication. Even if you don't feel the need for it in everyday life, you can have a one-shot use for this particular problem, by turning your latest commits into an stgit stack, use stgit facilities to handle posible conflicts, and turn them into commits again:

The nominal case goes:
  stg init
  stg uncommit -n <ncommits>
  stg float <patch-to-kill>
  stg delete <patch-to-kill>

And if there is any conflict, you can still solve them, decide to change your plans, get diffs from gitk, etc.

Best regards,
-- 
Yann.
Previous: Michael S. TsirkinNext: Catalin Marinas
Message 2 of 5 in “git-kill: rewrite history removing a commit”
  1. Michael S. TsirkinJan 31, 2007
  2. Yann DirsonJan 31, 2007
  3. Catalin MarinasFeb 1, 2007
  4. Junio C HamanoJan 31, 2007
  5. Michael S. TsirkinJan 31, 2007

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.