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

Re: check if a commit is ascendent of a specific commit

From
Karl Hasselström <kha@treskal.com>
Date
Nov 11, 2006, 12:12 UTC
Message-ID
<20061111121259.GB11224@diana.vm.bytemark.co.uk>
In-Reply-To
<200611111256.20157.jnareb@gmail.com>
On 2006-11-11 12:56:19 +0100, Jakub Narebski wrote:
Show 14 quoted lines
> Dnia sobota 11. listopada 2006 12:31, Nguyen Thai Ngoc Duy napisa??:
>
> > Yes. That's what I want. I am tempted to edit older commits just
> > because I forgot to add some entries to .gitignore that I should
> > have added sooner :-)
>
> In pure git you would have to create new branch at the commit you
> want to amend, amend the commit (in this branch), and rebase (or
> cherry-pick if you need to edit other commits too) the rest, then
> rename branch. Or if you don't want ot loose reflog, tag/branch
> current branch, then reset (rewind) current branch to the commit you
> want to amend, then cherry-pick.
>
> Or you can use cg-admin-rewritehist tool from Cogito.

In case the history you want to edit is linear (that is, merge-free), StGIT is an excellent tool. It is very easy to go back to a previous commit (stg pop), amend it (stg refresh), and replay the following commits on top of the amended commit (stg push).

-- 
Karl Hasselström, kha@treskal.com
Previous: Jakub Narebski
Message 8 of 8 in “check if a commit is ascendent of a specific commit”
  1. Nguyen Thai Ngoc DuyNov 11, 2006
  2. Jakub NarebskiNov 11, 2006
  3. Nguyen Thai Ngoc DuyNov 11, 2006
  4. Junio C HamanoNov 11, 2006
  5. Tom PrinceNov 11, 2006
  6. Junio C HamanoNov 11, 2006
  7. Jakub NarebskiNov 11, 2006
  8. Karl HasselströmNov 11, 2006

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.