git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Lv <lv.zheng.2015@gmail.com>
To: git@vger.kernel.org
Subject: git-mv ignores gitignore file
Date: Tue, 16 Feb 2016 16:35:16 +0800	[thread overview]
Message-ID: <56C2DF44.10309@gmail.com> (raw)

gitignore(5) manual says that

> A gitignore file specifies intentionally untracked files that Git 
> should ignore. Files already tracked by Git are not affected ...

> The purpose of gitignore files is to ensure that certain files not 
> tracked by Git remain untracked.

which means that the following operations are totally correct.

$ echo "b" >> .gitignore
$ echo "Something" > a
$ git add a
$ git mv a b

Equivalantly,

$ echo "b" >> .gitignore
$ echo "Something" > b
$ git add --force b

That is, doing something --force when --force it is not specified.

However, this may not be the intented behavior. The user might not want
to equivalantly add a `new' file b to the index when b should be
gitignored. Such operations are possibly oversight of users.

The ideal behavior, issue a warning when git-mv target collides with
gitignore.

Thanks.

                 reply	other threads:[~2016-02-16  8:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=56C2DF44.10309@gmail.com \
    --to=lv.zheng.2015@gmail.com \
    --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.
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 NNTP newsgroup(s).