git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] specifying ranges: we did not mean to make ".." an empty set
Date: Thu, 23 Aug 2012 18:14:27 -0400	[thread overview]
Message-ID: <20120823221427.GA9337@sigill.intra.peff.net> (raw)
In-Reply-To: <7vhart2sos.fsf@alter.siamese.dyndns.org>

On Thu, Aug 23, 2012 at 02:40:19PM -0700, Junio C Hamano wrote:

> > This last sentence confuses me. Now we are documenting that "yes, ..
> > really means HEAD..HEAD, which is the empty range". But isn't the point
> > of this patch to say "sure, it would be the empty range, but because
> > that is stupid and pointless, we do not consider it valid and treat ..
> > as a pathspec"?
> 
> No, we still allow ".." as a short-hand for HEAD..HEAD when it is
> understood as a rev.  We also allow ".." as a pathspec to match the
> parent directory when it is understood as a pathspec.
> 
> The only thing the topic wanted to change was the disambiguation
> logic.  When a string S can name both rev and path, we ask the user
> to disambiguate, but when S is "..", we do not have to (as one
> interpretation is meaningless).

Ah, right. OK, that makes more sense. I wasn't thinking that you could
still do:

  git log .. --

if you really wanted to. So yeah, it doesn't belong here...

> I think that documentation belongs to the section of disambiguation
> without "--".  Usually you need to use "--", but ".." is taken as
> path even without "--".

...but I agree it would be worth mentioning there. But I am not sure
where "there" is in the current documentation.

> An interesting side effect is that
> 
> 	git log .. pu
> 
> used to error out for ".." being both rev and path, but it will
> error out for "pu" not being a path in the working tree.  This is
> because on a command line without "--" disambiguation, once you
> start listing paths, you have to have nothing but paths after that
> point.

Hmm. Yeah, that's a slightly surprising emergent behavior. But I think
it is not a big deal since both cases led to errors anyway.

-Peff

      reply	other threads:[~2012-08-23 22:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22 22:59 [PATCH] specifying ranges: we did not mean to make ".." an empty set Junio C Hamano
2012-08-23  8:29 ` Jeff King
2012-08-23 11:56   ` Thomas Rast
2012-08-23 17:51     ` Junio C Hamano
2012-08-23 21:40   ` Junio C Hamano
2012-08-23 22:14     ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120823221427.GA9337@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).