Re: [PATCH v2 1/1] restore: default to HEAD when combining --staged and --worktree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxx>

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux