git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git issue report
@ 2018-04-19  3:30 xfswindy
  2018-04-19  5:33 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: xfswindy @ 2018-04-19  3:30 UTC (permalink / raw)
  To: git

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.
Is this issue reported?
If this issue is solved, could you tell me which version I should get.

Thanks!
Xiaofeng Chen
04/19/2018


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Git issue report
  2018-04-19  3:30 Git issue report xfswindy
@ 2018-04-19  5:33 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2018-04-19  5:33 UTC (permalink / raw)
  To: xfswindy@163.com; +Cc: git

"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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-19  5:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19  3:30 Git issue report xfswindy
2018-04-19  5:33 ` Junio C Hamano

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).