{"thread":{"id":"37305","subject":"glob escaping doesn't work with git mv","startedAt":"2014-08-07T01:52:10Z","lastAt":"2014-08-07T02:10:09Z","messageCount":2,"participants":["Alan Grover","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"247406","messageId":"CA+cJFMm_vJwk=D0dkhEvfXwWk1S74hONb_g7O9W0iMZD3yAdLg@mail.gmail.com","threadId":"37305","inReplyTo":null,"subject":"glob escaping doesn't work with git mv","fromName":"Alan Grover","fromEmail":"alan.grover@gmail.com","sentAt":"2014-08-07T01:52:10Z","receivedAt":"2014-08-07T01:52:10Z","isPatch":false,"sender":{"key":"alan.grover@gmail.com","avatar":null},"body":"I tried using escaped globs with git mv, but globs don't seem to be\nexpanded with git mv.\n\nSo, for example, I've got files file1 & file2, and have been editing\nthem, so I've got file1~ and file2~ also, and *~ is in .gitignore.\n\nIf I do:\n\n$ mkdir newdir\n$ git mv file* newdir\n\nI get a 'fatal: not in repository' error because I'm trying to move\nuntracked files.\n\nSince we can do git add file\\*, I tried:\n\n$ git mv file\\* newdir\n\nI get a 'bad source, source=file* destination=file*' error. It seems\nto be looking for a file named 'file*' rather than performing glob\nexpansion.\n\nIf I do:\n\n$ rm *~\n$ git mv file* newdir\n\nEverything works as expected. It would be convenient if git mv\nexpanded escaped globs.\n\nThanks!\n"},{"id":"247407","messageId":"CACsJy8APd6JH=32eWqK0m3e9bEWcrme3xZUewCyQxv08w=CyUQ@mail.gmail.com","threadId":"37305","inReplyTo":"CA+cJFMm_vJwk=D0dkhEvfXwWk1S74hONb_g7O9W0iMZD3yAdLg@mail.gmail.com","subject":"Re: glob escaping doesn't work with git mv","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-08-07T02:10:09Z","receivedAt":"2014-08-07T02:10:09Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, Aug 7, 2014 at 8:52 AM, Alan Grover <alan.grover@gmail.com> wrote:\n> Since we can do git add file\\*, I tried:\n>\n> $ git mv file\\* newdir\n>\n> I get a 'bad source, source=file* destination=file*' error. It seems\n> to be looking for a file named 'file*' rather than performing glob\n> expansion.\n\nThis is a known problem (to me at least). Source path processing in\ngit-mv is a bit complicated and it scared me away from converting to\nusing pathspec (which supports globbing and stuff). But perhaps if I\njust expand pathspec and feed the final path list to git-mv (pretty\nmuch like how shells expand glob) then it probably works..\n-- \nDuy\n"}]}