Commits
- Commit:
202f996b2931bb3d374f22e5162bfe3acebdea35
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
adjust min_datalen in a few places
Fix the computation of min_datalen that was forgotten in
8f137979fc5e284a136cf8950e8b3895d7ea208b.
got_privsep_recv_imsg() already takes care of converting
GOT_IMSG_ERROR to errors, so just how we didn't need to call
recv_imsg_error() at all, we don't need to include it in the requested
min_datalen.
- Commit:
b15057701186a99af7523319371ec7e0db9dd195
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
swap the order of the checks to not hide an error
If a libexec process returns an GOT_IMSG_ERROR that happens to be
smaller than the requested min_datalen, got_privsep_recv_imsg()
returns GOT_IMSG_PRIVSEP_LEN hiding the original error.
ok stsp@
- Commit:
54e38878133e773338308e227bc839a2515f14ba
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix invalid imsg_free() in got_privsep_recv_printed_commits()
Depending on the error got_privsep_recv_imsg() may leave imsg
un-initialized, so change it to always free the imsg on error if
needed, so callers don't have to.
got_privsep_recv_printed_commits() and got-read-patch were the only
places where we could end up calling imsg_free() on uninitialized
imsg, fix them.
ok stsp@
- Commit:
ceda7883426ddd62fbad61fd7b4855f18b7244ad
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix one error being ignored in got_privsep_recv_gitconfig_remotes
- Commit:
da3a2e80620226ae030a658f2034613a1d8debc9
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
don't ignore err in got_privsep_recv_painted_commits
- Commit:
3f69050e707b0f3c73aecf3053782433bc7b328b
- From:
- Kyle Ackerman <kackerman0102@gmail.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix memory leak on error in got_privsep_recv_painted_commits()
Diff from Kyle Ackerman, thank you!
I've added a imsg_free() call before the break too.
- Commit:
2c29eec0530d2a05c4729d8414aa3f3a6540971e
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
use ibuf_fd_set() instead of reaching into the ibuf struct
discussed with tb@
- Commit:
64c827b3c0cbf84a063d81619ae309a543511a82
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
don't redundantly set wbuf->fd to -1
ibuf_dynamic() (called by imsg_create()) already initializes fd to -1.
- Commit:
4772e63102e55e56d471f3f92e401821db956791
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix some fd leaks in error paths and avoid some double close
Sweep done after a few were spotted by tb@, thanks!
ok stsp@
- Commit:
a80c83ad3e4a8f4b5cc64106e5b128e667e0e06c
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
style
- Commit:
232c0ac1b26d38add9148b4e0382fc86c0cabd37
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
remove dependency of gitwrapper, gotctl, and gotsh on object_parse.c
Move some functions from object_parse.c into hash.c. These functions either
require hash.c code anyway or contain object ID implementation internals.
Add a new file object_qid.c, for got_object_id_queue and got_object_qid.
This new file must be linked to virtually every program.
- Commit:
a578d6ec6d3818f6a19379ef10e6def9dc71abb1
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
fix GOT_IMSG_COMMIT_TRAVERSAL_REQUEST
The sending and receiving side are sending the data differently. It
works now by chance since a struct got_object_id is "just" a
SHA1_DIGEST_LENGTH sized buffer, but will break in the future.
Furthermore, the structure of the data as described in got_lib_privsep.h
is not respected, as the path_len field is not transmitted.
Change it to send/receive a whole struct got_object_id, the path without
the NUL and the proper length. (The path is also actually mandatory, so
assert it too.)
improvements + 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:
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:
35cdfa2c870e6a3e81defeece73b69570753a845
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
use struct got_object_id instead of sha1 digest in a few imsg
change got_img_commit_painting_request, got_imsg_tag_object and the data
of GOT_IMSG_TRAVERSED_COMMITS not to copy the sha1 digest to the imsg
buffer and then from it to a new struct got_object_id but send directly
the whole struct.
ok stsp@
- 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:
11a2b20c6274fd87160362f39493d1b0b013e443
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
send_tree_entries: simplify len computing
- 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:
b091c2cda94edf2935404ce50aa5bccfcced54b6
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got-read-gitconfig: send key-value pairs for extensions
Most extension allow only for a boolean value so the current behaviour
of just sending the extension with a trueish value is fine. However,
some extensions that we could eventually support (like "objectformat")
have a string value. This is a preparatory step towards that.
ok stsp@
- Commit:
2be33b091701ba8292b338d88696867872304963
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
typo in comment
it serializes the struct got_imsg_tree_entry, not tree_object.
grep aid.
- Commit:
e4c85b49900b1c456739094cbe3af00249fa6029
- From:
- Omar Polo <op@omarpolo.com>
- Via:
- Thomas Adam <thomas@xteddy.org>
- Date:
got_imsg_commit_object: use struct instead of buffer for id
ok stsp@