aboutsummaryrefslogtreecommitdiffstats
path: root/src/extract.sh
diff options
context:
space:
mode:
authorLibravatar Fabian Kirchner <kirchner@posteo.de>2023-09-27 14:47:13 +0200
committerLibravatar Fabian Kirchner <kirchner@posteo.de>2023-09-27 14:47:13 +0200
commit59d7b4bb6cd26dc0e451c637a94cac57b4eb2dd0 (patch)
tree61126f5ba35acf399f01d0fe92e9d42c94fcb223 /src/extract.sh
parenta196383fbece635c19c680fa159e63b866e44c6b (diff)
add some issues
Diffstat (limited to 'src/extract.sh')
-rwxr-xr-xsrc/extract.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/extract.sh b/src/extract.sh
index 2584552..678104e 100755
--- a/src/extract.sh
+++ b/src/extract.sh
@@ -1,5 +1,52 @@
#!/usr/bin/env bash
+# TODO Add support for ammendments
+#
+# The user can ammend more information to an issue which is located at
+# a different place by referencing the issue's id. Example:
+#
+# ```bash
+# #!/usr/bin/env bash
+#
+# set -efu
+#
+# ls -al
+# # TODO Original issue
+# #
+# # @id original-issue
+#
+# ls
+# # @original-issue more information on the issue
+# ```
+
+# TODO Only one issue per comment block
+#
+# Only the first TODO/FIXME inside a comment block should be considered
+# as the start of an issue.
+
+# TODO Add support for other keywords
+#
+# Additionally to TODO, also FIXME should start an issue. There might
+# be more interesting keywords.
+
+# TODO Add tags
+#
+# Users can add tags inside issue title and description. Tags are slugs
+# and start with @
+
+# TODO Add filter by tags
+#
+# Users can filter issues for tags with the option -t/--tag @tag.
+
+# TODO Add command line modes list and show
+#
+# `anissue list` lists all issues in the current directory
+# `anissue show <issue>` shows an issue using it's id or automatically
+# assigned identifier
+
+# TODO Generate and show hash for each issue
+
+
set -efu
git ls-files --cached --exclude-standard --other |
@@ -36,6 +83,7 @@ git ls-files --cached --exclude-standard --other |
created_at=$(git show $first_commit --no-patch --format=%ad)
heading=$(echo "$text" | sed '/^$/Q' | sed 's/.*TODO //')
+ # TODO body is not extracted in shell scripts
body=$(echo "$text" | tail -n +$(($(echo "$heading" | wc -l) + 2)) | \
awk -F '[^ ]' '
NR == 1 {n = length($1)}