git lfs track --filename "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa" fail to execute in win 10 · Issue #5409 · git-lfs/git-lfs · GitHub
Skip to content

git lfs track --filename "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa" fail to execute in win 10 #5409

Closed

Description

@zhoushaokun

Describe the bug

As git lfs track doc said,we can use --filename to set path with special character such as [ ] * ?. But when I do this in my win 10 computer, it went wrong.

To Reproduce
Steps to reproduce the behavior:

  1. In win 10, New two files named: "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa" in dir [2023-06-23] in any installed git lfs repo's root folder.
  2. Open git bash command execute git lfs track --filename "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa"
  3. See error
    image

And the .gitattributes file will add one line config which is wired, because it has already ended with error. Why should have some effect on really disk file?

Expected behavior

using --filename for paths with special character and worked as doc said

System environment

git-lfs/3.3.0 (GitHub; windows amd64; go 1.19; git e815aff5)
git version 2.36.1.windows.1

image

Additional context

Alse, I tried execute GIT_TRACE=1 git lfs track --filename "/[2023-06-23]/1.tset" "/[2023-06-23]/2.aaaa", the execution details follwoing:

image

From the details, I guess it may related to the git 'ls-files' '--cached' '--' '\[2023-06-23\]/1.tset',because when i execute the comand longly in my git bash it show that:
image

Activity

  1. chrisd8088 commented on Jul 3, 2023

    @chrisd8088
    Member

    Hey, thanks for the report, and I'm sorry you're having trouble. I've tried to reproduce this locally without success, but that's because I believe it's a Windows-specific issue. Unfortunately my Windows dev environment is not working right now, but once I get it going again, I'll take a look at this.

    Thanks for your patience, and for reporting the problem!

  2. zhoushaokun commented on Jul 4, 2023

    @zhoushaokun
    Author

    @chrisd8088 Sorry to not put all information. I have also tried in my mac machine, it works quite well.
    Thanks for your reply.

  3. bk2204 commented on Jul 13, 2023

    @bk2204
    Member

    I can reproduce this on my test Windows VM and I think I have a fix. I'll link a PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions