From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 74DCA20248 for ; Fri, 8 Mar 2019 18:01:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726618AbfCHSBj (ORCPT ); Fri, 8 Mar 2019 13:01:39 -0500 Received: from mail-vs1-f65.google.com ([209.85.217.65]:45714 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726332AbfCHSBi (ORCPT ); Fri, 8 Mar 2019 13:01:38 -0500 Received: by mail-vs1-f65.google.com with SMTP id n14so7163387vsp.12 for ; Fri, 08 Mar 2019 10:01:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=IrJ3m6J15b15aypphNZABIQd0sOQB2KuscQVw0zq/tQ=; b=Z2t0yx5YqMO3niFEO82QRO6DedP060x41vR0zTiM7udG1OTXZBJtXpgbl8KdT2PPvc /2CmflKVcIC0lFpDTZ7w77nQgJTHmXkdkLmEl8x/5nBg4VA+PF9v5CZCm3fyGYv79CQw 3yT6lE353sQPnEDPVYCMlzKMHIDS+kdbUoOx3gE1tvpPM1XwG426j2fGhE2UoAqaeBEZ a+Kr4q+OBS3Dx8G5sqYpqxXzo7kzBae+hIo4xsGm2gNYjvmiPxBQ1HhLU2oLxuSlmaaX lRNe/Gqq0Q4U3O5ZKwX+ag/gUpGPmZ7zXnkYkr21gIs0l+7ijjXRDOXgqi8yje1djIMg ObgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=IrJ3m6J15b15aypphNZABIQd0sOQB2KuscQVw0zq/tQ=; b=Gdh9gAJpqAcAFqrkhyPmRqTQEO+pmKhEeQq0OKz3q/tLbgXicDoNMZkfZnudLq5wQL SSnTtN56jKSnd6J+KuFWM7P9mKyY9+yEHjkOsqobm69qHK/ncAU3Op945Oed034eiRre rtWJ9ak+bCeEAvE4snT0LcDrJDd+rtTOH8d10YZLi33hkxODOPhs2qmJRPs90HuKpE6y N+UW4a8/mDvO03M/uwtZMbv12vmTy+NaOrG1xJQ4kTe6I8QzW2C2bAzzVOZZzASE3KMu y/nPdoL19KmtDZvvFvE50ywGSe6MctXbzD5eE6sSoPhPnbMTu0ywI7yDSRgdH0PmD3UE G+HQ== X-Gm-Message-State: APjAAAUIRX4OsfznXkm92ApixTJ1VSezZvPxnFg0nMdyU3yelmZwk4o1 jbhMPISRQdwrLXtKoYVWZS/N1fmEgspfEliXzZA= X-Google-Smtp-Source: APXvYqyjaArwS53dRoafijVSn90KBKdxwPzWetH+DxOgZrNse9yBW27QOgsV7qY/NC7Oij7tr3wPX0r6QLKSN5FKhbE= X-Received: by 2002:a67:3052:: with SMTP id w79mr10472764vsw.116.1552068096830; Fri, 08 Mar 2019 10:01:36 -0800 (PST) MIME-Version: 1.0 References: <20190308101655.9767-1-pclouds@gmail.com> <20190308101655.9767-2-pclouds@gmail.com> In-Reply-To: <20190308101655.9767-2-pclouds@gmail.com> From: Elijah Newren Date: Fri, 8 Mar 2019 10:01:25 -0800 Message-ID: Subject: Re: [PATCH v1 01/11] checkout: split part of it to new command 'restore' To: =?UTF-8?B?Tmd1eeG7hW4gVGjDoWkgTmfhu41jIER1eQ==?= Cc: Git Mailing List , Junio C Hamano Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Thanks for working on this; overall looks really good. I've got a few comments here and there on the wording and combinations of options... On Fri, Mar 8, 2019 at 2:17 AM Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy wrote: > +SYNOPSIS It might be worth adding some words somewhere to differentiate between `reset` and `restore`. E.g. `git restore` modifies the working tree (and maybe index) to change file content to match some other (usually older) version, but does not update your branch. `git reset` is about modifying which commit your branch points to, meaning possibly removing and/or adding many commits to your branch. It may also make sense to add whatever description you use to the reset man= page. > +-------- > +[verse] > +'git restore' [] [--source=3D] ... > +'git restore' (-p|--patch) [--source=3D] [...] So one cannot specify any special options with -p? Does that mean one cannot use it with --index (i.e. this command cannot replace 'git reset -p')? Or is this an oversight in the synopsis? > +DESCRIPTION > +----------- > +Restore paths in the working tree by replacing with the contents in > +the restore source or remove if the paths do not exist in the restore > +source. The source is by default the index but could be from a commit. > +The command can also optionally restore content in the index from a > +commit. The first sentence makes it sound like two different operations, when I think it is one. Perhaps: Restore paths in the working tree by replacing with the contents in the restore source (and if the restore source is missing paths found in the working tree, that means deleting those paths from the working tree). > + > +When a `` is given, the paths that match the `` are > +updated both in the index and in the working tree. I thought the default was --worktree. Is this sentence from an older version of your patch series that you forgot to update? > + > +OPTIONS > +------- > +-s:: > +--source=3D:: > + Restore the working tree files with the content from the given > + tree or any revision that leads to a tree (e.g. a commit or a > + branch). I think that's a little hard to parse. We may not be able to avoid "working tree" vs. "tree" confusion, but the spelling of feels like it should be a separate sentence. Maybe: Restore the working tree files with the content from the given tree. It is common to specify the source tree by naming a commit, branch, or tag. ? > + > +-p:: > +--patch:: > + Interactively select hunks in the difference between the > + `` (or the index, if unspecified) and the working > + tree. See the ``Interactive Mode'' section of linkgit:git-add[1] > + to learn how to operate the `--patch` mode. > + > +-W:: > +--worktree:: > +-I:: > +--index:: > + Specify the restore location. If neither option is specified, > + by default the working tree is restored. If `--index` is > + specified without `--worktree` or `--source`, `--source=3DHEAD` > + is implied. These options only make sense to use with > + `--source`. Seems like this contains a minor contradiction. Perhaps start the final sentence with: "Otherwise, ..." ? > +-q:: > +--quiet:: > + Quiet, suppress feedback messages. > + > +--progress:: > +--no-progress:: > + Progress status is reported on the standard error stream > + by default when it is attached to a terminal, unless `--quiet` > + is specified. This flag enables progress reporting even if not > + attached to a terminal, regardless of `--quiet`. I'm assuming this means there are feedback messages other than progress feedback? > +-f:: > +--force:: > + If `--source` is not specified, unmerged entries are left alone > + and will not fail the operation. Unmerged entries are always > + replaced if `--source` is specified, regardless of `--force`. This may be slightly confusing, in particular it suggests that --index (or --worktree and --index) are the default. Is --force only useful when --index is specified? If it has utility with --worktree only, what does it do? Also, what happens when there are unmerged entries in the index and someone tries to restore just working tree files -- are the ones corresponding to unmerged entries skipped (if so, silently or with warnings printed for the user?), or does something else happen? > +--ours:: > +--theirs:: > + Check out stage #2 ('ours') or #3 ('theirs') for unmerged > + paths. > ++ > +Note that during `git rebase` and `git pull --rebase`, 'ours' and > +'theirs' may appear swapped. See the explanation of the same options > +in linkgit:git-checkout[1] for details. So sad, but yes you need to mention it. I'm curious what we say for cherry-pick; it's not clear to me whether people think of the current branch as "ours" or the commit they wrote themselves and are trying to bring to this branch as "ours". There are probably examples of both. Not that I think you can do anything about that here or need to change your description. I'm just very sad about --ours and --theirs in general. > + > +-m:: > +--merge:: > + Recreate the conflicted merge in the specified paths. > + > +--conflict=3D