"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: Bug in got log commit modifier handling?
To:
Timo Myyrä <timo.myyra@bittivirhe.fi>
Cc:
gameoftrees@openbsd.org
Date:
Wed, 24 Sep 2025 09:27:57 +0200

Download raw body.

Thread
On Tue, Sep 23, 2025 at 10:47:11PM +0300, Timo Myyrä wrote:
> Hi,
> 
> I was trying to get got to list previous and next commits when given
> commit id to it but it does not seem to work correctly.
> 
> I'm using it on OpenBSD ports tree checkout and looking at the
> editors/emacs/Makefile history. Here's an snippet of full "got log"
> output of "got log Makefile":
> ...
> 2017-09-16 a2cb393 Update to emacs-25.3, which rolls in the fixes for CVE-2017-14482
> 2017-09-11 491dc20 Bump, missed in previous.
> 2017-05-01 bbdf152 emacs-25.2
> 2017-02-10 4f532da Open ports tree patches in diff-mode by default.
> 2017-02-10 2ee96d3 Don't use ld -Z on arm.
> ...
> 
> I wanted to get the next and prev commits from commit "bbdf152".
> The command to get previous commit worked as expected:
> 
> > $ got log -s -c bbdf152:- -l 1 Makefile 
> > 2017-02-10 4f532da Open ports tree patches in diff-mode by default.
> > $
> 
> Then I tried the similar command list the next commit:
> > $ got log -s -c bbdf152:+ -l 1 Makefile 
> > 2017-05-01 bbdf152 emacs-25.2
> > $
> 
> Which seems that the log traversal is ignoring the modifier to start the
> iteration from one commit after the bbdf152 commit. I was expecting the
> above command to return:
> > 2017-09-11 491dc20 Bump, missed in previous.
> 
> Is this a bug or am I using the got log incorrectly here?

It might be cause for confusion in this case, but by design the specified
path acts like a filter which applies after commits to display have already
been selected.

A :+1 modifier selects the next commit as seen from the repository's
root directory.

Consider that there were months worth of commits to ports.git in-between
those two revisions of editors/emacs/Makefile.

In your example, bbdf152:+ selects d0004fdd39fa79e6a3d072e9675dadeddde3ce6b
which modified editors/tea/Makefile and editors/teaqt/Makefile.

The next change to editors/emacs at a2cb393 was made many, many commits later.