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

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: got: stsp changed refs/heads/main: a92c86451615
To:
gameoftrees@openbsd.org
Date:
Sun, 10 May 2026 23:35:29 +0200

Download raw body.

Thread
_gotd@gameoftrees.org:

> commit a74c8bce178f65b0a161350adb5f2f7667e7cbac
> from: Stefan Sperling <stsp@stsp.name>
> date: Sun May 10 12:41:46 2026 UTC
> messagelen: 616
>  
>  avoid checking out tree entry names "." and "..", and names containing "/"
>  
-snip-
>  M  lib/worktree.c               |   8+  0-
>  M  regress/cmdline/checkout.sh  |  62+  0-
>  M  regress/cmdline/common.sh    |  10+  6-

I guess stsp uses vim:

===> regress
===> regress/cmdline
==== checkout ====
./checkout.sh -q -r "/tmp"
./checkout.sh[1208]: xxd: not found

That's in test_checkout_bad_tree_entry.  xxd is part of vim and not
generally available.  Since doing this in a portable way seems to
be surprisingly difficult[1], maybe another approach is possible?


[1] My attempt with awk so far:

function h2d(x) {
        return index("0123456789abcdef", tolower(x)) - 1
}

{
        for (i = 1; i < length($0); i += 2) {
                c = h2d(substr($0, i, 1)) * 16 + h2d(substr($0, i+1, 1))
                printf("%c", c < 128 ? c : c - 256)
        }
}

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de