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

Re: Trouble testing out a patch on a branch new scratch git.git repository

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Feb 10, 2009, 05:32 UTC
Message-ID
<slrngp24ap.i22.sitaramc@sitaramc.homelinux.net>
In-Reply-To
<e38bce640902091359j3f306839h9aeb699e18e420ab@mail.gmail.com>
On 2009-02-09, Brent Goodrick <bgoodr@gmail.com> wrote:
Show 16 quoted lines
> To explain what I mean: Yesterday, I had this configuration on my
> bg/no-progress branch:
>
>              A---B---C---D (bg/no-progress)
>             /
> ----1-----2----3----4 (master)
>
> B C and D commits are noisy,
> fix-the-white-space-and-conform-to-coding-guidelines type commits. I
> want to collapse A through D into one commit called E on that branch
> so that I can run git format-patch -M on the result and provide a nice
> patch email. I would end up with:
>
>              E (bg/no-progress)
>             /
> ----1-----2----3----4 (master)

You want to squash the last 4 patches on the current branch into one?

The fastest way, if you don't mind re-typing the commit message for the combined commit, is this:

    git reset --soft HEAD~4
    git commit
A kinder, gentler, way is this:
(1) type in 'git rebase -i HEAD~4'
(2) In the editor that pops up, change the 'pick' on all but
    the first entry to 'squash' or just 's' and save the
    file.
    There won't be any conflicts in this scenario, so don't
    worry about that.
(3) Another editor will pop up showing all 4 commit messages
    in one edit buffer -- combine the various commit
    messages however you wish and save the file.
Done :-)
-- 
Sitaram
Previous: Boyd Stephen Smith Jr.
Message 9 of 9 in “Trouble testing out a patch on a branch new scratch git.git repository”
  1. Brent GoodrickFeb 8, 2009
  2. Junio C HamanoFeb 8, 2009
  3. Brent GoodrickFeb 9, 2009
  4. Boyd Stephen Smith Jr.Feb 9, 2009
  5. Brent GoodrickFeb 9, 2009
  6. Junio C HamanoFeb 9, 2009
  7. Brent GoodrickFeb 9, 2009
  8. Boyd Stephen Smith Jr.Feb 9, 2009
  9. Sitaram ChamartyFeb 10, 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.