git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Zenaan Harkness <zen@freedbms.net>
Cc: git <git@vger.kernel.org>
Subject: Re: git rm --cached should be git rm --cache or git rm --stage
Date: Sat, 20 Aug 2016 10:48:56 -0700	[thread overview]
Message-ID: <xmqq37lzz5yv.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160820072214.GB24992@x220-a02> (Zenaan Harkness's message of "Sat, 20 Aug 2016 17:22:14 +1000")

Zenaan Harkness <zen@freedbms.net> writes:

> From man git-rm:
>
> --cached
>   Use this option to unstage and remove paths only from the index.
>   Working tree files, whether modified or not, will be left alone.
>
> This wording is unclear and dangerous, and ought be cleaned up somehow.

I think "unstage and" can be removed to make it more clear [*1*],
but otherwise I do not see much wrong with the description to make
it dangerous.

Can you elaborate?  Which part of the description is unclear?

"git help cli" gives a brief description as to why it should be
called "--cached".


[Footnote]

*1* The reason why "unstage" makes it ambiguous is because people
tend to use the word "stage" loosely.  Even though Git keeps track
of the entire state of a file, it is easy to confuse oneself to
mistakenly think that "git add" a modified file as "staging the
difference between the last committed state and the contents being
added", and from that mistaken world view, you would imagine
"unstage" may bring the last committed state back in the index,
which is not what "git rm --cached" does (it does "remove" the path
from the index).

  parent reply	other threads:[~2016-08-20 17:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-20  7:22 git rm --cached should be git rm --cache or git rm --stage Zenaan Harkness
2016-08-20  7:25 ` Zenaan Harkness
2016-08-20 17:48 ` Junio C Hamano [this message]
2016-08-20 19:14 ` Philip Oakley
2016-08-20 22:25   ` Zenaan Harkness
2016-08-20 23:06     ` Philip Oakley

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq37lzz5yv.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=zen@freedbms.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).