# why doesn't "git reset" mention optional pathspec?

8 messages from 2018-12-08 to 2018-12-09. Participants: Robert P. J. Day, Duy Nguyen, Junio C Hamano.
Thread: https://gitlist.dev/t/49979

## Robert P. J. Day, 2018-12-08 16:05

Subject: why doesn't "git reset" mention optional pathspec?
Message-ID: <alpine.LFD.2.21.1812081103500.29142@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1812081103500.29142%40localhost.localdomain

```

  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?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

```

## Duy Nguyen, 2018-12-08 17:28

Subject: Re: why doesn't "git reset" mention optional pathspec?
Message-ID: <CACsJy8APyyAWM+L=HU1XM4V+qdTWqjto6x=Q06By8DbgtYfpCA@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8APyyAWM%2BL%3DHU1XM4V%2BqdTWqjto6x%3DQ06By8DbgtYfpCA%40mail.gmail.com
In-Reply-To: <alpine.LFD.2.21.1812081103500.29142@localhost.localdomain>

```
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.
-- 
Duy

```

## Robert P. J. Day, 2018-12-08 17:32

Subject: Re: why doesn't "git reset" mention optional pathspec?
Message-ID: <alpine.LFD.2.21.1812081232240.32380@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1812081232240.32380%40localhost.localdomain
In-Reply-To: <CACsJy8APyyAWM+L=HU1XM4V+qdTWqjto6x=Q06By8DbgtYfpCA@mail.gmail.com>

```
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.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

```

## Duy Nguyen, 2018-12-08 17:34

Subject: Re: why doesn't "git reset" mention optional pathspec?
Message-ID: <CACsJy8AC-anZ=EA3zxWeX8UUNcZiKsQMu8x0eCHAOCUjFWoFuQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8AC-anZ%3DEA3zxWeX8UUNcZiKsQMu8x0eCHAOCUjFWoFuQ%40mail.gmail.com
In-Reply-To: <alpine.LFD.2.21.1812081232240.32380@localhost.localdomain>

```
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.
-- 
Duy

```

## Robert P. J. Day, 2018-12-08 17:37

Subject: Re: why doesn't "git reset" mention optional pathspec?
Message-ID: <alpine.LFD.2.21.1812081236220.32716@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1812081236220.32716%40localhost.localdomain
In-Reply-To: <CACsJy8AC-anZ=EA3zxWeX8UUNcZiKsQMu8x0eCHAOCUjFWoFuQ@mail.gmail.com>

```
On Sat, 8 Dec 2018, Duy Nguyen wrote:

> 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
========================================================================

```

## Robert P. J. Day, 2018-12-08 17:42

Subject: Re: why doesn't "git reset" mention optional pathspec?
Message-ID: <alpine.LFD.2.21.1812081239480.3382@localhost.localdomain>
URL: https://gitlist.dev/e/alpine.LFD.2.21.1812081239480.3382%40localhost.localdomain
In-Reply-To: <CACsJy8AC-anZ=EA3zxWeX8UUNcZiKsQMu8x0eCHAOCUjFWoFuQ@mail.gmail.com>

```
On Sat, 8 Dec 2018, Duy Nguyen wrote:

> 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.

  my test:

  Changes to be committed:
    (use "git reset HEAD <file>..." to unstage)

  	modified:   README.asc
  	modified:   Rakefile

  $ git reset -- README.asc
  Unstaged changes after reset:
  M	README.asc
  $ git reset --mixed -- Rakefile
  warning: --mixed with paths is deprecated; use 'git reset -- <paths>' instead.
  Unstaged changes after reset:
  M	README.asc
  M	Rakefile
  $

that definitely seems inconsistent.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================


```

## Duy Nguyen, 2018-12-08 18:17

Subject: Re: why doesn't "git reset" mention optional pathspec?
Message-ID: <CACsJy8A_vaVUt389O5ABa+vsrVDgo1L3WZzVx+P0qfiaY9=p1w@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8A_vaVUt389O5ABa%2BvsrVDgo1L3WZzVx%2BP0qfiaY9%3Dp1w%40mail.gmail.com
In-Reply-To: <alpine.LFD.2.21.1812081236220.32716@localhost.localdomain>

```
On Sat, Dec 8, 2018 at 6:37 PM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> On Sat, 8 Dec 2018, Duy Nguyen wrote:
>
> > 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.

Without --mixed, you're using the first form

    git reset [-q] [<tree-ish>] [--] <paths>...

which accepts pathspec. If it's not clear, of course patches are welcome.
-- 
Duy

```

## Junio C Hamano, 2018-12-09 01:42

Subject: Re: why doesn't "git reset" mention optional pathspec?
Message-ID: <xmqqftv75vcz.fsf@gitster-ct.c.googlers.com>
URL: https://gitlist.dev/e/xmqqftv75vcz.fsf%40gitster-ct.c.googlers.com
In-Reply-To: <CACsJy8A_vaVUt389O5ABa+vsrVDgo1L3WZzVx+P0qfiaY9=p1w@mail.gmail.com>

```
Duy Nguyen <pclouds@gmail.com> writes:

> Without --mixed, you're using the first form
>
>     git reset [-q] [<tree-ish>] [--] <paths>...
>
> which accepts pathspec. If it's not clear, of course patches are welcome.

Yup.  The deprecation is about spelling with "--mixed" when invoking
the "restore these paths out of tree-ish (or HEAD when omitted)
only in the index" mode.  The feature is of course not deprecated
(but it might have been better if it were "git checkout --cached").


```
