From: Junio C Hamano <gitster@pobox.com>
To: Victoria Dye <vdye@github.com>
Cc: Martin von Zweigbergk <martinvonz@google.com>,
Glen Choo <chooglen@google.com>,
git@vger.kernel.org, Derrick Stolee <derrickstolee@github.com>,
Elijah Newren <newren@gmail.com>
Subject: Re: Bug report: `git restore --source --staged` deals poorly with sparse-checkout
Date: Thu, 06 Oct 2022 12:30:07 -0700 [thread overview]
Message-ID: <xmqqv8owkaww.fsf@gitster.g> (raw)
In-Reply-To: <96c4f52e-bc66-f4ee-f4f6-d22da579858e@github.com> (Victoria Dye's message of "Tue, 4 Oct 2022 13:34:59 -0700")
Victoria Dye <vdye@github.com> writes:
>> Restoring only into the index (as I think `git restore --staged` is supposed
>> to do) is weird.
>
> 'git restore --staged' is intended to restore to both the worktree and index
> (per 183fb44fd2 (restore: add --worktree and --staged, 2019-04-25)). The bug
> you've identified is that it's not restoring to the worktree.
I think you misread 183fb44fd2, which says --staged is to restore
the contents in the index and --worktree is to restore the contents
in the working tree, and both of them can be used at the same time
to affect both destinations. As gitcli(7) says, --staged here is a
synonym to --cached here and should not touch the working tree.
Having needless synonym may be a source of confusion, so we may want
to straighten out the UI a bit around here, but that is a separate
topic.
Thanks.
next prev parent reply other threads:[~2022-10-06 19:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-03 22:05 Bug report: `git restore --source --staged` deals poorly with sparse-checkout Glen Choo
2022-10-04 16:34 ` Victoria Dye
[not found] ` <CAESOdVAh68HoQoyicfZn4XbjGfiRFCu1zFQmUjMcSAg3tUzr4Q@mail.gmail.com>
2022-10-04 20:34 ` Victoria Dye
2022-10-05 4:53 ` Martin von Zweigbergk
2022-10-05 7:51 ` Elijah Newren
2022-10-05 20:00 ` Martin von Zweigbergk
2022-10-06 4:20 ` Elijah Newren
2022-10-05 16:11 ` Victoria Dye
2022-10-05 5:22 ` Elijah Newren
2022-10-06 19:30 ` Junio C Hamano [this message]
2022-10-06 19:38 ` Junio C Hamano
2022-10-05 5:00 ` Elijah Newren
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=xmqqv8owkaww.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=chooglen@google.com \
--cc=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=martinvonz@google.com \
--cc=newren@gmail.com \
--cc=vdye@github.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).