Commits
- 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.
- Commit:
8f137979fc5e284a136cf8950e8b3895d7ea208b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
get rid of unneeded recv_imsg_error calls
got_privsep_recv_imsg users don't need to bother to look whether the
imsg type is GOT_IMSG_ERROR because got_privsep_recv_imsg already
takes care of that and turns GOT_IMSG_ERROR into `struct got_error's
automatically.
ok stsp@
- Commit:
80985c16b7649d82b559b180b486ac017c864e5a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
rework got_privesp_recv_tree to use got_privsep_recv_imsg
ok stsp@
- Commit:
d68f2c0e20f502d7bea2f0136527683f830b3d6c
- From:
- Josh Rickmar <jrick@zettaport.com>
- Date:
add signer_id option to got.conf(5)
Setting this option will cause 'got tag' to sign all created tags using
the SSH key, unless overridden by the -s flag.
ok stsp@
- Commit:
4d5ee9564a9e46a1f634f619833c62f636cfbdc1
- From:
- Josh Rickmar <jrick@zettaport.com>
- Date:
create and verify tags signed by SSH keys
This adds a new -s flag to 'got tag' that specifies the signer
identity (for example, a key file) of the tagger. The tag object will
include a signature that validates each of the tag object headers and
the tag message.
Verifying these signed tags requires maintaining an allowed signers
file which maps signer identities (i.e. the email address of the
tagger) to SSH public keys. See ssh-keygen(1) for more details of the
allowed signers file. After creating this file and providing the path
to it in got.conf(5) using the allowed_signers option, tags may be
verified using with 'got tag -V tag_name'. The return code will be
non-zero if a signature fails to verify.
ok stsp@
- Commit:
6c77e0337609d941281f017b3e0229ae45a35b7a
- From:
- Omar Polo <op@omarpolo.com>
- Date:
fix imsg_add TREE_ENTRY: Result too large on i386
There's a math error when computing the size of one entries in the
batching code. Reported by semarie, ok semarie stsp