-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappendix-document-metadata.qmd
More file actions
43 lines (28 loc) · 1.28 KB
/
appendix-document-metadata.qmd
File metadata and controls
43 lines (28 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
::: {.content-visible when-format="docx"}
# Document Generation Metadata {.unnumbered}
This document was generated from the following git commit:
```{r}
#| echo: false
#| output: asis
# Get git branch
branch <- system("git rev-parse --abbrev-ref HEAD 2>/dev/null", intern = TRUE)
if (length(branch) == 0 || branch == "") branch <- "unknown"
# Get short commit hash
commit_short <- system("git rev-parse --short HEAD 2>/dev/null", intern = TRUE)
if (length(commit_short) == 0 || commit_short == "") commit_short <- "unknown"
# Get full commit hash
commit_full <- system("git rev-parse HEAD 2>/dev/null", intern = TRUE)
if (length(commit_full) == 0 || commit_full == "") commit_full <- "unknown"
# Get commit date
commit_date <- "git show -s --format=%ci HEAD 2>/dev/null" |>
system(intern = TRUE)
if (length(commit_date) == 0 || commit_date == "") commit_date <- "unknown"
# Print formatted output
cat("- **Branch:**", branch, "\n")
cat("- **Commit:**", commit_short, "\n")
cat("- **Full commit hash:**", commit_full, "\n")
cat("- **Commit date:**", commit_date, "\n")
```
When transferring edits from this DOCX file back to the Quarto source files,
use this commit information to set up the PR correctly and account for any commits that have been added since this document was generated.
:::