git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] rm: add --intent-to-add, to be used with --cached
Date: Mon, 24 Jun 2019 22:02:21 +0700	[thread overview]
Message-ID: <CACsJy8DOAWw7TSi1jPqSNV-41h8R6nUAjVC+osTjaDpmxnPa-g@mail.gmail.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1906241251040.44@tvgsbejvaqbjf.bet>

On Mon, Jun 24, 2019 at 5:52 PM Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>
> Hi Duy,
>
> On Sat, 22 Jun 2019, Nguyễn Thái Ngọc Duy wrote:
>
> > An index entry serves two purposes: to keep the content to be committed,
> > and to mark that the same path on worktree is tracked. When
> >
> >     git rm --cached foo
> >
> > is called and there is "foo" in worktree, its status is changed from
> > tracked to untracked. Which I think is not intended, at least from the
> > user perspective because we almost always tell people "Git is about the
> > content" (*).
>
> I can buy that rationale. However, I do not think that "remove intent to
> add" (which is how I read `git rm --intent-to-add`) is a particularly good
> way to express this. I could see `--keep-intent-to-add` as a better
> alternative, though.

Oh good. I also dislike --intent-to-add for a different reasosn but I
didn't bring it up: This "rm --intent-to-cache" removes the content
and keeps ita, but there's also the potential use case to keep the
content and remove ita (e.g. you just want to undo intent-to-add
effect, but if you have already staged some content, leave it).

This case is about the worktree. But "git rm" is not designed for
that. It either handles both index and worktree, or just index. "Just
worktree" is delegated to system's "rm". But system "rm" can't do
anything about ita bit. And if we make "git rm --worktree" do that,
then "rm --worktree --intent-to-add" would be a much better name and
should not be taken by this patch. But "git rm --worktree" is not real
to even start a discussion about that...

End of rambling. I guess what I'm saying is, --keep-intent-to-add is a
good name (that I also didn't think of).
-- 
Duy

      reply	other threads:[~2019-06-24 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-22 12:24 [PATCH] rm: add --intent-to-add, to be used with --cached Nguyễn Thái Ngọc Duy
2019-06-24 10:52 ` Johannes Schindelin
2019-06-24 15:02   ` Duy Nguyen [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

  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=CACsJy8DOAWw7TSi1jPqSNV-41h8R6nUAjVC+osTjaDpmxnPa-g@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /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).