git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [Q] git rebase -i -p conflicts with squash
@ 2009-01-14 16:13 Constantine Plotnikov
  2009-01-15  0:38 ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Constantine Plotnikov @ 2009-01-14 16:13 UTC (permalink / raw
  To: git

If I run git rebase --interactive with --preserve-merges option and
select "squash" for one of the commit, the rebase process fails with
the message "Refusing to squash a merge:
5e775c536654640c173ba71a0af7e84bf8bc618a". However the neither commit
participating in the squash is a merge commit. Even more, there are no
merge commits in the repository at all.

>From my limited understanding of squash operation, it should fail only
if one of squashed commits is a merge commit, but it should be
possible to squash non-merge commits without problem as it looks like
quite safe and local operation (and I might want to preserve merges
that happened after squashed commits). Is it the current behaviour a
bug or a feature?

Constantine

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Q] git rebase -i -p conflicts with squash
  2009-01-14 16:13 [Q] git rebase -i -p conflicts with squash Constantine Plotnikov
@ 2009-01-15  0:38 ` Johannes Schindelin
  2009-01-15 14:25   ` Constantine Plotnikov
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2009-01-15  0:38 UTC (permalink / raw
  To: Constantine Plotnikov; +Cc: git

Hi,

On Wed, 14 Jan 2009, Constantine Plotnikov wrote:

> If I run git rebase --interactive with --preserve-merges option and 
> select "squash" for one of the commit, the rebase process fails with the 
> message "Refusing to squash a merge: 
> 5e775c536654640c173ba71a0af7e84bf8bc618a". However the neither commit 
> participating in the squash is a merge commit. Even more, there are no 
> merge commits in the repository at all.
> 
> From my limited understanding of squash operation, it should fail only 
> if one of squashed commits is a merge commit, but it should be possible 
> to squash non-merge commits without problem as it looks like quite safe 
> and local operation (and I might want to preserve merges that happened 
> after squashed commits). Is it the current behaviour a bug or a feature?

>From your description, it seems that you are hitting an ordering bug of 
rebase -i -p.

But without a reproduction recipe (preferably as a patch against our 
testsuite), I cannot tell.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Q] git rebase -i -p conflicts with squash
  2009-01-15  0:38 ` Johannes Schindelin
@ 2009-01-15 14:25   ` Constantine Plotnikov
  0 siblings, 0 replies; 3+ messages in thread
From: Constantine Plotnikov @ 2009-01-15 14:25 UTC (permalink / raw
  To: Johannes Schindelin; +Cc: git

Here is a reproduction recipe:

Goto to some empty directory and do the following commands on (cygwin,
git 1.6.0.4):

git init
echo data1 > f.txt
git add f.txt
git commit -m second
echo data2 >> f.txt
git add f.txt
git commit -m second
echo data3 >> f.txt
git add f.txt
git commit -m third
echo '#!/usr/bin/sh' >myed.sh
echo "echo -e '2\ns/pick/s/\np\nw\nq' | ed \$1"  >>myed.sh
chmod a+x myed.sh
export GIT_EDITOR=`pwd`/myed.sh
git rebase -p -i master~2

The git rebase will exit with error writing something like the
following on stderr:
Refusing to squash a merge: 3b9e0d80da20e3543225679906be1cc5cf1a9f44

Constantine

On Thu, Jan 15, 2009 at 3:38 AM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Wed, 14 Jan 2009, Constantine Plotnikov wrote:
>
>> If I run git rebase --interactive with --preserve-merges option and
>> select "squash" for one of the commit, the rebase process fails with the
>> message "Refusing to squash a merge:
>> 5e775c536654640c173ba71a0af7e84bf8bc618a". However the neither commit
>> participating in the squash is a merge commit. Even more, there are no
>> merge commits in the repository at all.
>>
>> From my limited understanding of squash operation, it should fail only
>> if one of squashed commits is a merge commit, but it should be possible
>> to squash non-merge commits without problem as it looks like quite safe
>> and local operation (and I might want to preserve merges that happened
>> after squashed commits). Is it the current behaviour a bug or a feature?
>
> From your description, it seems that you are hitting an ordering bug of
> rebase -i -p.
>
> But without a reproduction recipe (preferably as a patch against our
> testsuite), I cannot tell.
>
> Ciao,
> Dscho
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-15 14:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 16:13 [Q] git rebase -i -p conflicts with squash Constantine Plotnikov
2009-01-15  0:38 ` Johannes Schindelin
2009-01-15 14:25   ` Constantine Plotnikov

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).