Codebergdnkl

foot

master
ply5 git calls571 ms29 KiB2 cachedprotocol v2
60 lines1.6 KiBexecutableRaw
1#!/bin/sh
3set -e
5if [ ${#} -ne 3 ]; then
6 echo "Usage: ${0} <default_version> <src_dir> <out_file>"
7 exit 1
8fi
10default_version=${1}
11src_dir=${2}
12out_file=${3}
14# echo "default version: ${default_version}"
15# echo "source directory: ${src_dir}"
16# echo "output file: ${out_file}"
18if [ -d "${src_dir}/.git" ] && command -v git > /dev/null; then
19 workdir=$(pwd)
20 cd "${src_dir}"
22 if git describe --tags > /dev/null 2>&1; then
23 git_version=$(git describe --always --tags)
24 else
25 # No tags available, happens in e.g. CI builds
26 git_version="${default_version}"
27 fi
29 git_branch=$(git rev-parse --abbrev-ref HEAD)
30 cd "${workdir}"
32 new_version="${git_version} ($(date "+%b %d %Y"), branch '${git_branch}')"
33else
34 new_version="${default_version}"
35 extra=""
36fi
38major=$(echo "${new_version}" | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\1/')
39minor=$(echo "${new_version}" | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\2/')
40patch=$(echo "${new_version}" | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+).*/\3/')
41extra=$(echo "${new_version}" | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)(-([0-9]+-g[a-z0-9]+) .*)?.*/\5/')
43new_version="#define FOOT_VERSION \"${new_version}\"
44#define FOOT_MAJOR ${major}
45#define FOOT_MINOR ${minor}
46#define FOOT_PATCH ${patch}
47#define FOOT_EXTRA \"${extra}\""
49if [ -f "${out_file}" ]; then
50 old_version=$(cat "${out_file}")
51else
52 old_version=""
53fi
55# echo "old version: ${old_version}"
56# echo "new version: ${new_version}"
58if [ "${old_version}" != "${new_version}" ]; then
59 echo "${new_version}" > "${out_file}"
60fi
Diagnostics5 git calls · 571 ms
CallStatusSizeTime0571 ms
discover200178 B2 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=2
git.response.bytes=178
git.server.agent=git/2.56.1-Linux
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch server-option object-format
git.server.fetch=shallow wait-for-done filter
git.protocol.version=2
git.pkt.frames=9
git.pkt.data=7
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=178
git.pkt.payload.max=35
ls-refs20010 KiB2 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=2
git.response.bytes=10322
git.response.cache=UPDATING
git.response.duration_ms=2
git.protocol.version=2
git.pkt.frames=108
git.pkt.data=107
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=10322
git.pkt.payload.max=106
git.ls_refs.count=107
git.ls_refs.head=refs/heads/master
fetchtree:0 · deepen 102009.3 KiB · hit2 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=9489
git.response.cache=HIT
git.response.duration_ms=2
git.fetch.filter=tree:0
git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=9489
git.pkt.payload.max=9389
git.sideband.band1.bytes=9389
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=10
git.pack.bytes=9389
git.pack.ofs_delta=0
git.pack.ref_delta=0
git.pack.chain.max=0
git.pack.trailer=de930681b6073ba5b599a0f956bfbd114762ad5a
git.pack.full=10
Open pack map
fetchcombine:blob:none+tree:2 · deepen 12008.6 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=566
git.response.bytes=8830
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=combine:blob:none+tree:2
git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
git.fetch.haves.count=0
git.fetch.deepen=1
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=7
git.pkt.data=5
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=8830
git.pkt.payload.max=8730
git.sideband.band1.bytes=8730
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=14
git.pack.bytes=8730
git.fetch.wide.objects=14
git.fetch.wide.extra_bytes=9909
git.fetch.wide.blobs=0
fetch200699 B566 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=699
git.response.cache=MISS
git.response.duration_ms=566
git.fetch.wants=a030d512aee78163113a4492cf752191c8f5c298
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=4
git.pkt.data=3
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=699
git.pkt.payload.max=672
git.sideband.band1.bytes=672
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://codeberg.org/dnkl/foot
Ref
refs/heads/master
Commit
c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
cf-ray
a5e170e57f676102
Request
714d03c2…
Protocol
v2 · sha1
Agent
git/2.56.1-Linux
Filter
advertised
Fetch
shallow wait-for-done filter
Capabilities
agent ls-refs fetch server-option object-format