Commits
- Commit:
0f8a0e25ffdf6a715f2a7528ef38eefaa474790a
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make output of 'got ref -l' more consistent
Ensure that got ref -l provides consistent output regardless of
whether references are packed or not.
Problem reported by naddy@
Also make 'got ref -l name' work consistently when the provided
argument is the name of a reference, rather than a ref-prefix.
ok naddy
- Commit:
c5d61cbc3a9c337b669af6b330709b6b4d43c872
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
speed up got tag -l by caching timestamps in got_ref_cmp_tags()
performance problem reported by naddy@
- Commit:
2f3ccc5ff648594ff13619e304c2a139a917f2d2
- From:
- Omar Polo <op@omarpolo.com>
- Date:
gather_on_disk_refs(): skip over bad refs
noticed since gotwebd fails when there's a ref.lock file due to a
concurrent update. discussed with stsp.
- Commit:
b54930d53597467f9112f45e9bfd192e352531ac
- From:
- Omar Polo <op@omarpolo.com>
- Date:
add got_repo_get_object_format()
and use it to avoid hardcoding the digest type in a few places.
ok stsp@
- Commit:
87a3ab84d3eb87b790e3d34aeec2c344a8d7375b
- From:
- Omar Polo <op@omarpolo.com>
- 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:
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:
faf5b56f3ad3ab701a16b6684c5f936210ff86f8
- From:
- Omar Polo <op@omarpolo.com>
- Date:
embed got_object_id instead of SHA1 hashes in references
ok stsp@
- Commit:
13e39a526914745e246b70efd87083d3097a31eb
- From:
- Omar Polo <op@omarpolo.com>
- Date:
zap empty line
- Commit:
b90054ed55f30ebe28115abf5ad9cecc2b925713
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use mkstemps(3) instead of mkstemp(3) for opening named temporary files
Allows 'got commit' to use a ".diff" suffix for temporary diff files.
ok op@
- 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:
15c388a9fbe0ca9bd3fba71581e55dd5ad6d8c33
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
check for unlink(2) errors and don't try to unlink an already renamed file
ok op@
- Commit:
a06ca3f74892062294f3752ab15a9e5d7778a106
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
check for unlink(2) errors with the == -1 idiom, rather than != 0
ok op@
- Commit:
3d8e0c5ede1a5654397b63a9f483d875543527d5
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
avoid a pointless malloc/free in got_reflist_insert() in my previous fix
suggested by op@
- Commit:
7db2b0ddc68d7d2761c2c1b93fa9543431efde97
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
detect packed vs. on-disk reference collision when listing refs
ok op@
- Commit:
c3821befbed0b67d1b48a5cfa3aaa2e022c58430
- From:
- Florian Obser <florian@narrans.de>
- Date:
Prevent use-after-free of packed_refs_path in error path.
Found by llvm's scan-build.
OK stsp
- Commit:
58e31a80da4f4a9e10eaea148672190f35107a47
- From:
- Omar Polo <op@omarpolo.com>
- Date:
build with -Wwrite-strings
Throwing this into the mix for a while, we can always get rid of it
again if it becomes annoying. No objections from stsp@
- Commit:
bb6672b6aba1cb45a10d52bec828e68379e9ad61
- From:
- Theo Buehler <tb@openbsd.org>
- Date:
make sure callers of got_object_idset_add() free data.
- Commit:
c0df59665de91324eeab1808c6c4e41343f21789
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
wrap overlong lines
- Commit:
00fe21f262ab567bb792120514b49b37236c5422
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add "e" (close-on-exec) flag to fopen(3) calls
suggested by millert
ok thomas_adam
- Commit:
428649877ce32ed472c8f2981ed805ec682732fd
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fall back to comparison by name when refs have the same timestamp
This fixes an issue where some references were missing from lists of
references sorted by timestamp.
- Commit:
2d4975924ce5391b01ebd64d11499b485e19aace
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
implement got_reflist_sort() which sorts a ref list in-place
- Commit:
0309152af410dec50680c7a54ae55ba8ebd7fcae
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix uninitialized error from got_ref_cmp_by_commit_timestamp_descending()
- Commit:
7f66531d28466880142708210643464d65b9b63b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
allow sorting references by timestamp in tog
- Commit:
2c9e323b3e6b33240740c40bbef58acdae141b56
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
speed up 'got histedit -l' and 'got rebase -l'
Cache commit timestamps in struct got_reference in case we are sorting
references by commit timestamp. This avoids opening and closing commits
every time we compare two references with each other.
ok thomas.adam