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

Re: [RFC PATCH] line-log: clarify [a,b) notation for ranges

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 9, 2018, 12:50 UTC
Message-ID
<nycvar.QRO.7.76.6.1808091448260.71@tvgsbejvaqbjf.bet>
In-Reply-To
<CAPig+cTVEq1AGvtxxonbU4PgqeG0fOy9CSDO7ThjVpfGoJaAJA@mail.gmail.com>
Hi Eric,
On Tue, 7 Aug 2018, Eric Sunshine wrote:
Show 9 quoted lines
> On Tue, Aug 7, 2018 at 9:54 AM Andrei Rybak <rybak.a.v@gmail.com> wrote:
> > line-log.[ch] use left-closed, right-open interval logic. Change comment
> > and debug output to square brackets+parentheses notation to help
> > developers avoid off-by-one errors.
> > ---
> 
> This seems sensible. There might be some reviewers who suggest
> different notation since "[...)" is not universal (see [1]), but I
> think this is fine.

Indeed. When I started out studying mathematics, I learned the notation [...[ (which makes a lot more sense, if you think about it).

Besides, it's not like we start from a fresh slate. Git is already over a decade old. Our commit ranges are "half open", i.e. the exact thing that is described here. There's gotta be some precedent in the documentation, and introducing something willfully inconsistent is probably a pretty bad idea.

Ciao, Dscho

Previous: Eric SunshineNext: Andrei Rybak
Message 3 of 4 in “line-log: clarify [a,b) notation for ranges”
  1. line-log: clarify [a,b) notation for rangesAndrei Rybak, Aug 7, 2018
  2. Eric SunshineAug 7, 2018
  3. Johannes SchindelinAug 9, 2018
  4. line-log: clarify [a,b) notation for rangesAndrei Rybak, Aug 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.