|
| 1 | +manpages = { |
| 2 | + # Category 1. |
| 3 | + 'git-add.txt' : 1, |
| 4 | + 'git-am.txt' : 1, |
| 5 | + 'git-annotate.txt' : 1, |
| 6 | + 'git-apply.txt' : 1, |
| 7 | + 'git-archimport.txt' : 1, |
| 8 | + 'git-archive.txt' : 1, |
| 9 | + 'git-bisect.txt' : 1, |
| 10 | + 'git-blame.txt' : 1, |
| 11 | + 'git-branch.txt' : 1, |
| 12 | + 'git-bugreport.txt' : 1, |
| 13 | + 'git-bundle.txt' : 1, |
| 14 | + 'git-cat-file.txt' : 1, |
| 15 | + 'git-check-attr.txt' : 1, |
| 16 | + 'git-check-ignore.txt' : 1, |
| 17 | + 'git-check-mailmap.txt' : 1, |
| 18 | + 'git-checkout-index.txt' : 1, |
| 19 | + 'git-checkout.txt' : 1, |
| 20 | + 'git-check-ref-format.txt' : 1, |
| 21 | + 'git-cherry-pick.txt' : 1, |
| 22 | + 'git-cherry.txt' : 1, |
| 23 | + 'git-citool.txt' : 1, |
| 24 | + 'git-clean.txt' : 1, |
| 25 | + 'git-clone.txt' : 1, |
| 26 | + 'git-column.txt' : 1, |
| 27 | + 'git-commit-graph.txt' : 1, |
| 28 | + 'git-commit-tree.txt' : 1, |
| 29 | + 'git-commit.txt' : 1, |
| 30 | + 'git-config.txt' : 1, |
| 31 | + 'git-count-objects.txt' : 1, |
| 32 | + 'git-credential-cache--daemon.txt' : 1, |
| 33 | + 'git-credential-cache.txt' : 1, |
| 34 | + 'git-credential-store.txt' : 1, |
| 35 | + 'git-credential.txt' : 1, |
| 36 | + 'git-cvsexportcommit.txt' : 1, |
| 37 | + 'git-cvsimport.txt' : 1, |
| 38 | + 'git-cvsserver.txt' : 1, |
| 39 | + 'git-daemon.txt' : 1, |
| 40 | + 'git-describe.txt' : 1, |
| 41 | + 'git-diagnose.txt' : 1, |
| 42 | + 'git-diff-files.txt' : 1, |
| 43 | + 'git-diff-index.txt' : 1, |
| 44 | + 'git-difftool.txt' : 1, |
| 45 | + 'git-diff-tree.txt' : 1, |
| 46 | + 'git-diff.txt' : 1, |
| 47 | + 'git-fast-export.txt' : 1, |
| 48 | + 'git-fast-import.txt' : 1, |
| 49 | + 'git-fetch-pack.txt' : 1, |
| 50 | + 'git-fetch.txt' : 1, |
| 51 | + 'git-filter-branch.txt' : 1, |
| 52 | + 'git-fmt-merge-msg.txt' : 1, |
| 53 | + 'git-for-each-ref.txt' : 1, |
| 54 | + 'git-for-each-repo.txt' : 1, |
| 55 | + 'git-format-patch.txt' : 1, |
| 56 | + 'git-fsck-objects.txt' : 1, |
| 57 | + 'git-fsck.txt' : 1, |
| 58 | + 'git-fsmonitor--daemon.txt' : 1, |
| 59 | + 'git-gc.txt' : 1, |
| 60 | + 'git-get-tar-commit-id.txt' : 1, |
| 61 | + 'git-grep.txt' : 1, |
| 62 | + 'git-gui.txt' : 1, |
| 63 | + 'git-hash-object.txt' : 1, |
| 64 | + 'git-help.txt' : 1, |
| 65 | + 'git-hook.txt' : 1, |
| 66 | + 'git-http-backend.txt' : 1, |
| 67 | + 'git-http-fetch.txt' : 1, |
| 68 | + 'git-http-push.txt' : 1, |
| 69 | + 'git-imap-send.txt' : 1, |
| 70 | + 'git-index-pack.txt' : 1, |
| 71 | + 'git-init-db.txt' : 1, |
| 72 | + 'git-init.txt' : 1, |
| 73 | + 'git-instaweb.txt' : 1, |
| 74 | + 'git-interpret-trailers.txt' : 1, |
| 75 | + 'git-log.txt' : 1, |
| 76 | + 'git-ls-files.txt' : 1, |
| 77 | + 'git-ls-remote.txt' : 1, |
| 78 | + 'git-ls-tree.txt' : 1, |
| 79 | + 'git-mailinfo.txt' : 1, |
| 80 | + 'git-mailsplit.txt' : 1, |
| 81 | + 'git-maintenance.txt' : 1, |
| 82 | + 'git-merge-base.txt' : 1, |
| 83 | + 'git-merge-file.txt' : 1, |
| 84 | + 'git-merge-index.txt' : 1, |
| 85 | + 'git-merge-one-file.txt' : 1, |
| 86 | + 'git-mergetool--lib.txt' : 1, |
| 87 | + 'git-mergetool.txt' : 1, |
| 88 | + 'git-merge-tree.txt' : 1, |
| 89 | + 'git-merge.txt' : 1, |
| 90 | + 'git-mktag.txt' : 1, |
| 91 | + 'git-mktree.txt' : 1, |
| 92 | + 'git-multi-pack-index.txt' : 1, |
| 93 | + 'git-mv.txt' : 1, |
| 94 | + 'git-name-rev.txt' : 1, |
| 95 | + 'git-notes.txt' : 1, |
| 96 | + 'git-p4.txt' : 1, |
| 97 | + 'git-pack-objects.txt' : 1, |
| 98 | + 'git-pack-redundant.txt' : 1, |
| 99 | + 'git-pack-refs.txt' : 1, |
| 100 | + 'git-patch-id.txt' : 1, |
| 101 | + 'git-prune-packed.txt' : 1, |
| 102 | + 'git-prune.txt' : 1, |
| 103 | + 'git-pull.txt' : 1, |
| 104 | + 'git-push.txt' : 1, |
| 105 | + 'git-quiltimport.txt' : 1, |
| 106 | + 'git-range-diff.txt' : 1, |
| 107 | + 'git-read-tree.txt' : 1, |
| 108 | + 'git-rebase.txt' : 1, |
| 109 | + 'git-receive-pack.txt' : 1, |
| 110 | + 'git-reflog.txt' : 1, |
| 111 | + 'git-refs.txt' : 1, |
| 112 | + 'git-remote-ext.txt' : 1, |
| 113 | + 'git-remote-fd.txt' : 1, |
| 114 | + 'git-remote.txt' : 1, |
| 115 | + 'git-repack.txt' : 1, |
| 116 | + 'git-replace.txt' : 1, |
| 117 | + 'git-replay.txt' : 1, |
| 118 | + 'git-request-pull.txt' : 1, |
| 119 | + 'git-rerere.txt' : 1, |
| 120 | + 'git-reset.txt' : 1, |
| 121 | + 'git-restore.txt' : 1, |
| 122 | + 'git-revert.txt' : 1, |
| 123 | + 'git-rev-list.txt' : 1, |
| 124 | + 'git-rev-parse.txt' : 1, |
| 125 | + 'git-rm.txt' : 1, |
| 126 | + 'git-send-email.txt' : 1, |
| 127 | + 'git-send-pack.txt' : 1, |
| 128 | + 'git-shell.txt' : 1, |
| 129 | + 'git-sh-i18n--envsubst.txt' : 1, |
| 130 | + 'git-sh-i18n.txt' : 1, |
| 131 | + 'git-shortlog.txt' : 1, |
| 132 | + 'git-show-branch.txt' : 1, |
| 133 | + 'git-show-index.txt' : 1, |
| 134 | + 'git-show-ref.txt' : 1, |
| 135 | + 'git-show.txt' : 1, |
| 136 | + 'git-sh-setup.txt' : 1, |
| 137 | + 'git-sparse-checkout.txt' : 1, |
| 138 | + 'git-stage.txt' : 1, |
| 139 | + 'git-stash.txt' : 1, |
| 140 | + 'git-status.txt' : 1, |
| 141 | + 'git-stripspace.txt' : 1, |
| 142 | + 'git-submodule.txt' : 1, |
| 143 | + 'git-svn.txt' : 1, |
| 144 | + 'git-switch.txt' : 1, |
| 145 | + 'git-symbolic-ref.txt' : 1, |
| 146 | + 'git-tag.txt' : 1, |
| 147 | + 'git-unpack-file.txt' : 1, |
| 148 | + 'git-unpack-objects.txt' : 1, |
| 149 | + 'git-update-index.txt' : 1, |
| 150 | + 'git-update-ref.txt' : 1, |
| 151 | + 'git-update-server-info.txt' : 1, |
| 152 | + 'git-upload-archive.txt' : 1, |
| 153 | + 'git-upload-pack.txt' : 1, |
| 154 | + 'git-var.txt' : 1, |
| 155 | + 'git-verify-commit.txt' : 1, |
| 156 | + 'git-verify-pack.txt' : 1, |
| 157 | + 'git-verify-tag.txt' : 1, |
| 158 | + 'git-version.txt' : 1, |
| 159 | + 'git-web--browse.txt' : 1, |
| 160 | + 'git-whatchanged.txt' : 1, |
| 161 | + 'git-worktree.txt' : 1, |
| 162 | + 'git-write-tree.txt' : 1, |
| 163 | + 'git.txt' : 1, |
| 164 | + 'gitk.txt' : 1, |
| 165 | + 'gitweb.txt' : 1, |
| 166 | + 'scalar.txt' : 1, |
| 167 | + |
| 168 | + # Category 5. |
| 169 | + 'gitattributes.txt' : 5, |
| 170 | + 'gitformat-bundle.txt' : 5, |
| 171 | + 'gitformat-chunk.txt' : 5, |
| 172 | + 'gitformat-commit-graph.txt' : 5, |
| 173 | + 'gitformat-index.txt' : 5, |
| 174 | + 'gitformat-pack.txt' : 5, |
| 175 | + 'gitformat-signature.txt' : 5, |
| 176 | + 'githooks.txt' : 5, |
| 177 | + 'gitignore.txt' : 5, |
| 178 | + 'gitmailmap.txt' : 5, |
| 179 | + 'gitmodules.txt' : 5, |
| 180 | + 'gitprotocol-capabilities.txt' : 5, |
| 181 | + 'gitprotocol-common.txt' : 5, |
| 182 | + 'gitprotocol-http.txt' : 5, |
| 183 | + 'gitprotocol-pack.txt' : 5, |
| 184 | + 'gitprotocol-v2.txt' : 5, |
| 185 | + 'gitrepository-layout.txt' : 5, |
| 186 | + 'gitweb.conf.txt' : 5, |
| 187 | + |
| 188 | + # Category 7. |
| 189 | + 'gitcli.txt' : 7, |
| 190 | + 'gitcore-tutorial.txt' : 7, |
| 191 | + 'gitcredentials.txt' : 7, |
| 192 | + 'gitcvs-migration.txt' : 7, |
| 193 | + 'gitdiffcore.txt' : 7, |
| 194 | + 'giteveryday.txt' : 7, |
| 195 | + 'gitfaq.txt' : 7, |
| 196 | + 'gitglossary.txt' : 7, |
| 197 | + 'gitpacking.txt' : 7, |
| 198 | + 'gitnamespaces.txt' : 7, |
| 199 | + 'gitremote-helpers.txt' : 7, |
| 200 | + 'gitrevisions.txt' : 7, |
| 201 | + 'gitsubmodules.txt' : 7, |
| 202 | + 'gittutorial-2.txt' : 7, |
| 203 | + 'gittutorial.txt' : 7, |
| 204 | + 'gitworkflows.txt' : 7, |
| 205 | +} |
| 206 | + |
| 207 | +asciidoc = find_program('asciidoc') |
| 208 | +git = find_program('git', required: false) |
| 209 | +xmlto = find_program('xmlto') |
| 210 | + |
| 211 | +asciidoc_conf = custom_target( |
| 212 | + command: [ |
| 213 | + shell, |
| 214 | + meson.project_source_root() / 'GIT-VERSION-GEN', |
| 215 | + meson.project_source_root(), |
| 216 | + '@INPUT@', |
| 217 | + '@OUTPUT@', |
| 218 | + ], |
| 219 | + input: meson.current_source_dir() / 'asciidoc.conf.in', |
| 220 | + output: 'asciidoc.conf', |
| 221 | + depends: [git_version_file], |
| 222 | +) |
| 223 | + |
| 224 | +asciidoc_common_options = [ |
| 225 | + asciidoc, |
| 226 | + '--conf-file=' + asciidoc_conf.full_path(), |
| 227 | + '--attribute=build_dir=' + meson.current_build_dir(), |
| 228 | +] |
| 229 | + |
| 230 | +cmd_lists = [ |
| 231 | + 'cmds-ancillaryinterrogators.txt', |
| 232 | + 'cmds-ancillarymanipulators.txt', |
| 233 | + 'cmds-mainporcelain.txt', |
| 234 | + 'cmds-plumbinginterrogators.txt', |
| 235 | + 'cmds-plumbingmanipulators.txt', |
| 236 | + 'cmds-synchingrepositories.txt', |
| 237 | + 'cmds-synchelpers.txt', |
| 238 | + 'cmds-guide.txt', |
| 239 | + 'cmds-developerinterfaces.txt', |
| 240 | + 'cmds-userinterfaces.txt', |
| 241 | + 'cmds-purehelpers.txt', |
| 242 | + 'cmds-foreignscminterface.txt', |
| 243 | +] |
| 244 | + |
| 245 | +documentation_deps = [ |
| 246 | + asciidoc_conf, |
| 247 | +] |
| 248 | + |
| 249 | +documentation_deps += custom_target( |
| 250 | + command: [ |
| 251 | + perl, |
| 252 | + meson.current_source_dir() / 'cmd-list.perl', |
| 253 | + meson.project_source_root(), |
| 254 | + meson.current_build_dir(), |
| 255 | + ] + cmd_lists, |
| 256 | + output: cmd_lists |
| 257 | +) |
| 258 | + |
| 259 | +foreach mode : [ 'diff', 'merge' ] |
| 260 | + documentation_deps += custom_target( |
| 261 | + command: [ |
| 262 | + shell, |
| 263 | + meson.current_source_dir() / 'generate-mergetool-list.sh', |
| 264 | + '..', |
| 265 | + 'diff', |
| 266 | + '@OUTPUT@' |
| 267 | + ], |
| 268 | + env: [ |
| 269 | + 'MERGE_TOOLS_DIR=' + meson.project_source_root() / 'mergetools', |
| 270 | + 'TOOL_MODE=' + mode, |
| 271 | + ], |
| 272 | + output: 'mergetools-' + mode + '.txt', |
| 273 | + ) |
| 274 | +endforeach |
| 275 | + |
| 276 | +foreach manpage, category : manpages |
| 277 | + if get_option('docs').contains('man') |
| 278 | + manpage_xml_target = custom_target( |
| 279 | + command: asciidoc_common_options + [ |
| 280 | + '--backend=docbook', |
| 281 | + '--doctype=manpage', |
| 282 | + '--out-file=@OUTPUT@', |
| 283 | + meson.current_source_dir() / manpage, |
| 284 | + ], |
| 285 | + depends: documentation_deps, |
| 286 | + output: fs.stem(manpage) + '.xml', |
| 287 | + ) |
| 288 | + |
| 289 | + manpage_path = fs.stem(manpage) + '.' + category.to_string() |
| 290 | + manpage_target = custom_target( |
| 291 | + command: [ |
| 292 | + xmlto, |
| 293 | + '-m', |
| 294 | + meson.current_source_dir() / 'manpage-normal.xsl', |
| 295 | + '-m', |
| 296 | + meson.current_source_dir() / 'manpage-bold-literal.xsl', |
| 297 | + '--stringparam', |
| 298 | + 'man.base.url.for.relative.links=' + get_option('prefix') / get_option('mandir'), |
| 299 | + 'man', |
| 300 | + manpage_xml_target, |
| 301 | + '-o', |
| 302 | + meson.current_build_dir(), |
| 303 | + ], |
| 304 | + output: manpage_path, |
| 305 | + install: true, |
| 306 | + install_dir: get_option('mandir') / 'man' + category.to_string(), |
| 307 | + ) |
| 308 | + endif |
| 309 | + |
| 310 | + if get_option('docs').contains('html') and category == 1 |
| 311 | + custom_target( |
| 312 | + command: asciidoc_common_options + [ |
| 313 | + '--backend=xhtml11', |
| 314 | + '--doctype=manpage', |
| 315 | + '--out-file=@OUTPUT@', |
| 316 | + meson.current_source_dir() / manpage, |
| 317 | + ], |
| 318 | + depends: documentation_deps, |
| 319 | + output: fs.stem(manpage) + '.html', |
| 320 | + install: true, |
| 321 | + install_dir: get_option('datadir') / 'doc/git-doc', |
| 322 | + ) |
| 323 | + endif |
| 324 | +endforeach |
0 commit comments