loggable_activity 0.5.6 → 0.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/GETTING-STARTED.md +1 -0
- data/docker-compose.yml +27 -0
- data/docs/CHANGELOG_md.html +318 -0
- data/docs/CHEAT_SHEET_md.html +168 -0
- data/docs/CODE_OF_CONDUCT_md.html +250 -0
- data/docs/CreateLoggableActivities.html +175 -0
- data/docs/CreateLoggableActivityTables.html +173 -0
- data/docs/GETTING-STARTED_md.html +211 -0
- data/docs/Gemfile.html +153 -0
- data/docs/Gemfile_lock.html +438 -0
- data/docs/LoggableActivity/ActivitiesController.html +160 -0
- data/docs/LoggableActivity/ActivitiesHelper.html +158 -0
- data/docs/LoggableActivity/Activity.html +565 -0
- data/docs/LoggableActivity/ApplicationController.html +97 -0
- data/docs/LoggableActivity/ApplicationHelper.html +91 -0
- data/docs/LoggableActivity/ApplicationJob.html +97 -0
- data/docs/LoggableActivity/ApplicationMailer.html +97 -0
- data/docs/LoggableActivity/ApplicationRecord.html +97 -0
- data/docs/LoggableActivity/Configuration.html +237 -0
- data/docs/LoggableActivity/ConfigurationError.html +142 -0
- data/docs/LoggableActivity/CurrentActor.html +166 -0
- data/docs/LoggableActivity/DataOwner.html +138 -0
- data/docs/LoggableActivity/Encryption.html +321 -0
- data/docs/LoggableActivity/EncryptionError.html +142 -0
- data/docs/LoggableActivity/EncryptionKey.html +399 -0
- data/docs/LoggableActivity/Engine.html +108 -0
- data/docs/LoggableActivity/Error.html +142 -0
- data/docs/LoggableActivity/Generators/InstallGenerator.html +212 -0
- data/docs/LoggableActivity/Generators.html +91 -0
- data/docs/LoggableActivity/Hooks.html +841 -0
- data/docs/LoggableActivity/Payload.html +430 -0
- data/docs/LoggableActivity/Sanitizer.html +134 -0
- data/docs/LoggableActivity/Services/BasePayloadsBuilder.html +472 -0
- data/docs/LoggableActivity/Services/CustomPayloadsBuilder.html +225 -0
- data/docs/LoggableActivity/Services/DestroyPayloadsBuilder.html +396 -0
- data/docs/LoggableActivity/Services/PayloadsBuilder.html +348 -0
- data/docs/LoggableActivity/Services/UpdatePayloadsBuilder.html +540 -0
- data/docs/LoggableActivity/Services.html +93 -0
- data/docs/LoggableActivity.html +173 -0
- data/docs/MIT-LICENSE.html +132 -0
- data/docs/Object.html +110 -0
- data/docs/README_md.html +186 -0
- data/docs/Rakefile.html +134 -0
- data/docs/app/assets/config/loggable_activity_manifest_js.html +126 -0
- data/docs/app/assets/javascripts/loggable_activity/application_js.html +124 -0
- data/docs/app/assets/stylesheets/loggable_activity/activities_scss.html +154 -0
- data/docs/app/assets/stylesheets/loggable_activity/application_scss.html +142 -0
- data/docs/app/views/layouts/loggable_activity/application_html_slim.html +145 -0
- data/docs/app/views/loggable_activity/activities/_activities_html_slim.html +159 -0
- data/docs/created.rid +74 -0
- data/docs/css/fonts.css +167 -0
- data/docs/css/rdoc.css +687 -0
- data/docs/fonts/Lato-Light.ttf +0 -0
- data/docs/fonts/Lato-LightItalic.ttf +0 -0
- data/docs/fonts/Lato-Regular.ttf +0 -0
- data/docs/fonts/Lato-RegularItalic.ttf +0 -0
- data/docs/fonts/SourceCodePro-Bold.ttf +0 -0
- data/docs/fonts/SourceCodePro-Regular.ttf +0 -0
- data/docs/git-org/HEAD.html +126 -0
- data/docs/git-org/config.html +128 -0
- data/docs/git-org/description.html +126 -0
- data/docs/git-org/hooks/applypatch-msg_sample.html +128 -0
- data/docs/git-org/hooks/commit-msg_sample.html +138 -0
- data/docs/git-org/hooks/fsmonitor-watchman_sample.html +302 -0
- data/docs/git-org/hooks/post-update_sample.html +128 -0
- data/docs/git-org/hooks/pre-applypatch_sample.html +128 -0
- data/docs/git-org/hooks/pre-commit_sample.html +174 -0
- data/docs/git-org/hooks/pre-merge-commit_sample.html +133 -0
- data/docs/git-org/hooks/pre-push_sample.html +161 -0
- data/docs/git-org/hooks/pre-rebase_sample.html +282 -0
- data/docs/git-org/hooks/pre-receive_sample.html +144 -0
- data/docs/git-org/hooks/prepare-commit-msg_sample.html +136 -0
- data/docs/git-org/hooks/push-to-checkout_sample.html +178 -0
- data/docs/git-org/hooks/update_sample.html +226 -0
- data/docs/git-org/info/exclude.html +126 -0
- data/docs/images/add.png +0 -0
- data/docs/images/arrow_up.png +0 -0
- data/docs/images/brick.png +0 -0
- data/docs/images/brick_link.png +0 -0
- data/docs/images/bug.png +0 -0
- data/docs/images/bullet_black.png +0 -0
- data/docs/images/bullet_toggle_minus.png +0 -0
- data/docs/images/bullet_toggle_plus.png +0 -0
- data/docs/images/date.png +0 -0
- data/docs/images/delete.png +0 -0
- data/docs/images/find.png +0 -0
- data/docs/images/loadingAnimation.gif +0 -0
- data/docs/images/macFFBgHack.png +0 -0
- data/docs/images/package.png +0 -0
- data/docs/images/page_green.png +0 -0
- data/docs/images/page_white_text.png +0 -0
- data/docs/images/page_white_width.png +0 -0
- data/docs/images/plugin.png +0 -0
- data/docs/images/ruby.png +0 -0
- data/docs/images/tag_blue.png +0 -0
- data/docs/images/tag_green.png +0 -0
- data/docs/images/transparent.png +0 -0
- data/docs/images/wrench.png +0 -0
- data/docs/images/wrench_orange.png +0 -0
- data/docs/images/zoom.png +0 -0
- data/docs/index.html +166 -0
- data/docs/js/darkfish.js +97 -0
- data/docs/js/navigation.js +105 -0
- data/docs/js/navigation.js.gz +0 -0
- data/docs/js/search.js +110 -0
- data/docs/js/search_index.js +1 -0
- data/docs/js/search_index.js.gz +0 -0
- data/docs/js/searcher.js +229 -0
- data/docs/js/searcher.js.gz +0 -0
- data/docs/lib/loggable_activity/config_schema_json.html +205 -0
- data/docs/lib/tasks/loggable_activity_tasks_rake.html +128 -0
- data/docs/table_of_contents.html +954 -0
- data/lib/loggable_activity/concerns/current_actor.rb +25 -0
- data/lib/loggable_activity/hooks.rb +41 -19
- data/lib/loggable_activity/version.rb +1 -1
- data/lib/loggable_activity.rb +1 -1
- metadata +114 -3
- data/lib/loggable_activity/concerns/current_user.rb +0 -26
@@ -0,0 +1,138 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>commit-msg.sample - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="file">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="project-metadata">
|
59
|
+
|
60
|
+
<div id="fileindex-section" class="nav-section">
|
61
|
+
<h3>Pages</h3>
|
62
|
+
|
63
|
+
<ul class="link-list">
|
64
|
+
<li><a href="../../CHANGELOG_md.html">CHANGELOG</a>
|
65
|
+
<li><a href="../../CHEAT_SHEET_md.html">CHEAT_SHEET</a>
|
66
|
+
<li><a href="../../CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
67
|
+
<li><a href="../../GETTING-STARTED_md.html">GETTING-STARTED</a>
|
68
|
+
<li><a href="../../Gemfile.html">Gemfile</a>
|
69
|
+
<li><a href="../../Gemfile_lock.html">Gemfile.lock</a>
|
70
|
+
<li><a href="../../MIT-LICENSE.html">MIT-LICENSE</a>
|
71
|
+
<li><a href="../../README_md.html">README</a>
|
72
|
+
<li><a href="../../Rakefile.html">Rakefile</a>
|
73
|
+
<li><details><summary>app</summary>
|
74
|
+
<ul class="link-list">
|
75
|
+
<li><a href="../../app/assets/config/loggable_activity_manifest_js.html">loggable_activity_manifest.js</a>
|
76
|
+
<li><a href="../../app/assets/javascripts/loggable_activity/application_js.html">application.js</a>
|
77
|
+
<li><a href="../../app/assets/stylesheets/loggable_activity/activities_scss.html">activities.scss</a>
|
78
|
+
<li><a href="../../app/assets/stylesheets/loggable_activity/application_scss.html">application.scss</a>
|
79
|
+
<li><a href="../../app/views/layouts/loggable_activity/application_html_slim.html">application.html.slim</a>
|
80
|
+
<li><a href="../../app/views/loggable_activity/activities/_activities_html_slim.html">_activities.html.slim</a>
|
81
|
+
</ul></details>
|
82
|
+
<li><details open><summary>git-org</summary>
|
83
|
+
<ul class="link-list">
|
84
|
+
<li><a href="../../git-org/HEAD.html">HEAD</a>
|
85
|
+
<li><a href="../../git-org/config.html">config</a>
|
86
|
+
<li><a href="../../git-org/description.html">description</a>
|
87
|
+
<li><a href="../../git-org/hooks/applypatch-msg_sample.html">applypatch-msg.sample</a>
|
88
|
+
<li><a href="../../git-org/hooks/commit-msg_sample.html">commit-msg.sample</a>
|
89
|
+
<li><a href="../../git-org/hooks/fsmonitor-watchman_sample.html">fsmonitor-watchman.sample</a>
|
90
|
+
<li><a href="../../git-org/hooks/post-update_sample.html">post-update.sample</a>
|
91
|
+
<li><a href="../../git-org/hooks/pre-applypatch_sample.html">pre-applypatch.sample</a>
|
92
|
+
<li><a href="../../git-org/hooks/pre-commit_sample.html">pre-commit.sample</a>
|
93
|
+
<li><a href="../../git-org/hooks/pre-merge-commit_sample.html">pre-merge-commit.sample</a>
|
94
|
+
<li><a href="../../git-org/hooks/pre-push_sample.html">pre-push.sample</a>
|
95
|
+
<li><a href="../../git-org/hooks/pre-rebase_sample.html">pre-rebase.sample</a>
|
96
|
+
<li><a href="../../git-org/hooks/pre-receive_sample.html">pre-receive.sample</a>
|
97
|
+
<li><a href="../../git-org/hooks/prepare-commit-msg_sample.html">prepare-commit-msg.sample</a>
|
98
|
+
<li><a href="../../git-org/hooks/push-to-checkout_sample.html">push-to-checkout.sample</a>
|
99
|
+
<li><a href="../../git-org/hooks/update_sample.html">update.sample</a>
|
100
|
+
<li><a href="../../git-org/info/exclude.html">exclude</a>
|
101
|
+
</ul></details>
|
102
|
+
<li><details><summary>lib</summary>
|
103
|
+
<ul class="link-list">
|
104
|
+
<li><a href="../../lib/loggable_activity/config_schema_json.html">config_schema.json</a>
|
105
|
+
<li><a href="../../lib/tasks/loggable_activity_tasks_rake.html">loggable_activity_tasks.rake</a>
|
106
|
+
</ul></details>
|
107
|
+
</ul>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
<main role="main" aria-label="Page git-org/hooks/commit-msg.sample">
|
114
|
+
|
115
|
+
<p>!/bin/sh # # An example hook script to check the commit log message. # Called by “git commit” with one argument, the name of the file # that has the commit message. The hook should exit with non-zero # status after issuing an appropriate message if it wants to stop the # commit. The hook is allowed to edit the commit message file. # # To enable this hook, rename this file to “commit-msg”.</p>
|
116
|
+
|
117
|
+
<p># Uncomment the below to add a Signed-off-by line to the message. # Doing this in a hook is a bad idea in general, but the prepare-commit-msg # hook is more suited to it. # # SOB=$(git var GIT_AUTHOR_IDENT | sed -n ‘s/^(.*>).*$/Signed-off-by: 1/p’) # grep -qs “^$SOB” “$1” || echo “$SOB” >> “$1”</p>
|
118
|
+
|
119
|
+
<p># This example catches duplicate Signed-off-by lines.</p>
|
120
|
+
|
121
|
+
<p>test “” = “$(grep ‘^Signed-off-by: ’ ”$1“ |</p>
|
122
|
+
|
123
|
+
<pre> sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
|
124
|
+
echo >&2 Duplicate Signed-off-by lines.
|
125
|
+
exit 1</pre>
|
126
|
+
|
127
|
+
<p>}</p>
|
128
|
+
|
129
|
+
</main>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<footer id="validator-badges" role="contentinfo">
|
134
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
135
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
136
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
137
|
+
</footer>
|
138
|
+
|
@@ -0,0 +1,302 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>fsmonitor-watchman.sample - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="file">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="project-metadata">
|
59
|
+
|
60
|
+
<div id="fileindex-section" class="nav-section">
|
61
|
+
<h3>Pages</h3>
|
62
|
+
|
63
|
+
<ul class="link-list">
|
64
|
+
<li><a href="../../CHANGELOG_md.html">CHANGELOG</a>
|
65
|
+
<li><a href="../../CHEAT_SHEET_md.html">CHEAT_SHEET</a>
|
66
|
+
<li><a href="../../CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
67
|
+
<li><a href="../../GETTING-STARTED_md.html">GETTING-STARTED</a>
|
68
|
+
<li><a href="../../Gemfile.html">Gemfile</a>
|
69
|
+
<li><a href="../../Gemfile_lock.html">Gemfile.lock</a>
|
70
|
+
<li><a href="../../MIT-LICENSE.html">MIT-LICENSE</a>
|
71
|
+
<li><a href="../../README_md.html">README</a>
|
72
|
+
<li><a href="../../Rakefile.html">Rakefile</a>
|
73
|
+
<li><details><summary>app</summary>
|
74
|
+
<ul class="link-list">
|
75
|
+
<li><a href="../../app/assets/config/loggable_activity_manifest_js.html">loggable_activity_manifest.js</a>
|
76
|
+
<li><a href="../../app/assets/javascripts/loggable_activity/application_js.html">application.js</a>
|
77
|
+
<li><a href="../../app/assets/stylesheets/loggable_activity/activities_scss.html">activities.scss</a>
|
78
|
+
<li><a href="../../app/assets/stylesheets/loggable_activity/application_scss.html">application.scss</a>
|
79
|
+
<li><a href="../../app/views/layouts/loggable_activity/application_html_slim.html">application.html.slim</a>
|
80
|
+
<li><a href="../../app/views/loggable_activity/activities/_activities_html_slim.html">_activities.html.slim</a>
|
81
|
+
</ul></details>
|
82
|
+
<li><details open><summary>git-org</summary>
|
83
|
+
<ul class="link-list">
|
84
|
+
<li><a href="../../git-org/HEAD.html">HEAD</a>
|
85
|
+
<li><a href="../../git-org/config.html">config</a>
|
86
|
+
<li><a href="../../git-org/description.html">description</a>
|
87
|
+
<li><a href="../../git-org/hooks/applypatch-msg_sample.html">applypatch-msg.sample</a>
|
88
|
+
<li><a href="../../git-org/hooks/commit-msg_sample.html">commit-msg.sample</a>
|
89
|
+
<li><a href="../../git-org/hooks/fsmonitor-watchman_sample.html">fsmonitor-watchman.sample</a>
|
90
|
+
<li><a href="../../git-org/hooks/post-update_sample.html">post-update.sample</a>
|
91
|
+
<li><a href="../../git-org/hooks/pre-applypatch_sample.html">pre-applypatch.sample</a>
|
92
|
+
<li><a href="../../git-org/hooks/pre-commit_sample.html">pre-commit.sample</a>
|
93
|
+
<li><a href="../../git-org/hooks/pre-merge-commit_sample.html">pre-merge-commit.sample</a>
|
94
|
+
<li><a href="../../git-org/hooks/pre-push_sample.html">pre-push.sample</a>
|
95
|
+
<li><a href="../../git-org/hooks/pre-rebase_sample.html">pre-rebase.sample</a>
|
96
|
+
<li><a href="../../git-org/hooks/pre-receive_sample.html">pre-receive.sample</a>
|
97
|
+
<li><a href="../../git-org/hooks/prepare-commit-msg_sample.html">prepare-commit-msg.sample</a>
|
98
|
+
<li><a href="../../git-org/hooks/push-to-checkout_sample.html">push-to-checkout.sample</a>
|
99
|
+
<li><a href="../../git-org/hooks/update_sample.html">update.sample</a>
|
100
|
+
<li><a href="../../git-org/info/exclude.html">exclude</a>
|
101
|
+
</ul></details>
|
102
|
+
<li><details><summary>lib</summary>
|
103
|
+
<ul class="link-list">
|
104
|
+
<li><a href="../../lib/loggable_activity/config_schema_json.html">config_schema.json</a>
|
105
|
+
<li><a href="../../lib/tasks/loggable_activity_tasks_rake.html">loggable_activity_tasks.rake</a>
|
106
|
+
</ul></details>
|
107
|
+
</ul>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
<main role="main" aria-label="Page git-org/hooks/fsmonitor-watchman.sample">
|
114
|
+
|
115
|
+
<p>!/usr/bin/perl</p>
|
116
|
+
|
117
|
+
<p>use strict; use warnings; use IPC::Open2;</p>
|
118
|
+
|
119
|
+
<p># An example hook script to integrate Watchman # (<a href="https://facebook.github.io/watchman">facebook.github.io/watchman</a>/) with git to speed up detecting # new and modified files. # # The hook is passed a version (currently 2) and last update token # formatted as a string and outputs to stdout a new update token and # all files that have been modified since the update token. Paths must # be relative to the root of the working tree and separated by a single NUL. # # To enable this hook, rename this file to “query-watchman” and set # ‘git config core.fsmonitor .git/hooks/query-watchman’ # my ($version, $last_update_token) = @ARGV;</p>
|
120
|
+
|
121
|
+
<p># Uncomment for debugging # print STDERR “$0 $version $last_update_tokenn”;</p>
|
122
|
+
|
123
|
+
<p># Check the hook interface version if ($version ne 2) {</p>
|
124
|
+
|
125
|
+
<pre>die "Unsupported query-fsmonitor hook version '$version'.\n" .
|
126
|
+
"Falling back to scanning...\n";</pre>
|
127
|
+
|
128
|
+
<p>}</p>
|
129
|
+
|
130
|
+
<p>my $git_work_tree = get_working_dir();</p>
|
131
|
+
|
132
|
+
<p>my $retry = 1;</p>
|
133
|
+
|
134
|
+
<p>my $json_pkg; eval {</p>
|
135
|
+
|
136
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">XS</span>;
|
137
|
+
<span class="ruby-identifier">$json_pkg</span> = <span class="ruby-string">"JSON::XS"</span>;
|
138
|
+
<span class="ruby-value">1</span>;
|
139
|
+
</pre>
|
140
|
+
|
141
|
+
<p>} or do {</p>
|
142
|
+
|
143
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-constant">JSON</span><span class="ruby-operator">::</span><span class="ruby-constant">PP</span>;
|
144
|
+
<span class="ruby-identifier">$json_pkg</span> = <span class="ruby-string">"JSON::PP"</span>;
|
145
|
+
</pre>
|
146
|
+
|
147
|
+
<p>};</p>
|
148
|
+
|
149
|
+
<p>launch_watchman();</p>
|
150
|
+
|
151
|
+
<p>sub launch_watchman {</p>
|
152
|
+
|
153
|
+
<pre>my $o = watchman_query();
|
154
|
+
if (is_work_tree_watched($o)) {
|
155
|
+
output_result($o->{clock}, @{$o->{files}});
|
156
|
+
}</pre>
|
157
|
+
|
158
|
+
<p>}</p>
|
159
|
+
|
160
|
+
<p>sub output_result {</p>
|
161
|
+
|
162
|
+
<pre>my ($clockid, @files) = @_;
|
163
|
+
|
164
|
+
# Uncomment for debugging watchman output
|
165
|
+
# open (my $fh, ">", ".git/watchman-output.out");
|
166
|
+
# binmode $fh, ":utf8";
|
167
|
+
# print $fh "$clockid\n@files\n";
|
168
|
+
# close $fh;
|
169
|
+
|
170
|
+
binmode STDOUT, ":utf8";
|
171
|
+
print $clockid;
|
172
|
+
print "\0";
|
173
|
+
local $, = "\0";
|
174
|
+
print @files;</pre>
|
175
|
+
|
176
|
+
<p>}</p>
|
177
|
+
|
178
|
+
<p>sub watchman_clock {</p>
|
179
|
+
|
180
|
+
<pre>my $response = qx/watchman clock "$git_work_tree"/;
|
181
|
+
die "Failed to get clock id on '$git_work_tree'.\n" .
|
182
|
+
"Falling back to scanning...\n" if $? != 0;
|
183
|
+
|
184
|
+
return $json_pkg->new->utf8->decode($response);</pre>
|
185
|
+
|
186
|
+
<p>}</p>
|
187
|
+
|
188
|
+
<p>sub watchman_query {</p>
|
189
|
+
|
190
|
+
<pre>my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty')
|
191
|
+
or die "open2() failed: $!\n" .
|
192
|
+
"Falling back to scanning...\n";
|
193
|
+
|
194
|
+
# In the query expression below we're asking for names of files that
|
195
|
+
# changed since $last_update_token but not from the .git folder.
|
196
|
+
#
|
197
|
+
# To accomplish this, we're using the "since" generator to use the
|
198
|
+
# recency index to select candidate nodes and "fields" to limit the
|
199
|
+
# output to file names only. Then we're using the "expression" term to
|
200
|
+
# further constrain the results.
|
201
|
+
my $last_update_line = "";
|
202
|
+
if (substr($last_update_token, 0, 1) eq "c") {
|
203
|
+
$last_update_token = "\"$last_update_token\"";
|
204
|
+
$last_update_line = qq[\n"since": $last_update_token,];
|
205
|
+
}
|
206
|
+
my $query = <<" END";
|
207
|
+
["query", "$git_work_tree", {$last_update_line
|
208
|
+
"fields": ["name"],
|
209
|
+
"expression": ["not", ["dirname", ".git"]]
|
210
|
+
}]
|
211
|
+
END
|
212
|
+
|
213
|
+
# Uncomment for debugging the watchman query
|
214
|
+
# open (my $fh, ">", ".git/watchman-query.json");
|
215
|
+
# print $fh $query;
|
216
|
+
# close $fh;
|
217
|
+
|
218
|
+
print CHLD_IN $query;
|
219
|
+
close CHLD_IN;
|
220
|
+
my $response = do {local $/; <CHLD_OUT>};
|
221
|
+
|
222
|
+
# Uncomment for debugging the watch response
|
223
|
+
# open ($fh, ">", ".git/watchman-response.json");
|
224
|
+
# print $fh $response;
|
225
|
+
# close $fh;
|
226
|
+
|
227
|
+
die "Watchman: command returned no output.\n" .
|
228
|
+
"Falling back to scanning...\n" if $response eq "";
|
229
|
+
die "Watchman: command returned invalid output: $response\n" .
|
230
|
+
"Falling back to scanning...\n" unless $response =~ /^\{/;
|
231
|
+
|
232
|
+
return $json_pkg->new->utf8->decode($response);</pre>
|
233
|
+
|
234
|
+
<p>}</p>
|
235
|
+
|
236
|
+
<p>sub is_work_tree_watched {</p>
|
237
|
+
|
238
|
+
<pre>my ($output) = @_;
|
239
|
+
my $error = $output->{error};
|
240
|
+
if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
|
241
|
+
$retry--;
|
242
|
+
my $response = qx/watchman watch "$git_work_tree"/;
|
243
|
+
die "Failed to make watchman watch '$git_work_tree'.\n" .
|
244
|
+
"Falling back to scanning...\n" if $? != 0;
|
245
|
+
$output = $json_pkg->new->utf8->decode($response);
|
246
|
+
$error = $output->{error};
|
247
|
+
die "Watchman: $error.\n" .
|
248
|
+
"Falling back to scanning...\n" if $error;
|
249
|
+
|
250
|
+
# Uncomment for debugging watchman output
|
251
|
+
# open (my $fh, ">", ".git/watchman-output.out");
|
252
|
+
# close $fh;
|
253
|
+
|
254
|
+
# Watchman will always return all files on the first query so
|
255
|
+
# return the fast "everything is dirty" flag to git and do the
|
256
|
+
# Watchman query just to get it over with now so we won't pay
|
257
|
+
# the cost in git to look up each individual file.
|
258
|
+
my $o = watchman_clock();
|
259
|
+
$error = $output->{error};
|
260
|
+
|
261
|
+
die "Watchman: $error.\n" .
|
262
|
+
"Falling back to scanning...\n" if $error;
|
263
|
+
|
264
|
+
output_result($o->{clock}, ("/"));
|
265
|
+
$last_update_token = $o->{clock};
|
266
|
+
|
267
|
+
eval { launch_watchman() };
|
268
|
+
return 0;
|
269
|
+
}
|
270
|
+
|
271
|
+
die "Watchman: $error.\n" .
|
272
|
+
"Falling back to scanning...\n" if $error;
|
273
|
+
|
274
|
+
return 1;</pre>
|
275
|
+
|
276
|
+
<p>}</p>
|
277
|
+
|
278
|
+
<p>sub get_working_dir {</p>
|
279
|
+
|
280
|
+
<pre>my $working_dir;
|
281
|
+
if ($^O =~ 'msys' || $^O =~ 'cygwin') {
|
282
|
+
$working_dir = Win32::GetCwd();
|
283
|
+
$working_dir =~ tr/\\/\//;
|
284
|
+
} else {
|
285
|
+
require Cwd;
|
286
|
+
$working_dir = Cwd::cwd();
|
287
|
+
}
|
288
|
+
|
289
|
+
return $working_dir;</pre>
|
290
|
+
|
291
|
+
<p>}</p>
|
292
|
+
|
293
|
+
</main>
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
<footer id="validator-badges" role="contentinfo">
|
298
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
299
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
300
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
301
|
+
</footer>
|
302
|
+
|
@@ -0,0 +1,128 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>post-update.sample - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<script type="text/javascript">
|
10
|
+
var rdoc_rel_prefix = "../../";
|
11
|
+
var index_rel_prefix = "../../";
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<script src="../../js/navigation.js" defer></script>
|
15
|
+
<script src="../../js/search.js" defer></script>
|
16
|
+
<script src="../../js/search_index.js" defer></script>
|
17
|
+
<script src="../../js/searcher.js" defer></script>
|
18
|
+
<script src="../../js/darkfish.js" defer></script>
|
19
|
+
|
20
|
+
<link href="../../css/fonts.css" rel="stylesheet">
|
21
|
+
<link href="../../css/rdoc.css" rel="stylesheet">
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="file">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<div id="table-of-contents-navigation">
|
33
|
+
<a href="../../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../../table_of_contents.html#methods">Methods</a>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" class="initially-hidden"></ul>
|
51
|
+
</form>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
</div>
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
<div id="project-metadata">
|
59
|
+
|
60
|
+
<div id="fileindex-section" class="nav-section">
|
61
|
+
<h3>Pages</h3>
|
62
|
+
|
63
|
+
<ul class="link-list">
|
64
|
+
<li><a href="../../CHANGELOG_md.html">CHANGELOG</a>
|
65
|
+
<li><a href="../../CHEAT_SHEET_md.html">CHEAT_SHEET</a>
|
66
|
+
<li><a href="../../CODE_OF_CONDUCT_md.html">CODE_OF_CONDUCT</a>
|
67
|
+
<li><a href="../../GETTING-STARTED_md.html">GETTING-STARTED</a>
|
68
|
+
<li><a href="../../Gemfile.html">Gemfile</a>
|
69
|
+
<li><a href="../../Gemfile_lock.html">Gemfile.lock</a>
|
70
|
+
<li><a href="../../MIT-LICENSE.html">MIT-LICENSE</a>
|
71
|
+
<li><a href="../../README_md.html">README</a>
|
72
|
+
<li><a href="../../Rakefile.html">Rakefile</a>
|
73
|
+
<li><details><summary>app</summary>
|
74
|
+
<ul class="link-list">
|
75
|
+
<li><a href="../../app/assets/config/loggable_activity_manifest_js.html">loggable_activity_manifest.js</a>
|
76
|
+
<li><a href="../../app/assets/javascripts/loggable_activity/application_js.html">application.js</a>
|
77
|
+
<li><a href="../../app/assets/stylesheets/loggable_activity/activities_scss.html">activities.scss</a>
|
78
|
+
<li><a href="../../app/assets/stylesheets/loggable_activity/application_scss.html">application.scss</a>
|
79
|
+
<li><a href="../../app/views/layouts/loggable_activity/application_html_slim.html">application.html.slim</a>
|
80
|
+
<li><a href="../../app/views/loggable_activity/activities/_activities_html_slim.html">_activities.html.slim</a>
|
81
|
+
</ul></details>
|
82
|
+
<li><details open><summary>git-org</summary>
|
83
|
+
<ul class="link-list">
|
84
|
+
<li><a href="../../git-org/HEAD.html">HEAD</a>
|
85
|
+
<li><a href="../../git-org/config.html">config</a>
|
86
|
+
<li><a href="../../git-org/description.html">description</a>
|
87
|
+
<li><a href="../../git-org/hooks/applypatch-msg_sample.html">applypatch-msg.sample</a>
|
88
|
+
<li><a href="../../git-org/hooks/commit-msg_sample.html">commit-msg.sample</a>
|
89
|
+
<li><a href="../../git-org/hooks/fsmonitor-watchman_sample.html">fsmonitor-watchman.sample</a>
|
90
|
+
<li><a href="../../git-org/hooks/post-update_sample.html">post-update.sample</a>
|
91
|
+
<li><a href="../../git-org/hooks/pre-applypatch_sample.html">pre-applypatch.sample</a>
|
92
|
+
<li><a href="../../git-org/hooks/pre-commit_sample.html">pre-commit.sample</a>
|
93
|
+
<li><a href="../../git-org/hooks/pre-merge-commit_sample.html">pre-merge-commit.sample</a>
|
94
|
+
<li><a href="../../git-org/hooks/pre-push_sample.html">pre-push.sample</a>
|
95
|
+
<li><a href="../../git-org/hooks/pre-rebase_sample.html">pre-rebase.sample</a>
|
96
|
+
<li><a href="../../git-org/hooks/pre-receive_sample.html">pre-receive.sample</a>
|
97
|
+
<li><a href="../../git-org/hooks/prepare-commit-msg_sample.html">prepare-commit-msg.sample</a>
|
98
|
+
<li><a href="../../git-org/hooks/push-to-checkout_sample.html">push-to-checkout.sample</a>
|
99
|
+
<li><a href="../../git-org/hooks/update_sample.html">update.sample</a>
|
100
|
+
<li><a href="../../git-org/info/exclude.html">exclude</a>
|
101
|
+
</ul></details>
|
102
|
+
<li><details><summary>lib</summary>
|
103
|
+
<ul class="link-list">
|
104
|
+
<li><a href="../../lib/loggable_activity/config_schema_json.html">config_schema.json</a>
|
105
|
+
<li><a href="../../lib/tasks/loggable_activity_tasks_rake.html">loggable_activity_tasks.rake</a>
|
106
|
+
</ul></details>
|
107
|
+
</ul>
|
108
|
+
</div>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</nav>
|
112
|
+
|
113
|
+
<main role="main" aria-label="Page git-org/hooks/post-update.sample">
|
114
|
+
|
115
|
+
<p>!/bin/sh # # An example hook script to prepare a packed repository for use over # dumb transports. # # To enable this hook, rename this file to “post-update”.</p>
|
116
|
+
|
117
|
+
<p>exec git update-server-info</p>
|
118
|
+
|
119
|
+
</main>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<footer id="validator-badges" role="contentinfo">
|
124
|
+
<p><a href="https://validator.w3.org/check/referer">Validate</a>
|
125
|
+
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.7.0.
|
126
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
127
|
+
</footer>
|
128
|
+
|