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

Re: [PATCH] specifying ranges: we did not mean to make ".." an empty set

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 23, 2012, 17:51 UTC
Message-ID
<7vobm14hu9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<874nntq0sb.fsf@thomas.inf.ethz.ch>
Thomas Rast <trast@student.ethz.ch> writes:
Show 7 quoted lines
> I don't think that ".." is really a no-op.  It is true that HEAD..HEAD
> does not itself result in any revisions, but it *could* be used as a
> silly shorthand to introduce ^HEAD into the objects being walked.  This
> can make a difference if it then excludes other objects, too.
>
> I would argue that such use is misguided, and I am in favor of the
> patch, but in theory it is possible.

You could say "log --all .. --" when you mean "log --all ^HEAD", because .. === HEAD..HEAD === ^HEAD HEAD and HEAD is already contained in --all. So it is a valid point.

You however cannot say "log --all .." without double-dash to disambiguate, as you would get:

    $ git log --all ..
    fatal: ambiguous argument '..': both revision and filename

Any existing practice that used to produce useful results couldn't have been using ".." without an explicit "--", I think, and with the disambiguation that favors to take ".." as the parent directory, "log --all .. --" still means "log --all ^HEAD".

So I think we are still OK.
Previous: Thomas RastNext: Junio C Hamano
Message 4 of 6 in “specifying ranges: we did not mean to make ".." an empty set”
  1. specifying ranges: we did not mean to make ".." an empty setJunio C Hamano, Aug 22, 2012
  2. Jeff KingAug 23, 2012
  3. Thomas RastAug 23, 2012
  4. Junio C HamanoAug 23, 2012
  5. Junio C HamanoAug 23, 2012
  6. Jeff KingAug 23, 2012

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.