git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 0/2] Fix git stash with skip-worktree entries
Date: Sun, 27 Oct 2019 22:05:30 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.1910272203360.46@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <pull.355.git.gitgitgadget@gmail.com>

Hi Junio,

On Thu, 26 Sep 2019, Johannes Schindelin via GitGitGadget wrote:

> My colleague Dan Thompson reported a bug in a sparse checkout, where git
> stash (after resolving merge conflicts and then making up their mind to
> stash the changes instead of committing them) would "lose" files (and files
> that were not even in the sparse checkout's cone!).

I only realized _now_ that this patch has not made it anywhere; I would
like to have it at least in Git for Windows v2.24.0.

Could I ask for this to still be picked up into `pu` at least, so that
it does not fall into oblivion?

Thanks,
Dscho

>
> I first considered changing the behavior of git diff-index to simply ignore
> skip-worktree entries. But after re-reading the documentation of the
> skip-worktree bit, I became convinced that this would be incorrect a fix
> because the command really does what it advertises to do.
>
> Then, I briefly considered introducing a flag that would change the behavior
> thusly, but ended up deciding against it.
>
> The actual problem, after all, is the git update-index call and that it
> heeds the --remove (but not the --add) option for skip-worktree entries.
> "Heeds", I should say, because the idea of the skip-worktree bit really is
> documented to imply that the worktree files should be considered identical
> to their staged versions.
>
> So arguably, it could be considered a bug that git update-index --remove
> even bothers to touch skip-worktree entries. But this behavior has been in
> place for over 10 years, so I opted to introduce a new mode that does what
> git stash needs in order to fix the bug.
>
> Johannes Schindelin (2):
>   update-index: optionally leave skip-worktree entries alone
>   stash: handle staged changes in skip-worktree files correctly
>
>  Documentation/git-update-index.txt |  6 ++++++
>  builtin/stash.c                    |  5 +++--
>  builtin/update-index.c             |  6 +++++-
>  git-legacy-stash.sh                |  3 ++-
>  t/t3903-stash.sh                   | 11 +++++++++++
>  5 files changed, 27 insertions(+), 4 deletions(-)
>
>
> base-commit: 5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-355%2Fdscho%2Ffix-stash-with-skip-worktree-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-355/dscho/fix-stash-with-skip-worktree-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/355
> --
> gitgitgadget
>
>

  parent reply	other threads:[~2019-10-27 21:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26  7:42 [PATCH 0/2] Fix git stash with skip-worktree entries Johannes Schindelin via GitGitGadget
2019-09-26  7:42 ` [PATCH 1/2] update-index: optionally leave skip-worktree entries alone Johannes Schindelin via GitGitGadget
2019-10-28  4:38   ` Junio C Hamano
2019-10-28 21:07     ` Johannes Schindelin
2019-10-29  2:27       ` Junio C Hamano
2019-09-26  7:42 ` [PATCH 2/2] stash: handle staged changes in skip-worktree files correctly Johannes Schindelin via GitGitGadget
2019-10-28  5:35   ` Junio C Hamano
2019-10-27 21:05 ` Johannes Schindelin [this message]
2019-10-28  2:33   ` [PATCH 0/2] Fix git stash with skip-worktree entries Junio C Hamano
2019-10-28 20:56     ` Johannes Schindelin
2019-10-29  2:25       ` Junio C Hamano
2019-10-29  8:15         ` Johannes Schindelin
2019-10-28 11:20 ` [PATCH v2 " Johannes Schindelin via GitGitGadget
2019-10-28 11:20   ` [PATCH v2 1/2] update-index: optionally leave skip-worktree entries alone Johannes Schindelin via GitGitGadget
2019-10-30  1:13     ` Junio C Hamano
2019-10-30  8:34       ` Johannes Schindelin
2019-11-02  3:04         ` Junio C Hamano
2019-11-02 23:03           ` Johannes Schindelin
2019-10-28 11:20   ` [PATCH v2 2/2] stash: handle staged changes in skip-worktree files correctly Johannes Schindelin via GitGitGadget
2019-10-30  1:16     ` Junio C Hamano
2019-10-30 10:49   ` [PATCH v3 0/2] Fix git stash with skip-worktree entries Johannes Schindelin via GitGitGadget
2019-10-30 10:49     ` [PATCH v3 1/2] update-index: optionally leave skip-worktree entries alone Johannes Schindelin via GitGitGadget
2019-10-30 10:49     ` [PATCH v3 2/2] stash: handle staged changes in skip-worktree files correctly Johannes Schindelin via GitGitGadget

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=nycvar.QRO.7.76.6.1910272203360.46@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --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.
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).