From: Avery Pennarun <apenwarr@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Jon Seymour <jon.seymour@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Is there something like a git format-patch --squash?
Date: Thu, 18 Feb 2010 14:45:54 -0500 [thread overview]
Message-ID: <32541b131002181145w44d69e9eo150d08f34273cefb@mail.gmail.com> (raw)
On Thu, Feb 18, 2010 at 1:38 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
> On Thu, Feb 18, 2010 at 12:11 AM, Jeff King <peff@peff.net> wrote:
>> One simple strategy would be to squash all side-branch development into
>> a single commit.
>
> Something like this (replace MY_START_BRANCH with your starting
> branch, and do this in a clone of your repository so you don't destroy
> anything by accident):
>
> parent=""
> git rev-list --first-parent --reverse | while read commit; do
> if [ -z "$parent" ]; then
> git checkout -f $commit
> git clean -fdx
> else
> git diff $parent $commit | git apply --index
> git commit -C $commit
> fi
> parent=$commit
> done
In the above, in the 'else' clause, what I really wanted was something like:
git format-patch --stdout --squash $parent..$commit
with one big "| git am" at the end of the loop.
However, format-patch seems to have no way of just producing a single
patch with all the changes from a particular branch. Is there some
other easy command that would do what I want? It seems like something
that someone would have wanted before now.
Thanks,
Avery
next reply other threads:[~2010-02-18 19:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 19:45 Avery Pennarun [this message]
2010-02-18 19:46 ` Is there something like a git format-patch --squash? Avery Pennarun
2010-02-18 20:34 ` Jeff King
2010-02-18 21:56 ` Avery Pennarun
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=32541b131002181145w44d69e9eo150d08f34273cefb@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=jon.seymour@gmail.com \
--cc=peff@peff.net \
/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;
as well as URLs for NNTP newsgroup(s).