git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 0/2] Demonstrate and fix a rebase --autostash bug with dirty submodules
Date: Tue, 23 Oct 2018 12:57:14 -0700 (PDT)	[thread overview]
Message-ID: <pull.56.git.gitgitgadget@gmail.com> (raw)

This bug report came in via Git for Windows (already with version 2.19.0,
but I misread the reporter's enthusiasm to take matters into his own hands).

The culprit is, in a nutshell, that the built-in rebase tries to run git
stash only when the worktree is dirty, but it includes submodules in that.
However, git stash cannot do anything about submodules, and if the only
changes are in submodules, then it won't even give us back an OID, and the
built-in rebase acts surprised.

The solution is easy: simply exclude the submodules from the question
whether the worktree is dirty.

What is surprisingly not simple is to get the regression test right. For
that reason, and because I firmly believe that it is easier to verify a fix
for a regression when the regression test is introduced separately (i.e.
making it simple to verify that there is a regression), I really want to
keep the first patch separate from the second one.

Since this bug concerns the built-in rebase, I based the patches on top of 
next.

Johannes Schindelin (2):
  rebase --autostash: demonstrate a problem with dirty submodules
  rebase --autostash: fix issue with dirty submodules

 builtin/rebase.c            |  2 +-
 t/t3420-rebase-autostash.sh | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)


base-commit: 209f214ca4ae4e301fc32e59ab26f937082f3ea3
Published-As: https://github.com/gitgitgadget/git/releases/tags/pr-56%2Fdscho%2Ffix-built-in-rebase-autostash-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-56/dscho/fix-built-in-rebase-autostash-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/56
-- 
gitgitgadget

             reply	other threads:[~2018-10-23 19:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 19:57 Johannes Schindelin via GitGitGadget [this message]
2018-10-23 19:57 ` [PATCH 1/2] rebase --autostash: demonstrate a problem with dirty submodules Johannes Schindelin via GitGitGadget
2018-10-23 19:57 ` [PATCH 2/2] rebase --autostash: fix issue " Johannes Schindelin via GitGitGadget
2018-11-06 13:59 ` Regression in rebase-in-C with rebase.autoStash=true Ævar Arnfjörð Bjarmason
2018-11-06 19:32   ` Jeff King
2018-11-07 13:50   ` Johannes Schindelin

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=pull.56.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).