Commit graph

74 commits

Author SHA1 Message Date
d2a0e526da Remove an assert false, and silence warning 8 2024-12-19 15:05:48 +01:00
e342f8539a last_modified: don't find_blob; find the commit!
To get the last_modified timestamp we need the commit object not the
blob. This is closer to the old behavior.
2024-12-18 16:22:30 +01:00
3276c90b08 Adjust Git_kv.commit to report staging status
The implementation is a bit too naïve and will report the commit dirty
even when there are no staged changes. It only detects if we're inside a
`change_and_push`.
2024-11-28 12:33:49 +01:00
60795e65e2 Merge pull request 'add function: commit : t -> Digestif.SHA1.t option' (!6) from add-commit into main
Reviewed-on: #6
Reviewed-by: dinosaure <romain.calascibetta@gmail.com>
2024-11-28 10:44:14 +00:00
56eceb1ef2 add function: commit : t -> Digestif.SHA1.t option 2024-11-27 19:45:56 +01:00
bcd49ccfcf of_octets: create ring buffer earlier to avoid missing data 2024-11-20 10:32:27 +01:00
708cd7d008 add a comment 2024-10-29 12:25:08 +01:00
93bcbe576d only use a single commit in rename 2024-10-29 12:24:24 +01:00
0b330178e1 as suggested by @reynir @dinosaure, use a single Lwt_mutex.t 2024-10-29 11:51:55 +01:00
3cae0f7765 Use Lwt_{condition,mutex} instead of lwt tasks to serialize change_and_push 2024-10-29 11:09:53 +01:00
1327cc4f94 add comment about the reset of the waiter 2024-10-29 10:51:46 +01:00
931c0481d7 add task a task b task c test, and a fix 2024-10-29 10:44:49 +01:00
9afb8e29e2 Document change_and_push_waiter details 2024-10-29 10:10:17 +01:00
750ec11b5f remove superfluous assignment, spotted by @dinosaure 2024-10-29 09:50:53 +01:00
Robur Team
e91bd44cb8 Added tests for change_and_push and parallel modifications
Fixed last_modified (when running inside change_and_push),
and change_and_push.

Co-Authored-By: Reynir Björnsson <reynir@reynir.dk>
Co-Authored-By: Hannes Mehnert <hannes@mehnert.org>
2016-08-21 17:18:43 +02:00
4f93219f1d Read staged files 2024-10-25 13:03:30 +02:00
8c941e2431 Merge pull request 'Stream in/out the PACK file' (#33) from lwt-pause-and-stream into main
Reviewed-on: #33
2024-05-17 07:37:56 +00:00
105e35db9f digest: return the raw digest, not hex encoded 2024-05-07 12:42:12 +02:00
1315580463 Stream in/out the PACK file 2024-02-22 13:41:56 +01:00
948dfd81ba Merge pull request 'Add few Lwt.pause to give an opportunity for other processes to run' (#32) from pause into main
Reviewed-on: #32
2024-02-12 09:30:23 +00:00
cbfba38063 minor tweaks 2024-02-11 22:44:58 +01:00
1264fdad0a Add the compression level argument into to_octets 2024-02-11 22:44:58 +01:00
0832c0fde9 Add few Lwt.pause to give an opportunity for other processes to run 2024-02-11 12:35:57 +01:00
999e9d6968
Add the documentation about Git_kv.branch 2023-03-15 11:45:17 +01:00
a8ab45f2be
Add the branch accessor 2023-03-15 11:43:36 +01:00
f5fa3857c1 change_and_push: be able to specify author and message 2022-12-15 13:29:19 +01:00
d27fd751e1 support for mirage-kv 6.0.0 (#27)
Reviewed-on: https://git.robur.io/robur/git-kv/pulls/27
2022-12-14 15:43:09 +00:00
cb37018a84 avoid Result.get_ok, as suggested by @reynir, to preserve the error 2022-11-05 14:57:55 +01:00
45657fdf32 change_and_push may return an error, report it 2022-11-04 10:48:44 +01:00
8e14c13ddc use Git.Reference.main, avoid msgf binding only used once 2022-11-04 10:43:27 +01:00
8c7562ea16 avoid rresult, use result instead 2022-11-04 10:42:30 +01:00
6fdede7310 M-x whitespace-cleanup 2022-11-04 10:41:40 +01:00
2cfcb0a714 Rename batch to change_and_push (and implement batch as noop) 2022-10-31 18:13:15 +01:00
ed3bfa2dc3 Improve the documentation and the README.md 2022-10-31 16:47:52 +01:00
64fc2402ab Don't try to push if the tree_root still is the same
If the user just read into the batched function and does not change anything,
we just return the result.
2022-10-29 22:30:12 +02:00
b5fa25d9a5 Implement the batch function according to the documentation
This implementation is much more close to the documentation & fold all
changes into one commit. Then, it pushes this commit remotely. This
commit deleted local changes which complexify the codebase for a
questionable interest. As the documentation said, any changes are
delayed and not directly "committed" until the end of the given
function. For instance:
> batch
> set /bar "Bar"
> exists /bar
/bar does not exists

is an expected behavior. Only after a quit (which delimit the end of the
batch process), /bar will be committed and will exist!
2022-10-29 21:18:10 +02:00
e16dcce930 Rename batch to change_and_push and re-instantiate batch as a noop function 2022-10-28 16:38:32 +02:00
7b388c029a Use deepen according what we have.
If we have nothing, we just want the last commit, if we have something, we want
commits between what we have and what the server has. Then, we shallow
correctly our internal store to still keep only one commit.
2022-10-28 15:14:26 +02:00
993db937f8 Don't retry if push fail into the batch function 2022-10-28 14:14:40 +02:00
6bf4dc7f07 Improve the documentation 2022-10-28 11:56:11 +02:00
5aa887f48f Be sure to shallow to our last commit after a push from batch 2022-10-28 11:13:18 +02:00
d7765ff6aa Shallow only when we push 2022-10-28 10:59:27 +02:00
934ed7d960 Serialize sequence of batches operations 2022-10-28 10:49:59 +02:00
98bd2bfe3c Implement correctly a batch operation (which will push at the end of the given closure and provide a Local sub-module to be able to manipulate the Git repository without connections 2022-10-27 16:29:12 +02:00
30d5ad365a Complete the implementation with push and improve the documentation 2022-10-24 10:44:21 +02:00
d49a406691 Fix set and remove function 2022-10-22 00:46:33 +02:00
bc99b9d25f And don't forget to set the reference with the last commit 2022-10-22 00:35:41 +02:00
d1cfefb53b Implement {set,remove,rename}_and_push and delete push function
All of these actions "shallow" the last commit. A subsequent `push`
will do nothing due to that incapacity to walk through the history
due to the shallowed commit. To be able to push the last change,
we must provide {set,remove,rename} functions with an explicit
call to push **before** the "shallow".
2022-10-22 00:18:01 +02:00
da5ed53013 Fix bad bytes when we want to emit an empty PACK file 2022-10-21 16:36:55 +02:00
c4012613e3 Delete an assert false and replace it by an empty PACK file 2022-10-21 16:24:10 +02:00