Commits
- Commit:
2f43cd698e3fcc3000262b3e0f3a2119f06345bb
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
47cb6f8b62ed4ad39838a5d4702f593b23d3e7f2
- From:
- Omar Polo <op@omarpolo.com>
- 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:
53bf0b541977b66862040d4b633fb6b5d3a3c6c8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
rename lib/sha1.c to lib/hash.c
It will soon grow functions to deal with sha256 too. stsp@ agrees.
- Commit:
5822e79e39a8777984e08b5d89a8c55d6aa0356d
- From:
- Omar Polo <op@omarpolo.com>
- 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:
076fbedce1fccdd95af706a8b068aa8a49c88165
- From:
- Omar Polo <op@omarpolo.com>
- 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:
118a625d39930284f891ea1285efc17fb3848cae
- From:
- Mark Jamsek <mark@jamsek.dev>
- 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:
ff08dcd6c83d27f29c7eb78f7b21fee64bebfdd2
- From:
- Omar Polo <op@omarpolo.com>
- Date:
send_tree_entries: simplify len computing
- Commit:
0dd7613ce65424868ec86f0623e38eb70d9a9321
- From:
- Mark Jamsek <mark@jamsek.dev>
- 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:
ec218e165dfd906f44ad491671127ca4b6979ed0
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
got: use intermediate pointers to plug leak on realloc
And save worktree_branch_len for reuse.
ok stsp@ and op@
- Commit:
188f8dcf2c1c15bf37859e3b587bc6331fd5a097
- From:
- Stefan Sperling <stsp@stsp.name>
- 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:
27749ea2ddbc482ad434ed865e0f855313db0a27
- From:
- Omar Polo <op@omarpolo.com>
- 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:
c4d35c5bb4f936d0f96bb62d234001b68dc33089
- From:
- Omar Polo <op@omarpolo.com>
- Date:
typo in comment
it serializes the struct got_imsg_tree_entry, not tree_object.
grep aid.
- Commit:
472dfe052943732fea89236959063c8ccdb769aa
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_commit_object: use struct instead of buffer for id
ok stsp@
- Commit:
7841c0d12f0a0e3f73db772df3b177a99ac0771f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_object: use struct instead of buffer for id
ok stsp@
- Commit:
427f294cd8765e673b3d562140ee3c5b895249fc
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_send_remote_ref: use struct instead of buffer for id
ok stsp@
- Commit:
5eb14fb9cee55bc3df623de8761d1e719ae697d4
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_send_ref: use struct instead of buffer for id
ok stsp@
- Commit:
0701e66c20d0558f1f7c72d7fb700be6fe376d3f
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_fetch_ref: use struct instead of buffer for id
ok stsp@
- Commit:
4b4da3bbc7a791ba0d7d9d369dfe1e7b65f7eed4
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_fetch_have_ref: use struct instead of buffer for id
ok stsp@
- Commit:
407521c004a585e93d6e493eb0d5193f67197edd
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_raw_delta: use struct instead of buffer for id
ok stsp@
- Commit:
babd9f5d19e75f2db561f5873c7acaf5f56c0480
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_raw_delta_request: use struct instead of buffer for id
ok stsp@
- Commit:
d283eca617a90979b34dc4892f2d632c8fcc080b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fmt
- Commit:
265df21f29865b8cc1eb0f0b93b8ca91ff134414
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got_imsg_packed_object: use struct instead of buffer for id
ok stsp@
- Commit:
00b3e9ae14f04a45f1ca7445bade6b41a6e8a1c5
- From:
- Omar Polo <op@omarpolo.com>
- Date:
replace malloc+memcpy with strndup. no functional change intended
ok stsp@
- Commit:
6242c45bf7571868b35d644cd0655d3b007d60c9
- From:
- Omar Polo <op@omarpolo.com>
- Date:
got send: show server error
Print the error message reported by the remote server when failing to
update a branch (for e.g. because of a server-side check.) Reported by
gonzalo@, with help and ok stsp@.
- Commit:
13b2bc374c1870ec27b2eeb40efe68fd465f64bb
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
introduce gotd(8), a Git repository server reachable via ssh(1)
This is an initial barebones implementation which provides the absolute
minimum of functionality required to serve got(1) and git(1) clients.
Basic fetch/send functionality has been tested and seems to work here,
but this server is not yet expected to be stable.
More testing is welcome. See the man pages for setup instructions.
The current design uses one reader and one writer process per repository,
which will have to be extended to N readers and N writers in the future.
At startup, each process will chroot(2) into its assigned repository.
This works because gotd(8) can only be started as root, and will then
fork+exec, chroot, and privdrop.
At present the parent process runs with the following pledge(2) promises:
"stdio rpath wpath cpath proc getpw sendfd recvfd fattr flock unix unveil"
The parent is the only process able to modify the repository in a way
that becomes visible to Git clients. The parent uses unveil(2) to
restrict its view of the filesystem to /tmp and the repositories
listed in the configuration file gotd.conf(5).
Per-repository chroot(2) processes use "stdio rpath sendfd recvfd".
The writer defers to the parent for modifying references in the
repository to point at newly uploaded commits. The reader is fine
without such help, because Git repositories can be read without
having to create any lock-files.
gotd(8) requires a dedicated user ID, which should own repositories
on the filesystem, and a separate secondary group, which should not
have filesystem-level repository access, and must be allowed access
to the gotd(8) socket.
To obtain Git repository access, users must be members of this
secondary group, and must have their login shell set to gotsh(1).
gotsh(1) connects to the gotd(8) socket and speaks Git-protocol
towards the client on the other end of the SSH connection.
gotsh(1) is not an interactive command shell.
At present, authenticated clients are granted read/write access to
all repositories and all references (except for the "refs/got/" and
the "refs/remotes/" namespaces, which are already being protected
from modification).
While complicated access control mechanism are not a design goal,
making it possible to safely offer anonymous Git repository access
over ssh(1) is on the road map.