Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:49

"Avery Pennarun" [off-list ref] writes:
quoted
  * You say "git checkout -- file" when you want to "check out the file
   from the index";
The real question here is the --.  Is it strictly needed?  It's
optional in things like git-diff, which just do their best to guess
what you mean if you don't use the --.
No, I wrote -- only for clarity, because you can happen to have a branch
whose name is the same as the file.  Otherwise you can safely omit it,
just like git-diff and any other commands that follow the -- convention.

I have a work tree that has an untracked file HEAD and master just to
catch script breakages that forgets to place -- in appropriate places when
they deal with user supplied pathnames.

Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to

From: Avery Pennarun <hidden>
Date: 2016-06-15 22:44:50

On 6/25/08, Junio C Hamano [off-list ref] wrote:
"Avery Pennarun" [off-list ref] writes:
quoted
quoted
  * You say "git checkout -- file" when you want to "check out the file
 >>    from the index";
 >
 > The real question here is the --.  Is it strictly needed?  It's
 > optional in things like git-diff, which just do their best to guess
 > what you mean if you don't use the --.

No, I wrote -- only for clarity, because you can happen to have a branch
 whose name is the same as the file.  Otherwise you can safely omit it,
 just like git-diff and any other commands that follow the -- convention.
Oops, I got mixed up.  Only git-reset requires the --.  Would it make
sense to bring git-reset into line with everything else, then?

Thanks,

Avery
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help