git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "xfswindy\@163.com" <xfswindy@163.com>
Cc: git@vger.kernel.org
Subject: Re: Git issue report
Date: Thu, 19 Apr 2018 14:33:00 +0900	[thread overview]
Message-ID: <xmqqbmefep6b.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <-tc3xop-8i635uwx53zom190jcbwyrl587bgic1u7ogu-h5ta7c-vg7tsu-9tjre9eq72we-wflfrt-v7y1d7-7ekgia-gbrcn9of96to-6fxlag-u56rt19q40x9-ved85k-25erwyma9au4-fjthm4-fwargr.1524108608363@email.android.com> (xfswindy@163.com's message of "Thu, 19 Apr 2018 11:30:08 +0800")

"xfswindy@163.com" <xfswindy@163.com> writes:

> Hi,
>   I met a issue when using git.
> I cannot delete the file by the commond 'git rm'.
> The file name is a little diff from common file.
> I accidentally named the file "filename\r", display such as filename^M. Then I commit the file by 'git add .'.
> After I find this mistake, I remove the file, then try to use commond "git rm" to delete the file, but failed.
>
> My git version is 1.7.9.5.

The following works fine with v1.7.9.5 (I have separate installs of
various versions of Git and use "rungit $version" to choose from
them, so just read "rungit v1.7.9.5" below as if it is "git").

	$ rungit v1.7.9.5 init
        $ N=$(printf "filename\015")
        $ echo >"$N"
        $ /bin/ls fil* | od -cx
        0000000   f   i   l   e   n   a   m   e  \r  \n
                   6966    656c    616e    656d    0a0d
        0000012
        $ rungit v1.7.9.5 add .
        $ rungit v1.7.9.5 ls-files
        "filename\r"
        $ rm filename*
        $ rungit v1.7.9.5 rm filename*
        $ rungit v1.7.9.5 ls-files 
	$ /bin/ls
        $ exit

and I do not think of any reason why we would have broken it since.

FYI, you do not have to do a separate "rm filename*" in the above
sequence; "git rm filename*" would remove it from both the working
tree and from the index.  I did it in the above illustration in two
separate steps only because you said you removed and then did "git
rm" and I wanted to emulate it.

> Is this issue reported?

I do not recall hearing about it, but you must have looked for one
hard already and I haven't, so...

> If this issue is solved, could you tell me which version I should get.

It appears to me that such an issue did not exist in the first
place.


      reply	other threads:[~2018-04-19  5:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  3:30 Git issue report xfswindy
2018-04-19  5:33 ` Junio C Hamano [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=xmqqbmefep6b.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=xfswindy@163.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.
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).