Thread (1 message) 1 message, 1 author, 2019-05-07

Re: [PATCH v3 00/16] Add new command 'restore'

From: Junio C Hamano <hidden>
Date: 2019-05-07 04:58:00

Emily Shaffer [off-list ref] writes:
Then, figuring that I only had a few files, I thought I'd type them
each, with the exception of a .c/.h pair:

g restore --staged builtin/log.c builtin/walken.c revision.*

Because I had build artifacts present, this vomited while trying to
unstage revision.o, and again left me with all my changes still staged.
revision.o is validly ignored:

$ g check-ignore revision.o                               
revision.o
Often a claim "validly ignored" by users needs to be taken with a
grain of salt.  When it is in the index, it is no longer ignored.

Assuming that you do not have revision.o in the index, and if
"restore" is still "checkout -- <pathspec>" in disguise, then I
think you could ask "git" not your shell to expand the asterisk, by
protecting it from the shell, i.e.

	$ git restore --staged revision.\*

and the pathspec should not match untracked revision.o.  And if that
does not work, you found a bug in restore, I think ;-).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help