Commits
- Commit:
b16893ba284e90739fc814673523878e8874dc0f
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
add some helper functions to compute hashes
This adds a set of functions to abstract over SHA1Init, SHA1Update,
SHA1Final, their respective SHA256 variants and how to compare digests.
Replace all the SHA1*() usage with the new APIs. It's a preparatory
step for sha256 handling.
ok stsp@
- Commit:
98670ba726486c39efff220ab1e074c62023aae7
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: rework SHA detection
Simply the SHA detection by not predicating on libcrypto, but instead
checking individual header files.
- Commit:
4680f704353811c8bb6ce65eac3714d1bd200c26
- From:
- Thomas Adam <thomas@xteddy.org>
- Date:
portable: remove sha1.h; found portably
Remove sha1.h as this is found portably across systems.
- Commit:
c8ae092d079ca1c9f5f2a7e44c73948cd55454e7
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
provide functions to parse/serialize different hashes
it abstracts over the hash type and ensures that object ids are zero'ed
before their sha1 digest is written. Needed by the incoming sha256
support.
ok stsp@
- Commit:
be288a59f42e0b5e203e2c5545bf3e042ff4b79f
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
rename lib/sha1.c to lib/hash.c
It will soon grow functions to deal with sha256 too. stsp@ agrees.
- Commit:
588a8092bc282294ee23585991e81586905a8fd4
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
include sha2.h too where sha1.h is included
In preparation for wide sha256 support; stsp@ agrees. Change done
mechanically with
find . -iname \*.[cy] -exec sam {} +
X ,x/<sha1\.h>/i/\n#include <sha2.h>
- Commit:
c12ab9ad7f32b9eb712734e776de2f7b0370e643
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix "got fetch" hang against out-of-date remote repositories
Do not assume that remote repositories will always have our objects.
In Git protocol terms: Do not wait for an ACK from the server before
sending the final "done" message. Otherwise servers might be waiting
for more have-lines from us in order to find a common ancestor, which
will never be sent by us.
Problem reported by James Cook who also provided an initial test case
ok op@
- Commit:
7abf18632acc87a9e98668077a1af3d132bd2853
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got: further fetch tweaks to prevent unintended fetches
Implement stsp's suggestion to only fetch remote's HEAD if the symref
refs/remote/*/HEAD exists, and its target no longer matches the remote
HEAD. This ensures users tracking a project won't miss a change in HEAD,
while also fixing the issue reported by naddy where HEAD was fetched by
default even though a specific, potentially less active, branch is cloned,
resulting in a repository with more commits than necessary.
In addition, unless 'got fetch -b <branch>' is used, the remote HEAD branch
will be fetched if branches are not set in got.conf and there is no work
tree to ascertain a branch, or said branches are not found on the server.
ok stsp@
- Commit:
7917d6d59bbefd910c6facb73b6deaaa17ab7399
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
backout got: always fetch remote HEAD except when -b is used
As pointed out by naddy, this behaviour is not ideal when users
want to limit their repository to a particular branch which will
diverge from HEAD over time, such as -stable branches.
See https://marc.gameoftrees.org/mail/1676388048.8632_0.html
- Commit:
81c8e458ff6b92cd522cd5700131467645a21204
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got: always fetch remote HEAD except when -b is used
Rather than only fetch HEAD when there are no branches set in got.conf and
there is no branch to be inferred from a work tree, or said branches don't
exist on the server, always fetch HEAD unless 'got fetch -b branch' is used.
ok stsp@
- Commit:
d392cc0a86905f1c82da0736472b8ad89248c476
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
make 'got fetch -b branch' error reporting more helpful
The patch to got-fetch-pack.c was written by stsp with only minor tweaks
by me. Regress updated to account for the change in reporting.
stsp's original got-fetch-pack.c diff ok op jamsek
ok stsp@
- Commit:
e0380e3dfa71712eaaf9642b4d86b53e6a986653
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
special case 'got fetch -b <branch>' to only fetch <branch>
As discussed on irc, this drops the implicit remote HEAD fetch when -b is used.
got.1 has been updated to make the new fetch behaviour clear.
ok stsp@
- Commit:
84073f62fdfec793493251a7adbb339cd265a45b
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got: use intermediate pointers to plug leak on realloc
And save worktree_branch_len for reuse.
ok stsp@ and op@
- Commit:
9d0a7ee35139cbfd755c1647d0feeaa665e1a2a2
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix interaction of 'got fetch -b', got.conf, and work tree
Without branches in got.conf for a remote, and without -b/-R options,
the fallback to HEAD would only work when not invoked in a work tree.
With this fix 'got fetch' should behave as described in the man page.
The -b option now overrides both got.conf and the fallback to the work
tree's branch.
And fallback to HEAD works as expected when invoked in a repository.
Also, do not strictly require remote repositories to provide a branch
from the refs/heads/ namespace. In such cases users should be able to
use -R to select something to fetch.
ok jamsek
- Commit:
9228a15c477d8ec5797456ed322923d97fd9e92d
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got_imsg_fetch_ref: use struct instead of buffer for id
ok stsp@
- Commit:
f9f544689c6f4d8dd6dfb97da00ffbaf987ddab4
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got_imsg_fetch_have_ref: use struct instead of buffer for id
ok stsp@
- Commit:
fcbb06bf6925b542428b937afc9f37446058e748
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
replace malloc+memcpy with strndup. no functional change intended
ok stsp@
- Commit:
21c2d8be42605670e7037d011fea06c5efd5f725
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got: minor refactor of got_pathlist_free() API
Accept flag parameter to optionally specify which pointers to free. This saves
callers looping through the list to free pointers.
ok + fix stsp@
- Commit:
d639f28bed6c07bf171d552905c55829117715da
- From:
- Mark Jamsek <mark@jamsek.dev>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix uninitialised fildes variables in libexec helpers
Reviewed and uncovered as part of the diff in the forthcoming commit
(pathlist API refactor).
ok stsp@
- Commit:
6771d4253a7655812f9e1b5f25d98d86ec416951
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
always cast ctype' is*() arguments to unsigned char
ok stsp@
- Commit:
c22ed3f5d5d97db3f1d8fc8c649537c9033136f9
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
make 'got clone -b' work for repositories which lack a HEAD reference
ok op@
- Commit:
9439b99a9a4c551109d11217916f1d5118ca556d
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
avoid looping over SHA1Update() in got-fetch-pack; suggested by millert@
- Commit:
4231e6b557d72b2ae13ede2aecdd6391f271f25e
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got-fetch-pack: fix wrong memmove length leading to dubious checksum failures
ok millert tracey
- Commit:
b6b86fd1b9828e38d59915e62fddce62952b8b75
- From:
- Josiah Frentsos <jfrent@tilde.team>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
remove trailing whitespace; patch by Josiah Frentsos
- Commit:
717a78d4f87c3704afe34c77e211349932575d5b
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix snprintf error handling
follow the "proper secure idiom" described in the CAVEATS section of
printf(3). reminded by tb@ and millert@