From: Taylor Blau <me@ttaylorr.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org, "Harri Mehtälä" <harri.mehtala@finago.com>,
"Duy Nguyen" <pclouds@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>,
"Taylor Blau" <me@ttaylorr.com>
Subject: Re: [PATCH v2 1/1] restore: default to HEAD when combining --staged and --worktree
Date: Tue, 5 May 2020 10:04:00 -0600 [thread overview]
Message-ID: <20200505160400.GC69300@syl.local> (raw)
In-Reply-To: <20200505071716.23240-2-sunshine@sunshineco.com>
On Tue, May 05, 2020 at 03:17:16AM -0400, Eric Sunshine wrote:
> By default, files are restored from the index for --worktree, and from
> HEAD for --staged. When --worktree and --staged are combined, --source
> must be specified to disambiguate the restore source[1], thus making it
> cumbersome to restore a file in both the worktree and the index.
>
> However, HEAD is also a reasonable default for --worktree when combined
> with --staged, so make it the default anytime --staged is used (whether
> combined with --worktree or not).
>
> [1]: Due to an oversight, the --source requirement, though documented,
> is not actually enforced.
>
> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
> ---
> Documentation/git-restore.txt | 11 ++++-------
> builtin/checkout.c | 6 +++---
> t/t2070-restore.sh | 11 +++++++++++
> 3 files changed, 18 insertions(+), 10 deletions(-)
Thanks, the new version looks good to me, too.
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Thanks,
Taylor
prev parent reply other threads:[~2020-05-05 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 7:17 [PATCH v2 0/1] enhance "git restore --worktree --staged" behavior Eric Sunshine
2020-05-05 7:17 ` [PATCH v2 1/1] restore: default to HEAD when combining --staged and --worktree Eric Sunshine
2020-05-05 16:04 ` Taylor Blau [this message]
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=20200505160400.GC69300@syl.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=harri.mehtala@finago.com \
--cc=pclouds@gmail.com \
--cc=sunshine@sunshineco.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).