Commit Graph

2863 Commits

Author SHA1 Message Date
Matthias Beyer b2a0758b1a Abort the execution of the UpdateHook if repo isnt dirty 2016-09-17 19:10:13 +02:00
Matthias Beyer eb378d47c2 Add helper fn to check whether the repository WD is dirty 2016-09-17 19:10:13 +02:00
Matthias Beyer db218cb3ee Merge pull request #736 from matthiasbeyer/libimagstorestdhook/git-docu
libimagstorestdhook/git docu
2016-09-17 17:15:10 +02:00
Matthias Beyer 182a3339c7 Merge pull request #735 from matthiasbeyer/libimagstorestdhook/git-remove-dead-code
Remove dead code: {Create,Retrieve}Hook implementation
2016-09-17 17:15:02 +02:00
Matthias Beyer 2a82762e9a Remove hook initialization from runtime setup
for hooks that are removed by the latest commit
2016-09-17 15:28:06 +02:00
Matthias Beyer 610a59a8d6 Add documentation for the UpdateHook implementation 2016-09-17 15:22:33 +02:00
Matthias Beyer ffcdd46fe7 Add documentation for the Runtime utility 2016-09-17 15:22:23 +02:00
Matthias Beyer 9d47664cc2 Add documentation for the configuration utilities 2016-09-17 15:22:13 +02:00
Matthias Beyer 62ad1d8071 Add documentation for the StoreAction util type 2016-09-17 15:22:04 +02:00
Matthias Beyer 32c6ab0aaa Remove dead code: {Create,Retrieve}Hook implementation 2016-09-17 15:06:30 +02:00
Matthias Beyer 18c2d75390 Merge pull request #731 from matthiasbeyer/libimagstorestdhook/git-remove-unused-imports
libimagstorestdhook: gi hooks:t remove unused imports
2016-09-11 08:23:47 +02:00
Matthias Beyer b1af5dc1d5 Remove unused imports: util module 2016-09-10 17:13:54 +02:00
Matthias Beyer 3cf6cc4506 Remove unused imports: Update hook 2016-09-10 17:13:35 +02:00
Matthias Beyer 412c4b5a30 Remove unused import: config module 2016-09-10 17:12:26 +02:00
Matthias Beyer 7f4108ad85 Remove unused imports: create hook 2016-09-10 17:11:45 +02:00
Matthias Beyer 931845105b runtime: Remove unused import Signature 2016-09-10 17:08:56 +02:00
Matthias Beyer cb41c0c416 Merge pull request #728 from matthiasbeyer/libimagstorestdhook/git-custom-commit-msg
Libimagstorestdhook/git custom commit msg
2016-09-10 14:07:03 +02:00
Matthias Beyer 41c7cd2363 [CHERRY-PICK] Add newline before header
The lastest release of the `toml-rs` crate (2.1) removes leading spaces
before arrays and tables, causing our tests to fail.

This fixes it.
2016-09-09 17:22:20 +02:00
Matthias Beyer 4b281dddc9 Implement editor calling 2016-09-09 16:34:19 +02:00
Matthias Beyer cc035525ec Add error kinds for editor calling 2016-09-09 16:34:19 +02:00
Matthias Beyer 995593a3b7 Add string input 2016-09-09 16:34:19 +02:00
Matthias Beyer 66d8b71bdf Add dep: libimaginteraction 2016-09-09 16:34:19 +02:00
Matthias Beyer 47c3d0e483 Implement commit_message() 2016-09-09 16:34:19 +02:00
Matthias Beyer 17805a0f1e Add default settings for committing in the update hook 2016-09-09 16:34:19 +02:00
Matthias Beyer 05d38bdf49 [CHERRY-PICK] Move edit_entry_with_cmd() to libimagutil 2016-09-09 16:34:19 +02:00
Matthias Beyer 8f26b20830 [CHERRY-PICK] Refactor edit_in_tmpfile()
To offer variant where we can pass the editor as command.
2016-09-08 18:03:26 +02:00
Matthias Beyer e49050932a Fix missing parentheses in impl Debug for UpdateHook 2016-09-08 16:53:12 +02:00
Matthias Beyer a24335c9a3 Merge pull request #723 from matthiasbeyer/libimagstorestdhook/git-ci-fixes
libimagstorestdhook: git ci fixes
2016-09-08 16:50:43 +02:00
Matthias Beyer 0dc2baaee2 Write index after committing 2016-09-08 14:23:10 +02:00
Matthias Beyer bee4c2002d Write the tree before finding the parent commits 2016-09-08 14:23:10 +02:00
Matthias Beyer 0366d0f8cb Add some debug output if commit worked 2016-09-08 14:23:10 +02:00
Matthias Beyer 0cfeda8652 We only need to pass the local part to git2 here 2016-09-08 14:23:10 +02:00
Matthias Beyer a4231ac5d8 Add debug output in UpdateHook::access() 2016-09-08 14:23:10 +02:00
Matthias Beyer 3252f9b751 Move Update-Hook execution into Store._update() 2016-09-08 14:23:10 +02:00
Matthias Beyer 8f01cf15e4 Move hook impl to update hook as Store::create() is lazy
As Store::create() is lazy and does not write to disk, we do not have a
file on disk when the post-create-hook runs.

Therefor, the implementation of the git logic has to be in the update
hook.
2016-09-08 14:23:10 +02:00
Matthias Beyer 157f4e79aa test setup: Prepare store directory before starting tests 2016-09-08 14:23:10 +02:00
Matthias Beyer 566c463383 Merge branch 'libimagstorestdhook/git-update' into libimagstorestdhook/git 2016-09-07 22:09:31 +02:00
Matthias Beyer 8d2c94b0b8 Merge branch 'libimagstorestdhook/git-refactor' into libimagstorestdhook/git-update 2016-09-07 22:09:19 +02:00
Matthias Beyer c19f269f59 Adapt ensure_cfg_branch_is_checked_out() for new Runtime::repository() interface 2016-09-07 22:06:07 +02:00
Matthias Beyer b50aacbf55 Move error output to Runtime::repository() getter 2016-09-07 22:06:07 +02:00
Matthias Beyer f86b450cfa Simplify error printing if config value fetching failed 2016-09-07 22:06:07 +02:00
Matthias Beyer 4e2a980599 Refactor Index fetching into helper function 2016-09-07 22:06:07 +02:00
Matthias Beyer 032110e6d8 Rewrite fetch_repo() so we have less overhead in calling this helper 2016-09-07 22:06:07 +02:00
Matthias Beyer ca47744108 Add StoreAction::uppercase() utility function
For debugging output convenience
2016-09-07 22:06:07 +02:00
Matthias Beyer 741ebff2da Outsource repository fetching into helper fn 2016-09-07 22:06:07 +02:00
Matthias Beyer fddd6ec4cb Remove unused fn: mkrepo() 2016-09-07 22:06:07 +02:00
Matthias Beyer 9c2f4db03d Remove unused fn: hasrepo() 2016-09-07 22:06:07 +02:00
Matthias Beyer 513a99fca7 Add initial implementation for UpdateHook 2016-09-07 22:05:50 +02:00
Matthias Beyer 6ef6262e54 Add error kind for parent fetching error 2016-09-07 22:05:50 +02:00
Matthias Beyer 242fa863b2 The helper commit_message() really should return an Result<String> 2016-09-07 22:05:50 +02:00