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

Re: Question about rewrite commits

From
DSDirk Süsserott <newsletter@dirk.my1.cc>
Date
May 5, 2009, 19:46 UTC
Message-ID
<4A009791.6010704@dirk.my1.cc>
In-Reply-To
<15aa6cf30905050445k21f8317bt7be65857604cc101@mail.gmail.com>
Hi Anner,
I had these 'cosmetic' problems as well and did the surgery like this:
I assume that your commits
    'Introduced...',
    'No HTML...', and
    'A page can now ...'
are on branch 'master' and the righthand track is on branch 
'console-mvc' which starts at 'Introduced...'.
Finally you did 'git checkout master; git merge console-mvc'.
I did the following:
     - give a tag (say 'foo') to the 'No HTML...' commit
     - rebase the console-mvc branch to that tag:
         $ git rebase foo console-mvc
       this will yield to a weird road map in gitk. Don't bother.
     - rebase the master to the new console-mvc branch:
         $ git rebase console-mvc master
       the history will now be linear.
     - remove the tag 'foo'

You may, of course, omit the tagging when you know the sha1's of the commits. In your case you will, as they're displayed in gitk. [ In theory there's a way to identify commits by their commit message (see manpage of git-rev-parse), but I didn't make it work. As I understood "git show :/foo" would mention the latest commit whose commit message starts with 'foo', but I only got error messages. ]

Be noticed that rewriting history isn't a good idea if you already have published your work. Your coworkers may get disturbed. ;-)

Hope this helps,
     Dirk
Am 05.05.2009 13:45 schrieb Anner van Hardenbroek:
Show 17 quoted lines
> Hi!
> 
> I've a question about rewriting commits. I'd like to change the
> branches so that "Introduced BTRmxSoapArgument, second fase + code
> cleanup." is right below (a straight vertical line) "No HTML errors
> because we have nice ones!". How can I do that?
> 
> Thanks,
> Anner.
> 
> --
> Anner van Hardenbroek,
> dwlnetnl@gmail.com
> 
> 
> ------------------------------------------------------------------------
> 
Previous: Anner van Hardenbroek
Message 4 of 4 in “Question about rewrite commits”
  1. Anner van HardenbroekMay 5, 2009
  2. Ferry Huberts (Pelagic)May 5, 2009
  3. Anner van HardenbroekMay 5, 2009
  4. Dirk SüsserottMay 5, 2009

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.