git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: why doesn't "git reset" mention optional pathspec?

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Dec 8, 2018, 17:37 UTC
Message-ID
<alpine.LFD.2.21.1812081236220.32716@localhost.localdomain>
In-Reply-To
<CACsJy8AC-anZ=EA3zxWeX8UUNcZiKsQMu8x0eCHAOCUjFWoFuQ@mail.gmail.com>
On Sat, 8 Dec 2018, Duy Nguyen wrote:
Show 29 quoted lines
> On Sat, Dec 8, 2018 at 6:32 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> >
> > On Sat, 8 Dec 2018, Duy Nguyen wrote:
> >
> > > On Sat, Dec 8, 2018 at 5:08 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
> > > >
> > > >
> > > >   from "man git-reset":
> > > >
> > > > SYNOPSIS
> > > >   git reset [-q] [<tree-ish>] [--] <paths>...
> > > >   git reset (--patch | -p) [<tree-ish>] [--] [<paths>...]
> > > >   git reset [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] [<commit>]
> > > >
> > > > oddly, the third form says nothing about possible "<paths>", even
> > > > though i'm pretty sure they're valid in that third case (at least
> > > > for "--mixed"). thoughts? is that just an oversight in the man
> > > > page?
> > >
> > > --mixed prints a deprecation warning. I don't think it's worth
> > > making the synopsis more complicated for that. All other modes
> > > reject pathspec.
> >
> >   i just tested this, and i don't see a deprecation warning.
>
> Hmm.. maybe I misread the code. I just tried it
>
> $ ./git reset --mixed HEAD foo
> warning: --mixed with paths is deprecated; use 'git reset -- <paths>' instead.
  weird ... i just tried this two ways, explicitly specifying
"--mixed" and also without (which is the default mode, right?), and i
got the deprecated message with the first but not the second. that
seems ... odd.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Duy NguyenNext: Duy Nguyen
Message 5 of 8 in “why doesn't "git reset" mention optional pathspec?”
  1. Robert P. J. DayDec 8, 2018
  2. Duy NguyenDec 8, 2018
  3. Robert P. J. DayDec 8, 2018
  4. Duy NguyenDec 8, 2018
  5. Robert P. J. DayDec 8, 2018
  6. Duy NguyenDec 8, 2018
  7. Junio C HamanoDec 9, 2018
  8. Robert P. J. DayDec 8, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.