All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Christian Neukirchen <chneukirchen@gmail.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git commit -p with file arguments
Date: Wed, 05 Oct 2016 10:16:44 -0700	[thread overview]
Message-ID: <xmqqzimipvgj.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20161005102633.GA9948@ash> (Duy Nguyen's message of "Wed, 5 Oct 2016 17:26:33 +0700")

Duy Nguyen <pclouds@gmail.com> writes:

>> At the least I think we should clarify this in the document.
>
> How about something like this? Would it help?
>
> -- 8< --
> Subject: [PATCH] git-commit.txt: clarify --patch mode with pathspec
>
> How pathspec is used, with and without --interactive/--patch, is
> different. But this is not clear from the document. These changes hint
> the user to keep reading (to option #5) instead of stopping at #2 and
> assuming --patch/--interactive behaves the same way.
>
> And since all the options listed here always mention how the index is
> involved (or not) in the final commit, add that bit for #5 as well. This
> "on top of the index" is implied when you head over git-add(1), but if
> you just go straight to the "Interactive mode" and not read what git-add
> is for, you may miss it.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

Excellent.  

>  Documentation/git-commit.txt | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
> index b0a294d..f2ab0ee 100644
> --- a/Documentation/git-commit.txt
> +++ b/Documentation/git-commit.txt
> @@ -29,7 +29,8 @@ The content to be added can be specified in several ways:
>  2. by using 'git rm' to remove files from the working tree
>     and the index, again before using the 'commit' command;
>  
> -3. by listing files as arguments to the 'commit' command, in which
> +3. by listing files as arguments to the 'commit' command
> +   (without --interactive or --patch switch), in which
>     case the commit will ignore changes staged in the index, and instead
>     record the current content of the listed files (which must already
>     be known to Git);
> @@ -41,7 +42,8 @@ The content to be added can be specified in several ways:
>     actual commit;
>  
>  5. by using the --interactive or --patch switches with the 'commit' command
> -   to decide one by one which files or hunks should be part of the commit,
> +   to decide one by one which files or hunks should be part of the commit
> +   in addition to contents in the index,
>     before finalizing the operation. See the ``Interactive Mode'' section of
>     linkgit:git-add[1] to learn how to operate these modes.

When re-reading these 5 bullet points, I feel there may be some
unrelated updates needed to clarify (e.g. it is unclear when reading
the description pretending to be a newbie, if it is the "changes"
that is recorded in the index, or if it is the "state"; the answer
is the latter but if the reader's world model is still the former,
the description can mislead to expect a different behaviour).

But regardless of such remaining potential issues, this is a clearly
good change.  Thanks.

  parent reply	other threads:[~2016-10-05 17:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 21:08 git commit -p with file arguments Christian Neukirchen
2016-09-09 10:54 ` Duy Nguyen
2016-10-05 10:26   ` Duy Nguyen
2016-10-05 11:38     ` Christian Neukirchen
2016-10-05 17:16     ` Junio C Hamano [this message]
2016-09-09 16:57 ` Jacob Keller
2016-09-09 17:05   ` Christian Neukirchen
2016-09-09 18:03   ` Junio C Hamano
2016-09-09 20:39     ` Jakub Narębski
2016-09-09 20:52       ` Christian Neukirchen
2016-09-10  9:52         ` Jakub Narębski
2016-09-11 21:50           ` Junio C Hamano
2016-09-11 22:05             ` Jacob Keller
2016-09-12  1:57               ` Junio C Hamano
2016-09-12  4:56                 ` Jacob Keller
2016-09-12 21:14                 ` Jakub Narębski

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=xmqqzimipvgj.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=chneukirchen@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.