Commit Briefs

Stefan Sperling

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.


Omar Polo

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@


Omar Polo

rename lib/sha1.c to lib/hash.c

It will soon grow functions to deal with sha256 too. stsp@ agrees.


Omar Polo

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>


Omar Polo

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@


Mark Jamsek

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@



Mark Jamsek

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@


Mark Jamsek

got: use intermediate pointers to plug leak on realloc

And save worktree_branch_len for reuse. ok stsp@ and op@


Stefan Sperling

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


Omar Polo

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@


Omar Polo

typo in comment

it serializes the struct got_imsg_tree_entry, not tree_object. grep aid.


Omar Polo

got_imsg_commit_object: use struct instead of buffer for id

ok stsp@


Omar Polo

got_imsg_object: use struct instead of buffer for id

ok stsp@


Omar Polo

got_imsg_send_remote_ref: use struct instead of buffer for id

ok stsp@