rev-parse: -- is sometimes a flag and sometimes an arg?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



```
$ git rev-parse unknown-tag
unknown-tag
fatal: ambiguous argument 'unknown-tag': unknown revision or path not
in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
```

OK

```
$ git rev-parse unknown-tag --
fatal: bad revision 'unknown-tag'
```

Much nicer error.  But:

```
$ git rev-parse HEAD --
113a928239196d0d9f70671517ce917071ceecf6
--
```

That's not very nice.  Why is "--" treated as an arg?

```
$ git rev-parse HEAD
113a928239196d0d9f70671517ce917071ceecf6
```

Looking at rev-parse code it SEEMS to be intentional, but I can't
comprehend why.

Tim



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux