From: Edmundo Carmona Antoranz <eantoranz@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [RFC/PATCH 1/2] rebuash - squash/rebase in a single step
Date: Sun, 30 Jun 2019 09:09:31 -0600 [thread overview]
Message-ID: <CAOc6etYMzOpEDs1GpLChAEhp2SbZcKjO82S=qm4P-t6SkUEWcw@mail.gmail.com> (raw)
In-Reply-To: <20190630065358.GB31264@sigill.intra.peff.net>
On Sun, Jun 30, 2019 at 12:54 AM Jeff King <peff@peff.net> wrote:
>
>
> and then do:
>
> git merge --squash feature
>
> I get the same merge that rebuash is doing (with R6 as the merge base,
> so we see F5 and R7 conflicting with each other). And then when I finish
> it with "git commit", the result is a linear strand with M3 at the tip
> (and its commit message is even auto-populated with information from the
> squashed commits).
>
> -Peff
From the point of view of the revisions that you produce in the end,
it's the same thing, but you are not rebasing/squashing your feature
branch, you are moving your upstream branch to where you want the
squashed/rebased branch to be. So, in fact you would need more steps,
something like (starting from your feature branch being checked out):
git checkout --detach $( git rev-parse --abbrev-ref --symbolic-full-name @{u} )
git merge --squash my-feature-branch
git branch -f my-feature-branch
git checkout my-feature-branch
Yes, it works. Only that with rebuash you would do (starting from the
feature branch being checked out branch):
git rebuash
as long as the upstream branch is set, of course.
I think it makes more sense in terms of development flow of feature
branches, if you know in the end you will give up a squashed branch:
modify
commit
modify
commit
git pull # no need to use pull --rebase, merges will be fine
modify
commit
modify
commit
git pull
git modify
# now I'm ready to rebase/squash
git fetch
git rebuash
adding history could be done with an additional option (--hist
(default) and --no-hist?)
But, as you said, it's not like it's not possible to do it (with a
little more effort) with available tools like merge --squash
next prev parent reply other threads:[~2019-06-30 15:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-30 5:18 [RFC/PATCH 1/2] rebuash - squash/rebase in a single step Edmundo Carmona Antoranz
2019-06-30 5:18 ` [RFC/PATCH 2/2] rebuash - support for status Edmundo Carmona Antoranz
2019-06-30 5:28 ` Edmundo Carmona Antoranz
2019-06-30 6:53 ` [RFC/PATCH 1/2] rebuash - squash/rebase in a single step Jeff King
2019-06-30 15:09 ` Edmundo Carmona Antoranz [this message]
2019-06-30 22:39 ` Jeff King
2019-07-01 1:37 ` Edmundo Carmona Antoranz
2019-07-01 18:50 ` Junio C Hamano
2019-07-01 20:48 ` Edmundo Carmona Antoranz
2019-07-01 18:35 ` Junio C Hamano
2019-07-02 11:37 ` Derrick Stolee
2019-07-02 17:20 ` Junio C Hamano
2019-07-02 19:30 ` Johannes Sixt
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOc6etYMzOpEDs1GpLChAEhp2SbZcKjO82S=qm4P-t6SkUEWcw@mail.gmail.com' \
--to=eantoranz@gmail.com \
--cc=git@vger.kernel.org \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).