git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Orgad Shaneh <orgads@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Regression[2.14.3->2.15]: Interactive rebase fails if submodule is modified
Date: Fri, 3 Nov 2017 17:20:49 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.1.1711031711530.6482@virtualbox> (raw)
In-Reply-To: <alpine.DEB.2.21.1.1711031658190.6482@virtualbox>

Hi Orgad,

On Fri, 3 Nov 2017, Johannes Schindelin wrote:

> On Thu, 2 Nov 2017, Orgad Shaneh wrote:
> 
> > I can't reproduce this with a minimal example, but it happens in my project.

Whoa, I somehow overlooked the "can't". Sorry.

> > What I tried to do for reproducing is:
> > rm -rf super sub
> > mkdir sub; cd sub; git init
> > git commit --allow-empty -m 'Initial commit'
> > mkdir ../super; cd ../super
> > git init
> > git submodule add ../sub
> > touch foo; git add foo sub
> > git commit -m 'Initial commit'
> > touch a; git add a; git commit -m 'a'
> > touch b; git add b; git commit -m 'b'
> > cd sub; git commit --allow-empty -m 'New commit'; cd ..
> > git rebase -i HEAD^^
> > 
> > Then drop a.
> > 
> > In my project I get:
> > error: cannot rebase: You have unstaged changes.
> > 
> > This works fine with 2.14.3.
> 
> I tried to turn this into a regression test, but I cannot make it fail:
> 
> -- snip --
> diff --git a/t/t3426-rebase-submodule.sh b/t/t3426-rebase-submodule.sh
> index ebf4f5e4b2c..55aebe53191 100755
> --- a/t/t3426-rebase-submodule.sh
> +++ b/t/t3426-rebase-submodule.sh
> @@ -20,7 +20,7 @@ git_rebase () {
>  	git rebase "$1"
>  }
>  
> -test_submodule_switch "git_rebase"
> +#test_submodule_switch "git_rebase"
>  
>  git_rebase_interactive () {
>  	git status -su >expect &&
> @@ -38,6 +38,27 @@ git_rebase_interactive () {
>  	git rebase -i "$1"
>  }
>  
> -test_submodule_switch "git_rebase_interactive"
> +#test_submodule_switch "git_rebase_interactive"
> +
> +test_expect_success '123' '
> +	git init sub &&
> +	test_commit -C sub init-submodule &&
> +	git init super &&
> +	git -C super submodule add ../sub &&
> +	(
> +		cd super &&
> +		test_tick &&
> +		touch foo &&
> +		git add sub foo &&
> +		git commit -m initial &&
> +		test_commit a &&
> +		test_commit b &&
> +		test_commit -C sub new &&
> +		set_fake_editor &&
> +		FAKE_LINES=2 &&
> +		export FAKE_LINES &&

I inserted a `git diff-files` here, and it printed exactly what I
expected:

++ git diff-files
:160000 160000 62cab94c8d8cf047bbb60c12def559339300efa4 0000000000000000000000000000000000000000 M      sub

> +		git rebase -i HEAD^^
> +	)
> +'

There must be something else going wrong that we did not replicate here.
Maybe the `error: cannot rebase: You have unstaged changes.` message was
caused not by a change in the submodule? Could you run `git diff-files`
before the rebase?

This does *not* refresh the index, but maybe that is what is going wrong;
you could call `git update-index --refresh` before the rebase and see
whether that works around the issue?

Ciao,
Dscho

  reply	other threads:[~2017-11-03 16:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02  8:30 Regression[2.14.3->2.15]: Interactive rebase fails if submodule is modified Orgad Shaneh
2017-11-02 18:34 ` Stefan Beller
2017-11-02 21:45   ` Orgad Shaneh
2017-11-03 16:06 ` Johannes Schindelin
2017-11-03 16:20   ` Johannes Schindelin [this message]
2017-11-04 18:04     ` Orgad Shaneh
2017-11-05  7:30       ` Orgad Shaneh
2017-11-06 18:37         ` Brandon Williams
2017-11-06 20:36           ` Orgad Shaneh

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=alpine.DEB.2.21.1.1711031711530.6482@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=orgads@gmail.com \
    /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).