Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kanban board #8346

Merged
merged 379 commits into from
Aug 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
379 commits
Select commit Hold shift + click to select a range
9336664
fix bug where project gear button never shows in repo sidebar
adelowo Apr 12, 2020
d35fb3e
Make sure uncategorized board always have the projectID
adelowo Apr 13, 2020
4367f22
make sure project boards can be edited
adelowo Apr 13, 2020
7edfedc
close modal on success
adelowo Apr 13, 2020
63ea2af
reload on name change
adelowo Apr 13, 2020
41cebe6
format template properly
adelowo Apr 13, 2020
a87c8ca
delete projects
adelowo Apr 13, 2020
4ce64a1
Fix MergeConflict relicts and fronted Lint (#6)
6543 Apr 13, 2020
d7b1e8c
tiny updates
adelowo Apr 15, 2020
0d4d957
Merge branch 'master' of github.com:go-gitea/gitea into kanban_board
adelowo Apr 17, 2020
93863ba
fix button translation
adelowo Apr 17, 2020
6e24ab1
add new board column to a project
adelowo Apr 17, 2020
7a04527
fix trash icon
adelowo Apr 17, 2020
e6f710a
fix merge conflict relicts
6543 Apr 17, 2020
31bc3a3
fix js lint issues
6543 Apr 17, 2020
bd2868d
remove inrelated code change
6543 Apr 17, 2020
b3ddc58
beautify
6543 Apr 17, 2020
d99c577
migrate octicons
6543 Apr 17, 2020
9b9cd05
Merge branch 'master' into kanban_board
6543 Apr 17, 2020
36c2d2d
remove <span class="badge">{{svg "octicon..."}}</span>
6543 Apr 17, 2020
3d6d0c7
Merge branch 'master' into kanban_board
6543 Apr 20, 2020
5fc69c2
fix Board Menue
6543 Apr 20, 2020
c68b70f
Merge branch master into kanban_board
6543 Apr 20, 2020
adb8405
rm deadcode (merge conflict relicts)
6543 Apr 20, 2020
4ee5212
fix some lint errors
6543 Apr 20, 2020
d3a3006
Merge branch 'master' into kanban_board
6543 Apr 20, 2020
eeee1d6
...
6543 Apr 20, 2020
2d37d70
Merge branch 'master' into kanban_board
6543 Apr 20, 2020
b024482
dont split add direct
6543 Apr 20, 2020
147dd90
remove merge conflict relicts
6543 Apr 20, 2020
c75e62f
code refactor
6543 Apr 20, 2020
55bd9e7
fix Issue Sidebar
6543 Apr 20, 2020
4fd1c22
FIX
6543 Apr 20, 2020
c4be71d
smal ui fix
6543 Apr 20, 2020
eedbd98
addopt new style
6543 Apr 21, 2020
248e030
addopt unit disable/enable ...
6543 Apr 21, 2020
4d6ca62
Update modules/setting/repository.go
6543 Apr 21, 2020
c5466c2
hide Project related Comments if Disabled
6543 Apr 21, 2020
db4d342
fix octicons
6543 Apr 21, 2020
755a178
code format
6543 Apr 21, 2020
26c96d2
reformat template
6543 Apr 21, 2020
2b4ac5c
fix only on issue on a board, refactor, move logic into models
6543 Apr 21, 2020
ea4bddf
remove template debug stuff
6543 Apr 21, 2020
b6df0dc
fix things after cleanup
6543 Apr 21, 2020
3c862f8
refactor & lints
6543 Apr 21, 2020
069983c
lint & refactor & fix
6543 Apr 21, 2020
d686a1d
name convention and split
6543 Apr 21, 2020
3068438
ChangeProjectStatus & ChangeMilestonStatus are similar but combining …
6543 Apr 21, 2020
2f660d0
typo fix & convince revive
6543 Apr 21, 2020
5822bc5
Merge branch 'master' into kanban_board
6543 Apr 21, 2020
31c2b9d
fix css
6543 Apr 21, 2020
2d5ae7b
fix lint
6543 Apr 21, 2020
3104c1b
format template
6543 Apr 21, 2020
9329913
make it look nicer and make it work
6543 Apr 21, 2020
95ebbb6
remove projects from profile page
adelowo Apr 21, 2020
c738c04
Draft ONE
6543 Apr 21, 2020
c84b888
Fix Find: Error 1066: Not unique table/alias: issue_project
6543 Apr 21, 2020
6134e77
handle edge casses
6543 Apr 21, 2020
e40d51d
GroupBy act wrong - rm
6543 Apr 21, 2020
7f9f277
remove db schema change relicts
6543 Apr 21, 2020
5a05ac8
Merge branch 'master' into kanban_board
6543 Apr 21, 2020
1319962
fix, imprufe, refactor
6543 Apr 21, 2020
3521fc6
impruve board card look
6543 Apr 22, 2020
b2fc19b
RENAME: IssueProject -> ProjectIssues
6543 Apr 22, 2020
9bac2d1
smal renames and imprufements
6543 Apr 22, 2020
8c992c8
canf find error but fix lint
6543 Apr 22, 2020
60efc5f
fix & extend migration
6543 Apr 22, 2020
d4f118b
Fix migration - creat tables outside a session
6543 Apr 22, 2020
8a20acd
fix js thanks @jaqra
6543 Apr 22, 2020
3e80ee1
import fromat ...
6543 Apr 22, 2020
ac1557a
Merge branch 'master' into kanban_board
6543 Apr 22, 2020
18113eb
fix milestone color
6543 Apr 22, 2020
2e086fa
Merge branch 'master' into kanban_board
6543 Apr 23, 2020
7b8c70e
Merge branch 'master' into kanban_board
6543 Apr 24, 2020
f2f2086
Merge branch 'master' into kanban_board
adelowo Apr 25, 2020
4a329be
Merge branch 'master' into kanban_board
adelowo Apr 26, 2020
ad0e040
Update web_src/js/features/projects.js
6543 Apr 26, 2020
1ed3636
Merge branch 'master' into kanban_board
6543 Apr 26, 2020
a228324
Add enable/disable project unit for repository and global unit check
metiftikci Apr 26, 2020
e10ba6b
Add enable/disable project unit for repository and global unit check
6543 Apr 26, 2020
589662e
Show/Hide Project section on issue view sidebar according to permission
metiftikci Apr 26, 2020
82f5740
Add modal confir for deleting a board
metiftikci Apr 26, 2020
6380431
use Upercase - looks nicer
6543 Apr 26, 2020
ad49c9e
Fix models/project_issues.go
6543 Apr 26, 2020
604119f
let project-unit enable/disable via API
6543 Apr 26, 2020
e69f38b
let Projects disabled on old Repos (migration)
6543 Apr 26, 2020
eeb0d4b
fix lint
6543 Apr 26, 2020
c44cf5b
Merge branch 'master' into kanban_board
6543 Apr 27, 2020
aceae47
Merge branch 'master' into kanban_board
adelowo Apr 27, 2020
311494d
Merge branch 'master' of github.com:go-gitea/gitea into kanban_board
adelowo Apr 27, 2020
1b32f58
add tests for Projects
adelowo Apr 28, 2020
31db0fc
update copyright year
adelowo Apr 28, 2020
d745b5b
Merge branch 'master' of github.com:go-gitea/gitea into kanban_board
adelowo Apr 28, 2020
edb2602
remove debug printing
adelowo Apr 28, 2020
6c75e70
Merge branch 'master' into kanban_board
6543 Apr 28, 2020
8928a0d
dont use x.AllCols.Update
6543 Apr 28, 2020
6c4a933
update fixtures, add link checks
6543 Apr 29, 2020
f487f9b
correct fixtures & test
6543 Apr 29, 2020
5bbf647
fix
6543 Apr 29, 2020
b88499d
add files repo4
6543 Apr 29, 2020
e1effa1
Merge branch 'master' into kanban_board
6543 Apr 29, 2020
bd40920
this was no comment & translate
6543 Apr 29, 2020
36acce9
Apply suggestions from code review
6543 Apr 29, 2020
1981eb4
Merge branch 'master' into kanban_board
6543 Apr 29, 2020
4fb2106
Merge branch 'master' into kanban_board
6543 Apr 30, 2020
3a7181c
repoID can be NUL & is Inexed; Only RepoistoryType is valid
6543 May 1, 2020
0001370
Rename ProjectType Names & count functions take care of ProjectType
6543 May 1, 2020
5eba1c9
Merge branch 'master' into kanban_board
6543 May 1, 2020
e0eab4d
fix TEST
6543 May 1, 2020
15e39d0
change ProjectType names - follow convention
6543 May 1, 2020
8eed2bb
use only id and check access via repo on router functions
6543 May 1, 2020
1d06f8e
Merge branch 'master' into kanban_board
6543 May 1, 2020
d46ce37
fix tests
6543 May 1, 2020
87ed7fe
fix fixtures
6543 May 1, 2020
4a78ffc
dont forget the migrations
6543 May 1, 2020
d34c4ff
Update routers/repo/issue.go
6543 May 2, 2020
675f52f
Merge branch 'master' into kanban_board
6543 May 2, 2020
9fc9ffb
Merge branch 'master' into kanban_board
adelowo May 2, 2020
3d1570f
kanban: add a minimum height for droppable area of project boards (#9)
kevans91 May 3, 2020
61d7445
Merge branch 'master' into kanban_board
adelowo May 3, 2020
b95fb53
Merge branch 'master' into kanban_board
6543 May 4, 2020
b27c731
adds some css to cards and board-cards (see commit description for mo…
May 4, 2020
ee404ec
hide template field for project edit
6543 May 4, 2020
5da0cd9
Merge branch 'master' into kanban_board
6543 May 4, 2020
8fa6ccb
Merge branch 'master' into kanban_board
6543 May 5, 2020
52691e3
Kanban board (#11)
May 5, 2020
4e585b0
Fixes error 500 when trying to create a User or na Organization project
DefinitelyADev May 4, 2020
6ab3e4b
Fix for create a User or na Organization project showing
DefinitelyADev May 4, 2020
2fe798b
Revents 7eb8846
DefinitelyADev May 4, 2020
0ee13f7
Revert "Fix for create a User or na Organization project showing"
DefinitelyADev May 5, 2020
686b2f2
Fixes "When creating and issue, after selecting a project the project…
DefinitelyADev May 5, 2020
e3b4ed3
Merge branch 'master' into kanban_board
6543 May 5, 2020
aed1a56
Merge branch 'master' into kanban_board
6543 May 9, 2020
a0dd2f3
Merge branch 'master' into kanban_board
6543 May 9, 2020
957412a
Added English localization for filter_projects (#13)
May 9, 2020
7399758
Merge branch 'master' into kanban_board
6543 May 10, 2020
888dc65
Merge branch 'master' into kanban_board
6543 May 11, 2020
17b3a7a
Merge branch 'master' into kanban_board
adelowo May 12, 2020
c346d22
Merge branch 'master' into kanban_board
adelowo May 14, 2020
d7ff2bd
Merge branch 'master' into kanban_board
6543 May 15, 2020
b1421c7
Merge branch 'master' into kanban_board
lunny May 16, 2020
72c6b51
Merge branch 'master' into kanban_board
adelowo May 16, 2020
3620489
Merge branch 'master' into kanban_board
6543 May 19, 2020
21ace77
Merge branch 'master' into kanban_board
6543 May 20, 2020
19b348a
Merge branch 'master' into kanban_board
6543 May 20, 2020
e889da7
Merge branch 'master' into kanban_board
6543 May 20, 2020
cf8e783
Merge branch 'master' into kanban_board
6543 May 21, 2020
4442037
Merge branch 'master' into kanban_board
6543 May 23, 2020
a67aedf
Merge branch 'master' into kanban_board
adelowo May 24, 2020
13bf054
Merge branch 'master' into kanban_board
6543 May 29, 2020
6f49097
delete Projects and related correctly on RepoDeletion -> adapt change…
6543 May 29, 2020
e4a48f9
fix lint
6543 May 29, 2020
1ababcf
Merge branch 'master' into kanban_board
6543 May 29, 2020
55b9431
Merge branch 'master' into kanban_board
6543 Jun 1, 2020
140e5bd
fix lint
6543 Jun 2, 2020
8b99fdc
Merge branch 'master' into kanban_board
6543 Jun 2, 2020
52db2e1
Merge branch 'master' into kanban_board
6543 Jun 3, 2020
4eef37c
Apply suggestions from code review
6543 Jun 3, 2020
50852ce
Apply suggestions from code review
6543 Jun 3, 2020
b1794de
Merge branch 'master' into kanban_board
6543 Jun 3, 2020
cbeba0f
Update web_src/js/features/projects.js
6543 Jun 4, 2020
f1e6b80
Merge branch 'master' into kanban_board
6543 Jun 4, 2020
07b9597
add silverwind tweeks
6543 Jun 4, 2020
4c7072e
add Index
6543 Jun 4, 2020
fecec01
Update web_src/js/features/projects.js
6543 Jun 4, 2020
caa40cb
stylistic tweak
6543 Jun 4, 2020
aeab76c
Merge branch 'master' into kanban_board
6543 Jun 8, 2020
d483e96
as per @zeripath
6543 Jun 16, 2020
c06ba4b
Apply suggestions from code review
6543 Jun 16, 2020
2a8a987
suggestions form code review
6543 Jun 16, 2020
c74f87a
a nit
6543 Jun 16, 2020
3992506
Merge branch 'master' into kanban_board
6543 Jun 16, 2020
d7fb97b
BugFix: save ClosedDate on Close
6543 Jun 16, 2020
dce5077
Merge branch 'master' into kanban_board
6543 Jun 18, 2020
16e44e8
Merge branch 'master' into kanban_board
adelowo Jun 18, 2020
50cb3b0
Merge branch 'master' into kanban_board
6543 Jun 19, 2020
08be11c
Merge branch 'master' into kanban_board
6543 Jun 22, 2020
474a965
Merge branch 'master' into kanban_board
6543 Jun 23, 2020
0f4a7ad
Merge branch 'master' into kanban_board
6543 Jun 24, 2020
a3eae2a
new PROJECT section in Settings
6543 Jun 24, 2020
b11c766
Merge branch 'master' into kanban_board
6543 Jun 25, 2020
9221a39
correct Default field
6543 Jun 25, 2020
67692d7
fix DeleteProj Bug
6543 Jun 25, 2020
0d11332
Merge branch 'master' into kanban_board
6543 Jun 26, 2020
391f760
rename ProjectBorardType enum
6543 Jun 26, 2020
7f1d860
apply @silverwind suggestions
6543 Jul 1, 2020
dbe5b96
Merge branch 'master' into kanban_board
6543 Jul 1, 2020
5810613
Merge branch 'master' into kanban_board
adelowo Jul 4, 2020
6bf75ee
Merge branch 'master' into kanban_board
6543 Jul 4, 2020
24731ef
Merge branch 'master' into kanban_board
zeripath Jul 6, 2020
693d8b9
Multiple fixes
zeripath Jul 6, 2020
59650ee
Update web_src/js/features/projects.js
6543 Jul 8, 2020
1f25a5a
sort order package.json
6543 Jul 8, 2020
f0101b0
Merge branch 'master' into kanban_board
6543 Jul 8, 2020
429a5c2
complete @silverwind suggestion
6543 Jul 8, 2020
18674e5
rm current unused
6543 Jul 8, 2020
2c55136
Merge branch 'master' into kanban_board
6543 Jul 9, 2020
1749e58
Merge branch 'master' into kanban_board
6543 Jul 10, 2020
9e94db0
Merge branch 'master' into kanban_board
6543 Jul 13, 2020
585ba57
fix lint
6543 Jul 13, 2020
b27415e
project_issues.go -> project_issue.go
6543 Jul 13, 2020
24d6e1e
dedub code
6543 Jul 13, 2020
0c7391a
update Count each in single SQL
6543 Jul 13, 2020
b4432d5
fix lint
6543 Jul 13, 2020
b5e53d0
Apply suggestions from code review
6543 Jul 13, 2020
0f55178
Update ToDo in web_src/js/features/projects.js
6543 Jul 13, 2020
23eed99
Merge branch 'master' into kanban_board
6543 Jul 13, 2020
d6ecb55
Apply suggestions from code review
6543 Jul 14, 2020
c90bd69
Merge branch 'master' into kanban_board
6543 Jul 15, 2020
9a2a583
Merge branch 'master' into kanban_board
adelowo Jul 15, 2020
7a668ff
Merge branch 'master' into kanban_board
6543 Jul 17, 2020
f24c8f5
remove ToDo note and move it as proposal to #12270
6543 Jul 18, 2020
3f435a2
Docs: Update Comparison
6543 Jul 18, 2020
a692b18
Merge branch 'master' into kanban_board
6543 Jul 22, 2020
1d3371e
if backend respond with an error move issue to old bord back
6543 Jul 22, 2020
5cc83dc
Merge branch 'master' into kanban_board
6543 Jul 23, 2020
2bb433c
Merge branch 'master' into kanban_board
techknowlogick Jul 23, 2020
d851614
Merge branch 'master' into kanban_board
6543 Jul 24, 2020
6fa272a
as per @lunny
6543 Jul 24, 2020
5438aee
Merge branch 'master' into kanban_board
6543 Jul 25, 2020
c884473
fix templates/repo/projects/view.tmpl
6543 Jul 25, 2020
aa0fa1d
Merge branch 'master' into kanban_board
6543 Jul 27, 2020
127d69b
EditBoardTitle: dont reload
6543 Jul 27, 2020
1b191e0
Merge branch 'master' into kanban_board
6543 Jul 27, 2020
d171fa3
Merge branch 'master' into kanban_board
adelowo Jul 28, 2020
4d6d0b7
Merge branch 'master' into kanban_board
adelowo Jul 30, 2020
adba43f
Merge branch 'master' into kanban_board
6543 Jul 31, 2020
7f2059e
Merge branch 'master' into kanban_board
6543 Aug 1, 2020
3519413
addapt #12383
6543 Aug 1, 2020
7c54db3
Merge branch 'master' into kanban_board
6543 Aug 1, 2020
26d850d
Merge branch 'master' into kanban_board
6543 Aug 2, 2020
f058723
Merge branch 'master' into kanban_board
6543 Aug 2, 2020
1fc91cd
Merge branch 'master' into kanban_board
lunny Aug 4, 2020
915ab60
Merge branch 'master' into kanban_board
6543 Aug 4, 2020
a923160
Merge branch 'master' into kanban_board
adelowo Aug 5, 2020
20eed58
Merge branch 'master' into kanban_board
zeripath Aug 7, 2020
4a5ea56
Merge branch 'master' into kanban_board
6543 Aug 8, 2020
ab633e1
Merge branch 'master' into kanban_board
6543 Aug 8, 2020
46d5173
Merge branch 'master' into kanban_board
6543 Aug 9, 2020
caa68dc
Merge branch 'master' into kanban_board
zeripath Aug 10, 2020
d3ef729
Merge branch 'master' into kanban_board
6543 Aug 11, 2020
b840634
Merge branch 'master' into kanban_board
6543 Aug 11, 2020
60c99f8
Merge branch 'master' into kanban_board
6543 Aug 12, 2020
6fcdc41
Merge branch 'master' into kanban_board
6543 Aug 13, 2020
a470c71
Merge branch 'master' into kanban_board
adelowo Aug 13, 2020
a70ff2f
Merge branch 'master' into kanban_board
6543 Aug 13, 2020
ea14063
Merge branch 'master' into kanban_board
6543 Aug 13, 2020
fcec5f3
Merge branch 'master' into kanban_board
adelowo Aug 14, 2020
a48f839
Merge branch 'master' into kanban_board
6543 Aug 16, 2020
16af23e
Merge branch 'master' into kanban_board
techknowlogick Aug 17, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ RUN_USER = git
; Either "dev", "prod" or "test", default is "dev"
RUN_MODE = dev

[project]
; Default templates for project boards
PROJECT_BOARD_BASIC_KANBAN_TYPE = To Do, In Progress, Done
PROJECT_BOARD_BUG_TRIAGE_TYPE = Needs Triage, High Priority, Low Priority, Closed

[repository]
ROOT =
SCRIPT_TYPE = bash
Expand Down Expand Up @@ -48,11 +53,11 @@ ENABLE_PUSH_CREATE_USER = false
ENABLE_PUSH_CREATE_ORG = false
; Comma separated list of globally disabled repo units. Allowed values: repo.issues, repo.ext_issues, repo.pulls, repo.wiki, repo.ext_wiki
DISABLED_REPO_UNITS =
; Comma separated list of default repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki.
; Comma separated list of default repo units. Allowed values: repo.code, repo.releases, repo.issues, repo.pulls, repo.wiki, repo.projects.
; Note: Code and Releases can currently not be deactivated. If you specify default repo units you should still list them for future compatibility.
; External wiki and issue tracker can't be enabled by default as it requires additional settings.
; Disabled repo units will not be added to new repositories regardless if it is in the default list.
DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki
DEFAULT_REPO_UNITS = repo.code,repo.releases,repo.issues,repo.pulls,repo.wiki,repo.projects
; Prefix archive files by placing them in a directory named after the repository
PREFIX_ARCHIVE_FILES = true
; Disable the creation of new mirrors. Pre-existing mirrors remain valid.
Expand Down
2 changes: 1 addition & 1 deletion docs/content/doc/features/comparison.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ _Symbols used in table:_
| Comment reactions | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
| Lock Discussion | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
| Batch issue handling | ✓ | ✘ | ✓ | ✓ | ✓ | ✘ | ✘ |
| Issue Boards | [](https://github.com/go-gitea/gitea/issues/3476) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
| Issue Boards | [](https://github.com/go-gitea/gitea/pull/8346) | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
| Create new branches from issues | ✘ | ✘ | ✘ | ✓ | ✓ | ✘ | ✘ |
| Issue search | ✓ | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
| Global issue search | [✘](https://github.com/go-gitea/gitea/issues/2434) | ✘ | ✓ | ✓ | ✓ | ✓ | ✘ |
Expand Down
1 change: 1 addition & 0 deletions integrations/gitea-repositories-meta/user5/repo4.git/HEAD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ref: refs/heads/master
4 changes: 4 additions & 0 deletions integrations/gitea-repositories-meta/user5/repo4.git/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[core]
repositoryformatversion = 0
filemode = true
bare = true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail 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 "applypatch-msg".

. git-sh-setup
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
:
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/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".

# 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"

# This example catches duplicate Signed-off-by lines.

test "" = "$(grep '^Signed-off-by: ' "$1" |
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
echo >&2 Duplicate Signed-off-by lines.
exit 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
#!/usr/bin/perl

use strict;
use warnings;
use IPC::Open2;

# An example hook script to integrate Watchman
# (https://facebook.github.io/watchman/) 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;

# Uncomment for debugging
# print STDERR "$0 $version $last_update_token\n";

# Check the hook interface version
if ($version ne 2) {
die "Unsupported query-fsmonitor hook version '$version'.\n" .
"Falling back to scanning...\n";
}

my $git_work_tree = get_working_dir();

my $retry = 1;

my $json_pkg;
eval {
require JSON::XS;
$json_pkg = "JSON::XS";
1;
} or do {
require JSON::PP;
$json_pkg = "JSON::PP";
};

launch_watchman();

sub launch_watchman {
my $o = watchman_query();
if (is_work_tree_watched($o)) {
output_result($o->{clock}, @{$o->{files}});
}
}

sub output_result {
my ($clockid, @files) = @_;

# Uncomment for debugging watchman output
# open (my $fh, ">", ".git/watchman-output.out");
# binmode $fh, ":utf8";
# print $fh "$clockid\n@files\n";
# close $fh;

binmode STDOUT, ":utf8";
print $clockid;
print "\0";
local $, = "\0";
print @files;
}

sub watchman_clock {
my $response = qx/watchman clock "$git_work_tree"/;
die "Failed to get clock id on '$git_work_tree'.\n" .
"Falling back to scanning...\n" if $? != 0;

return $json_pkg->new->utf8->decode($response);
}

sub watchman_query {
my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty')
or die "open2() failed: $!\n" .
"Falling back to scanning...\n";

# In the query expression below we're asking for names of files that
# changed since $last_update_token but not from the .git folder.
#
# To accomplish this, we're using the "since" generator to use the
# recency index to select candidate nodes and "fields" to limit the
# output to file names only. Then we're using the "expression" term to
# further constrain the results.
if (substr($last_update_token, 0, 1) eq "c") {
$last_update_token = "\"$last_update_token\"";
}
my $query = <<" END";
["query", "$git_work_tree", {
"since": $last_update_token,
"fields": ["name"],
"expression": ["not", ["dirname", ".git"]]
}]
END

# Uncomment for debugging the watchman query
# open (my $fh, ">", ".git/watchman-query.json");
# print $fh $query;
# close $fh;

print CHLD_IN $query;
close CHLD_IN;
my $response = do {local $/; <CHLD_OUT>};

# Uncomment for debugging the watch response
# open ($fh, ">", ".git/watchman-response.json");
# print $fh $response;
# close $fh;

die "Watchman: command returned no output.\n" .
"Falling back to scanning...\n" if $response eq "";
die "Watchman: command returned invalid output: $response\n" .
"Falling back to scanning...\n" unless $response =~ /^\{/;

return $json_pkg->new->utf8->decode($response);
}

sub is_work_tree_watched {
my ($output) = @_;
my $error = $output->{error};
if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
$retry--;
my $response = qx/watchman watch "$git_work_tree"/;
die "Failed to make watchman watch '$git_work_tree'.\n" .
"Falling back to scanning...\n" if $? != 0;
$output = $json_pkg->new->utf8->decode($response);
$error = $output->{error};
die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;

# Uncomment for debugging watchman output
# open (my $fh, ">", ".git/watchman-output.out");
# close $fh;

# Watchman will always return all files on the first query so
# return the fast "everything is dirty" flag to git and do the
# Watchman query just to get it over with now so we won't pay
# the cost in git to look up each individual file.
my $o = watchman_clock();
$error = $output->{error};

die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;

output_result($o->{clock}, ("/"));
$last_update_token = $o->{clock};

eval { launch_watchman() };
return 0;
}

die "Watchman: $error.\n" .
"Falling back to scanning...\n" if $error;

return 1;
}

sub get_working_dir {
my $working_dir;
if ($^O =~ 'msys' || $^O =~ 'cygwin') {
$working_dir = Win32::GetCwd();
$working_dir =~ tr/\\/\//;
} else {
require Cwd;
$working_dir = Cwd::cwd();
}

return $working_dir;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/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".

exec git update-server-info
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-applypatch".

. git-sh-setup
precommit="$(git rev-parse --git-path hooks/pre-commit)"
test -x "$precommit" && exec "$precommit" ${1+"$@"}
:
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".

if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi

# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --type=bool hooks.allownonascii)

# Redirect output to stderr.
exec 1>&2

# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.

This can cause problems if you want to work with people on other platforms.

To be portable it is advisable to rename the file.

If you know what you are doing you can disable this check using:

git config hooks.allownonascii true
EOF
exit 1
fi

# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git merge" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message to
# stderr if it wants to stop the merge commit.
#
# To enable this hook, rename this file to "pre-merge-commit".

. git-sh-setup
test -x "$GIT_DIR/hooks/pre-commit" &&
exec "$GIT_DIR/hooks/pre-commit"
:
Loading